[pacman-dev] [PATCH 1/3] contrib/paclog-pkglist: fix script name in usage
Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- Just an oversight when I renamed the script, as pointed out by Allan. Sadly, awk doesn't have an equivalent of ${0##*/} when excuted under a #!/bin/awk shebang (ARGV[0] will always show 'awk'), so we just hard code it. contrib/paclog-pkglist | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/paclog-pkglist b/contrib/paclog-pkglist index 2c66e63..5948a0d 100755 --- a/contrib/paclog-pkglist +++ b/contrib/paclog-pkglist @@ -19,8 +19,8 @@ BEGIN { if (ARGC < 2) { - printf "usage: log2pkglist <pacman log>\n" - printf "example: log2pkglist /var/log/pacman.log\n" + printf "usage: paclog-pkglist <pacman log>\n" + printf "example: paclog-pkglist /var/log/pacman.log\n" exit } } -- 1.7.6
Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- src/pacman/callback.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pacman/callback.c b/src/pacman/callback.c index d34aca1..237ccea 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 -- 1.7.6
* assert is_bash to pickup more valid syntax * add checkdepends highlighting Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- Someone should really update this file to properly support split PKGBUILDs. I wanted to delete it until I realized that we've been keeping this somewhat up to date in places. contrib/PKGBUILD.vim | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/contrib/PKGBUILD.vim b/contrib/PKGBUILD.vim index f627a5e..1814c22 100644 --- a/contrib/PKGBUILD.vim +++ b/contrib/PKGBUILD.vim @@ -13,6 +13,7 @@ elseif exists("b:current_syntax") endif let b:main_syntax = "sh" +let b:is_bash = 1 runtime! syntax/sh.vim " case on @@ -106,6 +107,11 @@ syn keyword pb_k_optdepends optdepends contained syn match pbValidOptdepends /\([[:alnum:]]\|+\|-\|_\)*/ contained syn region pbOptdependsGroup start=/^optdepends=(/ end=/)/ contains=pb_k_optdepends,pbValidOptdepends,shDoubleQuote,shSingleQuote +" checkdepends +syn keyword pb_k_ckdepends ckdepends contained +syn match pbValidCkdepends /\([[:alnum:]]\|+\|-\|_\)*/ contained +syn region pbCkdependsGroup start=/^checkdepends=(/ end=/)/ contains=pb_k_ckdepends,pbValidCkdepends,shDoubleQuote,shSingleQuote + " conflicts syn keyword pb_k_conflicts conflicts contained syn match pbValidConflicts /\([[:alnum:]]\|+\|-\|_\)*/ contained @@ -228,6 +234,7 @@ hi def link pbIllegalArch Error hi def link pb_k_groups pbKeywords hi def link pb_k_makedepends pbKeywords hi def link pb_k_optdepends pbKeywords +hi def link pb_k_ckdepends pbKeywords hi def link pb_k_depends pbKeywords hi def link pb_k_replaces pbKeywords hi def link pb_k_conflicts pbKeywords -- 1.7.6
On Sun, Jul 17, 2011 at 12:15 PM, Dave Reisner <d@falconindy.com> wrote:
* assert is_bash to pickup more valid syntax * add checkdepends highlighting
Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- Someone should really update this file to properly support split PKGBUILDs. I wanted to delete it until I realized that we've been keeping this somewhat up to date in places.
We could definitely use an "expert" in writing these take a look. There are all sorts of issues but it is nice to have the unknown variables in a different color and simple sanity checks like too long of a description.
contrib/PKGBUILD.vim | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/contrib/PKGBUILD.vim b/contrib/PKGBUILD.vim index f627a5e..1814c22 100644 --- a/contrib/PKGBUILD.vim +++ b/contrib/PKGBUILD.vim @@ -13,6 +13,7 @@ elseif exists("b:current_syntax") endif
let b:main_syntax = "sh" +let b:is_bash = 1 runtime! syntax/sh.vim
" case on @@ -106,6 +107,11 @@ syn keyword pb_k_optdepends optdepends contained syn match pbValidOptdepends /\([[:alnum:]]\|+\|-\|_\)*/ contained syn region pbOptdependsGroup start=/^optdepends=(/ end=/)/ contains=pb_k_optdepends,pbValidOptdepends,shDoubleQuote,shSingleQuote
+" checkdepends +syn keyword pb_k_ckdepends ckdepends contained +syn match pbValidCkdepends /\([[:alnum:]]\|+\|-\|_\)*/ contained +syn region pbCkdependsGroup start=/^checkdepends=(/ end=/)/ contains=pb_k_ckdepends,pbValidCkdepends,shDoubleQuote,shSingleQuote + " conflicts syn keyword pb_k_conflicts conflicts contained syn match pbValidConflicts /\([[:alnum:]]\|+\|-\|_\)*/ contained @@ -228,6 +234,7 @@ hi def link pbIllegalArch Error hi def link pb_k_groups pbKeywords hi def link pb_k_makedepends pbKeywords hi def link pb_k_optdepends pbKeywords +hi def link pb_k_ckdepends pbKeywords hi def link pb_k_depends pbKeywords hi def link pb_k_replaces pbKeywords hi def link pb_k_conflicts pbKeywords -- 1.7.6
Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- Just an oversight when I renamed the script, as pointed out by Allan. Sadly, awk doesn't have an equivalent of ${0##*/} when excuted under a #!/bin/awk shebang (ARGV[0] will always show 'awk'), so we just hard code it.
contrib/paclog-pkglist | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/paclog-pkglist b/contrib/paclog-pkglist index 2c66e63..5948a0d 100755 --- a/contrib/paclog-pkglist +++ b/contrib/paclog-pkglist @@ -19,8 +19,8 @@
BEGIN { if (ARGC < 2) { - printf "usage: log2pkglist <pacman log>\n" - printf "example: log2pkglist /var/log/pacman.log\n" + printf "usage: paclog-pkglist <pacman log>\n" + printf "example: paclog-pkglist /var/log/pacman.log\n" Something I did notice with this change is we didn't make this a *.in
On Sun, Jul 17, 2011 at 12:15 PM, Dave Reisner <d@falconindy.com> wrote: script like every other one in this directory. If we did, @localstatedir@/log/pacman.log would be useful here, just as we define it in src/pacman/Makefile.am. I'm also not sure of awk's command line foo, but it would be nice if called without an argument we tried the default log location first before erroring.
exit } } -- 1.7.6
On Mon, Jul 18, 2011 at 07:45:00AM -0500, Dan McGee wrote:
Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- Just an oversight when I renamed the script, as pointed out by Allan. Sadly, awk doesn't have an equivalent of ${0##*/} when excuted under a #!/bin/awk shebang (ARGV[0] will always show 'awk'), so we just hard code it.
contrib/paclog-pkglist | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/paclog-pkglist b/contrib/paclog-pkglist index 2c66e63..5948a0d 100755 --- a/contrib/paclog-pkglist +++ b/contrib/paclog-pkglist @@ -19,8 +19,8 @@
BEGIN { if (ARGC < 2) { - printf "usage: log2pkglist <pacman log>\n" - printf "example: log2pkglist /var/log/pacman.log\n" + printf "usage: paclog-pkglist <pacman log>\n" + printf "example: paclog-pkglist /var/log/pacman.log\n" Something I did notice with this change is we didn't make this a *.in
On Sun, Jul 17, 2011 at 12:15 PM, Dave Reisner <d@falconindy.com> wrote: script like every other one in this directory. If we did, @localstatedir@/log/pacman.log would be useful here, just as we define it in src/pacman/Makefile.am.
I'm also not sure of awk's command line foo, but it would be nice if called without an argument we tried the default log location first before erroring.
Sounds very reasonable. I can do this. d
exit } } -- 1.7.6
participants (2)
-
Dan McGee
-
Dave Reisner