Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2006-01-28 05:07:50 +0000
committerJudd Vinet <judd@archlinux.org>2006-01-28 05:07:50 +0000
commitbe38a51750705bba67daa430955d2332870c38a1 (patch)
treed4428b707037c680026087a97457897356f5545a /src
parentf3c5f9b4d1eaa34c0d3893e985900b908f0b08b0 (diff)
added a --noprogressbar switch for scripts to use
Diffstat (limited to 'src')
-rw-r--r--src/pacman/conf.h1
-rw-r--r--src/pacman/download.c4
-rw-r--r--src/pacman/pacman.c3
3 files changed, 8 insertions, 0 deletions
diff --git a/src/pacman/conf.h b/src/pacman/conf.h
index 549da7e0..fdd4b20a 100644
--- a/src/pacman/conf.h
+++ b/src/pacman/conf.h
@@ -33,6 +33,7 @@ typedef struct __config_t {
unsigned short help;
unsigned short upgrade;
unsigned short noconfirm;
+ unsigned short noprogressbar;
unsigned short op_d_vertest;
unsigned short op_d_resolve;
unsigned short op_q_isfile;
diff --git a/src/pacman/download.c b/src/pacman/download.c
index ad19f4d4..ce595495 100644
--- a/src/pacman/download.c
+++ b/src/pacman/download.c
@@ -64,6 +64,10 @@ static int log_progress(netbuf *ctl, int xfered, void *arg)
static unsigned short mouth;
static unsigned int lastcur = 0;
+ if(config->noprogressbar) {
+ return(1);
+ }
+
gettimeofday(&t1, NULL);
if(xfered+offset == fsz) {
t = t0;
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index ea3babe3..715b3244 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -300,6 +300,7 @@ int parseargs(int argc, char *argv[])
{"config", required_argument, 0, 1001},
{"ignore", required_argument, 0, 1002},
{"debug", required_argument, 0, 1003},
+ {"noprogressbar", no_argument, 0, 1004},
{0, 0, 0, 0}
};
char root[PATH_MAX];
@@ -319,6 +320,7 @@ int parseargs(int argc, char *argv[])
break;
case 1002: config->op_s_ignore = list_add(config->op_s_ignore, strdup(optarg)); break;
case 1003: config->debug = atoi(optarg); break;
+ case 1004: config->noprogressbar = 1; break;
case 'A': config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_ADD); break;
case 'D':
config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_DEPTEST);
@@ -482,6 +484,7 @@ void usage(int op, char *myname)
}
printf(" --config <path> set an alternate configuration file\n");
printf(" --noconfirm do not ask for anything confirmation\n");
+ printf(" --noprogressbar do not show a progress bar when downloading files\n");
printf(" -v, --verbose be verbose\n");
printf(" -r, --root <path> set an alternate installation root\n");
printf(" -b, --dbpath <path> set an alternate database location\n");