From 86b136bb592bf576a3da950fee153f6d4f5b9d15 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Thu, 18 Jan 2007 16:52:57 +0000 Subject: Dan McGee * Removed some unnecessary headers and library links * Made things static if possible * Cleaned up makefiles a bit * Fixed some old comments in the code * Fixed some errors the static code checker splint pointed out * Backwards arguments in a memset call in _alpm_db_read (could have been worse) * Other various small fixes Other: * Default to 80 columns when getcols cannot determine display width * Removal of ._install as a valid install file in packages --- src/pacman/pacman.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/pacman/pacman.c') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 54612383..fa3003e2 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -72,15 +72,13 @@ enum { PM_OP_DEPTEST }; -config_t *config = NULL; +config_t *config; pmdb_t *db_local; /* list of (sync_t *) structs for sync locations */ -list_t *pmc_syncs = NULL; +list_t *pmc_syncs; /* list of targets specified on command line */ -list_t *pm_targets = NULL; - -unsigned int maxcols = 80; +static list_t *pm_targets; extern int neednl; @@ -134,8 +132,7 @@ static void usage(int op, char *myname) printf(_(" -l, --list list the contents of the queried package\n")); printf(_(" -m, --foreign list all packages that were not found in the sync db(s)\n")); printf(_(" -o, --owns query the package that owns \n")); - printf(_(" -p, --file pacman will query the package file [package] instead of\n")); - printf(_(" looking in the database\n")); + printf(_(" -p, --file query the package file [package] instead of the database\n")); printf(_(" -s, --search search locally-installed packages for matching strings\n")); } else if(op == PM_OP_SYNC) { printf(_("usage: %s {-S --sync} [options] [package]\n"), myname); @@ -278,7 +275,7 @@ static int parseargs(int argc, char *argv[]) {0, 0, 0, 0} }; char root[PATH_MAX]; - struct stat st = {0}; + struct stat st; while((opt = getopt_long(argc, argv, "ARUFQSTDYr:b:vkhscVfmnoldepiuwyg", opts, &option_index))) { if(opt < 0) { @@ -325,7 +322,7 @@ static int parseargs(int argc, char *argv[]) case 'b': if(stat(optarg, &st) == -1 || !S_ISDIR(st.st_mode)) { pm_fprintf(stderr, NL, _("error: '%s' is not a valid db path\n"), optarg); - exit(1); + exit(EXIT_FAILURE); } alpm_option_set_dbpath(optarg); config->dbpath = alpm_option_get_dbpath(optarg); @@ -481,7 +478,7 @@ int main(int argc, char *argv[]) } else { ERR(NL, _("you cannot perform this operation unless you are root.\n")); config_free(config); - exit(1); + exit(EXIT_FAILURE); } } } -- cgit v1.2.3