Argh, can't code Bash properly
authorKlaus Kaempf <kkaempf@suse.de>
Fri, 15 Feb 2008 16:41:45 +0000 (16:41 +0000)
committerKlaus Kaempf <kkaempf@suse.de>
Fri, 15 Feb 2008 16:41:45 +0000 (16:41 +0000)
tools/repo2solv.sh

index bcf0318..aeebf7b 100755 (executable)
@@ -5,6 +5,8 @@
 # tries to detect the repo type and generate one SOLV file on stdout
 
 LANG=C
+parser_options=${PARSER_OPTIONS:-}
+
 
 dir="$1"
 cd "$dir" || exit 1
@@ -25,7 +27,7 @@ if test -d repodata; then
   if test -n "$cmd"; then
     # we have some primary.xml*
     primfile=`mktemp` || exit 3
-    $cmd $i | rpmmd2solv $(PARSER_OPTIONS) > $primfile
+    $cmd $i | rpmmd2solv $parser_options > $primfile
   fi
 
   patchfile="/nonexist"
@@ -41,7 +43,7 @@ if test -d repodata; then
        esac
      done
      echo '</patches>'
-    ) | grep -v '\?xml' | patchxml2solv $(PARSER_OPTIONS) > $patchfile
+    ) | grep -v '\?xml' | patchxml2solv $parser_options > $patchfile
   fi
 
   # Now merge primary and patches
@@ -89,6 +91,8 @@ elif test -d suse/setup/descr && test -s content; then
        esac
       done
     fi
-  ) | susetags2solv -c "${olddir}/content" $(PARSER_OPTIONS)
+  ) | susetags2solv -c "${olddir}/content" $parser_options
   cd "$olddir"
+else
+  exit 1
 fi