Using myrepos with the team's packages

Felipe Sateler fsateler at debian.org
Tue Jul 8 19:26:56 UTC 2014


On Tue, Jul 8, 2014 at 1:42 PM, Jonas Smedegaard <dr at jones.dk> wrote:
> 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" \

Yes, maxdepth is a good idea, probably.

> | perl -nE 'm{([^/]+).git$} and say $1' \

I'm not sure this part is more readable, but YMMV ;)

> | 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.

Indeed, although that can be fixed by prepending a "rm -f .mrconfig"
in the script where you are storing this snippet.

>
> Other than that, nice explanation!

Thanks! I hope it is useful

-- 

Saludos,
Felipe Sateler



More information about the pkg-multimedia-maintainers mailing list