From 5030799ca40ac8228c8a943331f34f8a2a833aed Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Tue, 18 Nov 2008 17:02:39 +0000 Subject: [PATCH] - support "-R" option for recursive plaindir search --- tools/repo2solv.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tools/repo2solv.sh b/tools/repo2solv.sh index aec9948..1bc26d3 100755 --- a/tools/repo2solv.sh +++ b/tools/repo2solv.sh @@ -24,11 +24,21 @@ LANG=C unset CDPATH parser_options=${PARSER_OPTIONS:-} -if test "$1" = "-o" ; then - exec > "$2" - shift - shift -fi +findopt="-prune" + +while true ; do + if test "$1" = "-o" ; then + exec > "$2" + shift + shift + elif test "$1" = "-R" ; then + # recursive + findopt= + shift + else + break + fi +done dir="$1" cd "$dir" || exit 1 @@ -291,15 +301,5 @@ elif test_susetags; then ) | susetags2solv -c "${olddir}/content" $parser_options || exit 4 cd "$olddir" else - rpms='' - for r in *.rpm ; do - test -e "$r" || continue - rpms="$rpms -$r" - done - if test -n "$rpms" ; then - echo "${rpms#?}" | rpms2solv -m - - else - exit 1 - fi + find * -name .\* -prune -o $findopt -name \*.delta.rpm -o -name \*.patch.rpm -o -name \*.rpm -a -type f -print0 | rpms2solv -0 -m - fi -- 2.7.4