other distros move to nodemanager that has a single specfile for all packages
[build.git] / partial-repo.sh
1 #!/bin/sh
2
3 COMMAND=$(basename $0)
4
5 function usage () {
6     echo "Usage: $COMMAND repo1..."
7     echo "  a 'RPMS' subdir is expected in each repo arg"
8     exit 1
9 }
10
11 [[ -n "$@" ]] || usage
12 case "$1" in *-h*) usage ;; esac
13
14 set -e 
15
16 for rpms_dir in $(find "$@" -name RPMS) ; do
17     pushd $rpms_dir >& /dev/null
18     cd ..
19     echo "==================== Dealing with repo $(pwd)"
20     mkdir -p PARTIAL-RPMS
21     rsync --archive --verbose $(find RPMS -type f | egrep '/(bootcd|bootstrapfs|nodeimage|noderepo|slicerepo)-.*-.*-.*-.*rpm') PARTIAL-RPMS/
22     echo "==================== building packages index in $(pwd) .."
23     createrepo PARTIAL-RPMS
24     echo '==================== DONE'
25     popd >& /dev/null
26 done