- make it work with really large directories
authorMichael Schroeder <mls@suse.de>
Tue, 25 Mar 2008 11:25:43 +0000 (11:25 +0000)
committerMichael Schroeder <mls@suse.de>
Tue, 25 Mar 2008 11:25:43 +0000 (11:25 +0000)
tools/repo2solv.sh
tools/rpms2solv.c

index 22461b7..7437681 100755 (executable)
@@ -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
index 141719c..1aa59b0 100644 (file)
@@ -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)
     {