[pacman-dev] Make pacscripts faster

Dan McGee dpmcgee at gmail.com
Tue Jun 11 14:38:04 EDT 2013


On Tue, Jun 11, 2013 at 3:42 AM, Karol Blazewicz
<karol.blazewicz at gmail.com> wrote:
> I noticed that for bigger packages that are in the cache, but are not
> installed, pacscripts takes a long time reading the archive, even
> though it prints the install script almost instantaneously.
>
> $ diff -Naur /usr/bin/pacscripts{,.alt}
> --- /usr/bin/pacscripts    2013-05-07 05:36:51.000000000 +0200
> +++ /usr/bin/pacscripts.alt    2013-06-11 10:24:40.382742837 +0200
> @@ -91,7 +91,7 @@
>  }
>
>  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
>
> Adding '-q' switch doesn't seem to break anything and on slower
> computers the difference in execution is significant:
>
> $ time /usr/bin/pacscripts.alt >/dev/null chromium
>
> real    0m1.690s
> user    0m1.045s
> sys    0m0.085s
> $ time /usr/bin/pacscripts >/dev/null chromium
>
> real    0m16.536s
> user    0m12.991s
> sys    0m0.175s

I have no problem with this change, and think it is a good idea, but
can you submit it as a proper git formatted patch against the
codebase? Thanks!

-Dan


More information about the pacman-dev mailing list