add a 'g' to the sed line
[platform/upstream/libsolv.git] / tools / repo2solv.sh
index c3f968a..11c6567 100755 (executable)
@@ -104,6 +104,8 @@ while true ; do
   elif test "$1" = "-X" ; then
     addautooption=-X
     shift
+  elif test "$1" = "-A" ; then
+    shift
   else
     break
   fi
@@ -146,7 +148,7 @@ if test "$repotype" = rpmmd ; then
        repomd_decompress "$susedataxml"
      fi
      echo '</rpmmd>'
-    ) | grep -v '\?xml' |  sed '1i\<?xml version="1.0" encoding="UTF-8"?>' | rpmmd2solv $parser_options > $primfile || exit 4
+    ) | sed 's/<?xml[^>]*>//g' | sed '1i\<?xml version="1.0" encoding="UTF-8"?>' | rpmmd2solv $parser_options > $primfile || exit 4
   fi
 
   prodfile=
@@ -204,8 +206,11 @@ if test "$repotype" = rpmmd ; then
   fi
 
   # This contains appdata
+  appdataxml=
   appdatafile=
-  appdataxml=`repomd_findfile appdata appdata.xml`
+  if test -x /usr/bin/appdata2solv ; then
+      appdataxml=`repomd_findfile appdata appdata.xml`
+  fi
   if test -n "$appdataxml" -a -s "$appdataxml" ; then
       appdatafile=`mktemp` || exit 3
       repomd_decompress "$appdataxml" | appdata2solv $parser_options > $appdatafile || exit 4
@@ -219,8 +224,11 @@ elif test "$repotype" = susetags ; then
   olddir=`pwd`
   DESCR=$(get_DESCRDIR)
   cd ${DESCR} || exit 2
+  appdataxml=
   appdatafile=
-  appdataxml=`susetags_findfile appdata.xml`
+  if test -x /usr/bin/appdata2solv ; then
+      appdataxml=`susetags_findfile appdata.xml`
+  fi
   if test -n "$appdataxml" ; then
       appdatafile=`mktemp` || exit 3
       repomd_decompress "$appdataxml" | appdata2solv $parser_options > $appdatafile || exit 4