From 1953fe43689054aded03eb166f4f987e7cc0dccd Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 1 Nov 2011 19:17:26 -0500 Subject: Fix thinko in _alpm_strip_newline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The point of this early compare to NULL byte check was so we could bail early and skip the strcmp() call. Given we weren't doing the check right, this never exited early. Fix it to work as intended. Noticed-by: Pepe Juárez Signed-off-by: Dan McGee --- lib/libalpm/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 12286c6a..fbb320ef 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -221,7 +221,7 @@ char *_alpm_strtrim(char *str) size_t _alpm_strip_newline(char *str) { size_t len; - if(str == '\0') { + if(*str == '\0') { return 0; } len = strlen(str); -- cgit v1.2.3-70-g09d2 From 601c808b8d3d4eec76b215e56f1d56f4fe591367 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 3 Nov 2011 09:54:33 -0500 Subject: Fix download progress rounding edge case Allan's original message: Occasionally when the download rate showed 100.0 the output got messed up. This was caused by the rounding of a number between 99.95 and 100. Adjust the threshold to avoid this rounding issue. Dan: make this fix, but also show values between 0 and 9.995 with two decimal places since we have the room. Original-fix-by: Allan McRae Signed-off-by: Dan McGee --- src/pacman/callback.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 3ba07b0c..c7c16949 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -697,8 +697,11 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total) xfered_human = humanize_size(xfered, '\0', &xfered_label); printf(" %ls%-*s ", wcfname, padwid, ""); - /* We will show 1.6M/s, 11.6M/s, but 116K/s and 1116K/s */ - if(rate_human < 100.0) { + /* We will show 1.62M/s, 11.6M/s, but 116K/s and 1116K/s */ + if(rate_human < 9.995) { + printf("%6.1f %3s %4.2f%c/s ", + xfered_human, xfered_label, rate_human, rate_label[0]); + } else if(rate_human < 99.95) { printf("%6.1f %3s %4.1f%c/s ", xfered_human, xfered_label, rate_human, rate_label[0]); } else { -- cgit v1.2.3-70-g09d2 From e7b56f48d704f57f023d7ca3cdc9d492fb31a9cb Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Mon, 7 Nov 2011 14:47:58 +1000 Subject: makepkg: handle pgp signatures with .sign extension Detached sgnature files with extension .sign are accepted by gnupg. Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 3085bf59..5d048d28 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -334,7 +334,7 @@ in_array() { source_has_signatures(){ local file for file in "${source[@]}"; do - if [[ $file = *.@(sig|asc) ]]; then + if [[ $file = *.@(sig?(n)|asc) ]]; then return 0 fi done @@ -704,7 +704,7 @@ check_pgpsigs() { for file in "${source[@]}"; do file="$(get_filename "$file")" - if [[ ! $file = *.@(sig|asc) ]]; then + if [[ ! $file = *.@(sig?(n)|asc) ]]; then continue fi -- cgit v1.2.3-70-g09d2