summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-07-17 17:54:58 +0200
committerDan McGee <dan@archlinux.org>2011-07-19 04:01:12 +0200
commitf1d25ba2dd2640054b8e2e1c7c39669abb0cc6e8 (patch)
treeeda50c53d74f118187076697b49dc851159a9d0f
parentd86a60c6946eeb27ee1092760c8608e207cccb8d (diff)
downloadpacman-f1d25ba2dd2640054b8e2e1c7c39669abb0cc6e8.tar.gz
pacman-f1d25ba2dd2640054b8e2e1c7c39669abb0cc6e8.tar.xz
pacman/callback: show .sig suffix on sig download
Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--src/pacman/callback.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index d34aca13..237ccea0 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -604,10 +604,17 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total)
eta_m = eta_s / 60;
eta_s -= eta_m * 60;
- fname = strdup(filename);
+ /* allocate length+1 (plus null) in case we need to exchange .db for .sig */
+ fname = calloc(1, strlen(filename) + 2);
+ strcpy(fname, filename);
/* strip package or DB extension for cleaner look */
if((p = strstr(fname, ".pkg")) || (p = strstr(fname, ".db"))) {
- *p = '\0';
+ *p = '\0';
+
+ /* tack on a .sig suffix for signatures */
+ if((p = strstr(filename, ".sig"))) {
+ strcat(fname, ".sig");
+ }
}
/* In order to deal with characters from all locales, we have to worry
* about wide characters and their column widths. A lot of stuff is