support for susedata.xml
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Fri, 12 Sep 2008 15:32:20 +0000 (15:32 +0000)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Fri, 12 Sep 2008 15:32:20 +0000 (15:32 +0000)
tools/repo2solv.sh
tools/repo_rpmmd.c

index 1524746..e214589 100755 (executable)
@@ -47,6 +47,25 @@ if test -d repodata; then
     $cmd $i | rpmmd2solv $parser_options > $primfile || exit 4
   fi
 
+  # This contains a susedata.xml* with extended primary data
+ if test -f susedata.xml || test -f susedata.xml.gz || test -f susedata.xml.bz2 ; then
+     for i in susedata.xml*; do
+         case $i in
+             *.gz) cmd="gzip -dc" ;;
+             *.bz2) cmd="bzip2 -dc" ;;
+             *) cmd="cat" ;;
+         esac
+    # only check the first susedata.xml*, in case there are more
+         break
+     done
+     susedatafile="/nonexist"
+     if test -n "$cmd"; then
+    # we have some susedata.xml*
+         susedatafile=`mktemp` || exit 3
+         $cmd $i | rpmmd2solv $parser_options > $susedatafile || exit 4
+     fi
+  fi
+
   prodfile="/nonexist"
   if test -f product.xml; then
     prodfile=`mktemp` || exit 3
@@ -143,6 +162,9 @@ if test -d repodata; then
   if test -s $repomdfile; then
     m_repomdfile=$repomdfile
   fi
+  if test -s $susedatafile; then
+    m_susedata=$susedatafile
+  fi
   if test -s $primfile; then
     m_primfile=$primfile
   fi
@@ -158,7 +180,7 @@ if test -d repodata; then
   if test -s $deltainfofile; then
     m_deltainfofile=$deltainfofile
   fi
-  mergesolv $m_repomdfile $m_primfile $m_prodfile $m_patchfile $m_updateinfofile $m_deltainfofile
+  mergesolv $m_repomdfile $m_primfile $m_susedatafile $m_prodfile $m_patchfile $m_updateinfofile $m_deltainfofile
   rm -f $repomdfile $primfile $prodfile $patchfile $updateinfofile $deltainfofile
 
 elif test_susetags; then
index b499ed5..80b587d 100644 (file)
@@ -159,7 +159,7 @@ static struct stateswitch stateswitches[] = {
   { STATE_SOLVABLE,    "install-only",    STATE_INSTALLONLY,  1 },
   { STATE_SOLVABLE,    "time",            STATE_TIME,         0 },
 
-  /* extended Novell/SUSE attributes (suseinfo.xml) */
+  /* extended Novell/SUSE attributes (susedata.xml) */
   { STATE_SOLVABLE,    "eula",            STATE_EULA,         1 },
   { STATE_SOLVABLE,    "diskusage",       STATE_DISKUSAGE,    0 },