From 6f537c9c40cc0ea1047ef3ae8d4d5e06c195c68b Mon Sep 17 00:00:00 2001 From: Duncan Mac-Vicar P Date: Fri, 12 Sep 2008 15:32:20 +0000 Subject: [PATCH] support for susedata.xml --- tools/repo2solv.sh | 24 +++++++++++++++++++++++- tools/repo_rpmmd.c | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/tools/repo2solv.sh b/tools/repo2solv.sh index 1524746..e214589 100755 --- a/tools/repo2solv.sh +++ b/tools/repo2solv.sh @@ -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 diff --git a/tools/repo_rpmmd.c b/tools/repo_rpmmd.c index b499ed5..80b587d 100644 --- a/tools/repo_rpmmd.c +++ b/tools/repo_rpmmd.c @@ -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 }, -- 2.34.1