From: Michael Schroeder Date: Tue, 25 Mar 2008 11:25:43 +0000 (+0000) Subject: - make it work with really large directories X-Git-Tag: BASE-SuSE-Code-12_1-Branch~783 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=13a78d6883a3b8eaadfb19f05e732a51542826af;p=platform%2Fupstream%2Flibsolv.git - make it work with really large directories --- diff --git a/tools/repo2solv.sh b/tools/repo2solv.sh index 22461b7..7437681 100755 --- a/tools/repo2solv.sh +++ b/tools/repo2solv.sh @@ -97,9 +97,13 @@ elif test -d suse/setup/descr && test -s content; then ) | susetags2solv -c "${olddir}/content" $parser_options || exit 4 cd "$olddir" else - rpms=`ls -1 *.rpm` - if test -n "$rpms"; then - rpms2solv $rpms + rpms='' + for r in *.rpm ; do + rpms="$rpms$r +" + done + if test -n "$rpms" ; then + echo "$rpms" | rpms2solv -m - else exit 1 fi diff --git a/tools/rpms2solv.c b/tools/rpms2solv.c index 141719c..1aa59b0 100644 --- a/tools/rpms2solv.c +++ b/tools/rpms2solv.c @@ -51,7 +51,9 @@ main(int argc, char **argv) } if (manifest) { - if ((fp = fopen(manifest, "r")) == 0) + if (!strcmp(manifest, "-")) + fp = stdin; + else if ((fp = fopen(manifest, "r")) == 0) { perror(manifest); exit(1); @@ -63,7 +65,8 @@ main(int argc, char **argv) rpms = sat_extend(rpms, nrpms, 1, sizeof(char *), 15); rpms[nrpms++] = strdup(buf); } - fclose(fp); + if (fp != stdin) + fclose(fp); } while (optind < argc) {