main.c (201226) | main.c (207113) |
---|---|
1/* 2 * FreeBSD install - a package for the installation and maintainance 3 * of non-core utilities. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 5 unchanged lines hidden (view full) --- 14 * Jeremy D. Lea. 15 * 11 May 2002 16 * 17 * This is the version module. Based on pkg_version.pl by Bruce A. Mah. 18 * 19 */ 20 21#include <sys/cdefs.h> | 1/* 2 * FreeBSD install - a package for the installation and maintainance 3 * of non-core utilities. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 5 unchanged lines hidden (view full) --- 14 * Jeremy D. Lea. 15 * 11 May 2002 16 * 17 * This is the version module. Based on pkg_version.pl by Bruce A. Mah. 18 * 19 */ 20 21#include <sys/cdefs.h> |
22__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/version/main.c 201226 2009-12-29 22:33:53Z ed $"); | 22__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/version/main.c 207113 2010-04-23 11:07:43Z flz $"); |
23 24 25#include <getopt.h> 26#include <err.h> 27 | 23 24 25#include <getopt.h> 26#include <err.h> 27 |
28#include "lib.h" | 28#include <pkg.h> |
29#include "version.h" 30 31char *LimitChars = NULL; 32char *PreventChars = NULL; 33char *MatchName = NULL; 34char *LookUpOrigin = NULL; 35Boolean RegexExtended = FALSE; 36Boolean UseINDEXOnly = FALSE; --- 16 unchanged lines hidden (view full) --- 53 { NULL, 0, NULL, 0 } 54}; 55 56int 57main(int argc, char **argv) 58{ 59 int ch, cmp = 0; 60 | 29#include "version.h" 30 31char *LimitChars = NULL; 32char *PreventChars = NULL; 33char *MatchName = NULL; 34char *LookUpOrigin = NULL; 35Boolean RegexExtended = FALSE; 36Boolean UseINDEXOnly = FALSE; --- 16 unchanged lines hidden (view full) --- 53 { NULL, 0, NULL, 0 } 54}; 55 56int 57main(int argc, char **argv) 58{ 59 int ch, cmp = 0; 60 |
61 pkg_wrap(PKG_INSTALL_VERSION, argv); 62 |
|
61 if (argc == 4 && !strcmp(argv[1], "-t")) { 62 cmp = version_cmp(argv[2], argv[3]); 63 printf(cmp > 0 ? ">\n" : (cmp < 0 ? "<\n" : "=\n")); 64 exit(0); 65 } 66 else if (argc == 4 && !strcmp(argv[1], "-T")) { 67 cmp = version_match(argv[3], argv[2]); 68 exit(cmp == 1 ? 0 : 1); --- 69 unchanged lines hidden --- | 63 if (argc == 4 && !strcmp(argv[1], "-t")) { 64 cmp = version_cmp(argv[2], argv[3]); 65 printf(cmp > 0 ? ">\n" : (cmp < 0 ? "<\n" : "=\n")); 66 exit(0); 67 } 68 else if (argc == 4 && !strcmp(argv[1], "-T")) { 69 cmp = version_match(argv[3], argv[2]); 70 exit(cmp == 1 ? 0 : 1); --- 69 unchanged lines hidden --- |