a script to create partial myplc repositories. this comes handy to
authorBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Mon, 10 May 2010 14:37:00 +0000 (14:37 +0000)
committerBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Mon, 10 May 2010 14:37:00 +0000 (14:37 +0000)
support more than one distro/arch in a myplc installation.

bin/partial-repo.sh [new file with mode: 0755]

diff --git a/bin/partial-repo.sh b/bin/partial-repo.sh
new file mode 100755 (executable)
index 0000000..09771c0
--- /dev/null
@@ -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