From: Barış Metin Date: Mon, 10 May 2010 14:37:00 +0000 (+0000) Subject: a script to create partial myplc repositories. this comes handy to X-Git-Tag: MyPLC-5.0-4~4 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=d5776c4d1ca6f30094ddc9943fe14ddd7bccbc03;hp=9e4e31027654a77f934892ee5bd73851731af02a;p=myplc.git a script to create partial myplc repositories. this comes handy to support more than one distro/arch in a myplc installation. --- diff --git a/bin/partial-repo.sh b/bin/partial-repo.sh new file mode 100755 index 0000000..09771c0 --- /dev/null +++ b/bin/partial-repo.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# $URL$ + +COMMAND=$(basename $0) + +function usage () { + echo "Usage: $COMMAND repo1..." + echo " a 'RPMS' subdir is expected in each repo arg" + exit 1 +} + +[[ -n "$@" ]] || usage + +set -e + +for repo in "$@" ; do + if [ ! -d $repo/RPMS ] ; then + echo could not find $repo/RPMS - ignored + continue + fi + + cd $repo + echo "==================== Dealing with repo $repo" + mkdir -p PARTIAL-RPMS + rsync --archive --verbose $(find RPMS -type f | egrep '/(bootcd|bootstrapfs|noderepo)-.*-.*-.*-.*rpm') PARTIAL-RPMS/ + echo "==================== building packages index in $repo .." + createrepo PARTIAL-RPMS + echo '==================== DONE' + cd - >& /dev/null +done