[pacman-dev] [PATCH] pacscripts: don't read the whole package from cache
From: Karol Blazewicz <karol.blazewicz@gmail.com> '-q' means "Exit as soon as each specified pattern or filename has been matched." There is no reason to keep reading the rest of the package from cache when the install script has already been printed to stdout. Signed-off-by: Karol Błażewicz <karol.blazewicz at gmail.com> --- contrib/pacscripts.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/pacscripts.sh.in b/contrib/pacscripts.sh.in index 8468714..4ecebde 100644 --- a/contrib/pacscripts.sh.in +++ b/contrib/pacscripts.sh.in @@ -91,7 +91,7 @@ print_db() { } print_pkg() { - if ! bsdtar -xOf "$1" .INSTALL 2>/dev/null; then + if ! bsdtar -xqOf "$1" .INSTALL 2>/dev/null; then error "Package $1 does not include any .INSTALL script" return 1 fi -- 1.8.3.1
On Tue, Jun 11, 2013 at 10:19 PM, Karol Blazewicz <karol.blazewicz at gmail.com> <karol.blazewicz@gmail.com> wrote:
From: Karol Blazewicz <karol.blazewicz@gmail.com>
'-q' means "Exit as soon as each specified pattern or filename has been matched." There is no reason to keep reading the rest of the package from cache when the install script has already been printed to stdout.
Signed-off-by: Karol Błażewicz <karol.blazewicz at gmail.com> --- contrib/pacscripts.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/pacscripts.sh.in b/contrib/pacscripts.sh.in index 8468714..4ecebde 100644 --- a/contrib/pacscripts.sh.in +++ b/contrib/pacscripts.sh.in @@ -91,7 +91,7 @@ print_db() { }
print_pkg() { - if ! bsdtar -xOf "$1" .INSTALL 2>/dev/null; then + if ! bsdtar -xqOf "$1" .INSTALL 2>/dev/null; then error "Package $1 does not include any .INSTALL script" return 1 fi -- 1.8.3.1
There's an extra 'From: Karol Blazewicz <karol.blazewicz@gmail.com>' at the top - just so you remember who authored this masterpiece ;P I think I got rid of it now, so I can resend the patch if needed (or send it to a volunteer off-list first, so the ML isn't littered with my contribution attempts). Any other hints? Line length for comment is 72 chars, 80 chars or ...?
On 12/06/13 06:41, Karol Blazewicz wrote:
On Tue, Jun 11, 2013 at 10:19 PM, Karol Blazewicz <karol.blazewicz at gmail.com> <karol.blazewicz@gmail.com> wrote:
From: Karol Blazewicz <karol.blazewicz@gmail.com>
'-q' means "Exit as soon as each specified pattern or filename has been matched." There is no reason to keep reading the rest of the package from cache when the install script has already been printed to stdout.
Signed-off-by: Karol Błażewicz <karol.blazewicz at gmail.com> --- contrib/pacscripts.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/pacscripts.sh.in b/contrib/pacscripts.sh.in index 8468714..4ecebde 100644 --- a/contrib/pacscripts.sh.in +++ b/contrib/pacscripts.sh.in @@ -91,7 +91,7 @@ print_db() { }
print_pkg() { - if ! bsdtar -xOf "$1" .INSTALL 2>/dev/null; then + if ! bsdtar -xqOf "$1" .INSTALL 2>/dev/null; then error "Package $1 does not include any .INSTALL script" return 1 fi -- 1.8.3.1
There's an extra 'From: Karol Blazewicz <karol.blazewicz@gmail.com>' at the top - just so you remember who authored this masterpiece ;P I think I got rid of it now, so I can resend the patch if needed (or send it to a volunteer off-list first, so the ML isn't littered with my contribution attempts). Any other hints? Line length for comment is 72 chars, 80 chars or ...?
I think we use 80 char line length with tabs at two characters, but meh... Anyway, I'm too lazy to fix that while committing so please resend with an additional: Copyright (c) 2009-2013 Pacman Development Team <pacman-dev@archlinux.org> in the header too. Thanks, Allan
participants (3)
-
Allan McRae
-
Karol Blazewicz
-
Karol Blazewicz <karol.blazewicz at gmail.com>