X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=partial-repo.sh;h=06da2663713e791d196f9a737b4638e582484428;hb=55bb6bb4ff123cbf658b0bb00bc21b8ffe4344c5;hp=674c95172f2f8e5154ce66e711352f32948618ae;hpb=39a06704d35f76e195bc79c11443d09125726a72;p=build.git diff --git a/partial-repo.sh b/partial-repo.sh index 674c9517..06da2663 100755 --- a/partial-repo.sh +++ b/partial-repo.sh @@ -1,5 +1,4 @@ #!/bin/sh -# $URL$ COMMAND=$(basename $0) @@ -10,21 +9,18 @@ function usage () { } [[ -n "$@" ]] || usage +case "$1" in *-h*) usage ;; esac 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" +for rpms_dir in $(find "$@" -name RPMS) ; do + pushd $rpms_dir >& /dev/null + cd .. + echo "==================== Dealing with repo $(pwd)" mkdir -p PARTIAL-RPMS rsync --archive --verbose $(find RPMS -type f | egrep '/(bootcd|bootstrapfs|nodeimage|noderepo|slicerepo)-.*-.*-.*-.*rpm') PARTIAL-RPMS/ - echo "==================== building packages index in $repo .." + echo "==================== building packages index in $(pwd) .." createrepo PARTIAL-RPMS echo '==================== DONE' - cd - >& /dev/null + popd >& /dev/null done