summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChantry Xavier <shiningxc@gmail.com>2007-10-05 16:18:29 +0200
committerDan McGee <dan@archlinux.org>2007-10-08 20:46:56 -0500
commite03a1f0044ebd7a477b44af411f296d72e3bba4d (patch)
tree78c7b1f430174c3e190473915543a857dfacd5a6
parent920b0d2049deb148efe89bfebda03d172b68c1f5 (diff)
downloadpacman-e03a1f0044ebd7a477b44af411f296d72e3bba4d.tar.xz
pacman/pacman.c : add --logfile option.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
-rw-r--r--src/pacman/pacman.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 54a962a8..5d8694c1 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -140,6 +140,7 @@ static void usage(int op, char *myname)
printf(_(" --ignore <pkg> ignore a package upgrade (can be used more than once)\n"));
}
printf(_(" --config <path> set an alternate configuration file\n"));
+ printf(_(" --logfile <path> set an alternate log file\n"));
printf(_(" --noconfirm do not ask for any confirmation\n"));
printf(_(" --noprogressbar do not show a progress bar when downloading files\n"));
printf(_(" --noscriptlet do not execute the install scriptlet if one exists\n"));
@@ -286,6 +287,7 @@ static int parseargs(int argc, char *argv[])
{"noscriptlet", no_argument, 0, 1005},
{"cachedir", required_argument, 0, 1007},
{"asdeps", no_argument, 0, 1008},
+ {"logfile", required_argument, 0, 1009},
{0, 0, 0, 0}
};
@@ -338,6 +340,14 @@ static int parseargs(int argc, char *argv[])
case 1008:
config->flags |= PM_TRANS_FLAG_ALLDEPS;
break;
+ case 1009:
+ if(alpm_option_set_logfile(optarg) != 0) {
+ pm_printf(PM_LOG_ERROR, _("problem setting logfile '%s' (%s)\n"),
+ optarg, alpm_strerrorlast());
+ return(1);
+ }
+ config->have_logfile = 1;
+ break;
case 'A': config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_ADD); break;
case 'F':
config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_UPGRADE);