Using myrepos with the team's packages

Jonas Smedegaard dr at jones.dk
Tue Jul 8 17:42:28 UTC 2014


Quoting Felipe Sateler (2014-07-08 18:51:33)
> I've discovered myrepos, which is a very useful tool for managing 
> multiple repositories. I currently store all the team repositories 
> inside a single pkg-multimedia folder, so I thought using mr should be 
> easy. So I came up with the following shell line that works for me, 
> and I thought I'd share.
> 
> ssh alioth.debian.org "cd /git/pkg-multimedia/ && \
>   find . -name '*.git' -type d" | \
>   sed -e 's|^\./||' -e 's/\.git$//' | \
>   while read package;
> do
>   echo "[$package]"
>   echo "checkout = gbp clone
> git+ssh://git.debian.org/git/pkg-multimedia/${package}.git"
>   echo "update = gbp pull"
>   echo "skip = lazy"
>   echo
> done > .mrconfig

Here's an (arguably) safer and easier to read alternative:

ssh git.debian.org \
"find /git/pkg-multimedia/ -maxdepth 1 -name '*.git' -type d" \
| perl -nE 'm{([^/]+).git$} and say $1' \
| while read package; do
    cat >> .mrconfig <<EOF
[$package]
checkout = gbp clone git+ssh://git.debian.org/git/pkg-multimedia/${package}.git
update = gbp pull
skip = lazy

EOF
done


Beware, though, that my script isn't idempotent.

Other than that, nice explanation!


 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20140708/a9b9a04d/attachment.sig>


More information about the pkg-multimedia-maintainers mailing list