patchutils, xargs ftw

Sandro Tosi morph at debian.org
Mon Jan 26 18:51:56 UTC 2009


Myon,
thank you again for your support! Your changes have just been committed.

Cheers,
Sandro

On Mon, Jan 26, 2009 at 09:27, Christoph Berg <myon at debian.org> wrote:
> Hi,
>
> patchutils has a trac:
>
> [patchutils]
> type     = trac
> uri      = https://fedorahosted.org/patchutils
>
>
> xargs is several orders of magnitude faster than find -exec in this
> script:
>
> diff --git a/bts-link_merkel.sh b/bts-link_merkel.sh
> index 539d50f..43bb38e 100755
> --- a/bts-link_merkel.sh
> +++ b/bts-link_merkel.sh
> @@ -3,7 +3,7 @@
>  # extract data from the bts mirror (we need only summary files)
>  # we need only the file for forwarded bugs (forwarded to http links)
>  # then we parse data to "<bugs nnn>: <url>", sort and add to index.fwd file
> -find /org/bugs.debian.org/spool/db-h/ -name "*.summary" -exec grep -H '^Forwarded-To' {} \; | grep 'http[s]*://' | se
> d -e 's~^\(.*\)/\([0-9]*\).summary:Forwarded-To:~\2:~' | sort > index.fwd.new
> +find /org/bugs.debian.org/spool/db-h/ -name "*.summary" | xargs grep -H '^Forwarded-To' | grep 'http[s]*://' | sed -e
>  's~^\(.*\)/\([0-9]*\).summary:Forwarded-To:~\2:~' | sort > index.fwd.new
>
>  # replace "real" file
>  mv index.fwd.new index.fwd
>
> Christoph
> --
> cb at df7cb.de | http://www.df7cb.de/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkl9c9UACgkQxa93SlhRC1r8/QCfRsiMcFHGu2PLTxTOpWB9ohKP
> y/4An2Lh/NLiGKEUNk6kEc1JEk6s/n0j
> =2bkc
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Bts-link-devel mailing list
> Bts-link-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/bts-link-devel
>



-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi



More information about the Bts-link-devel mailing list