From 91bb636a474995b4e46d8a5ddebd5b1394cb8135 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 1 Oct 2008 10:11:43 +0000 Subject: - support repomd pattern.xml --- tools/repo2solv.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/tools/repo2solv.sh b/tools/repo2solv.sh index 01a9c1b..62f15e4 100755 --- a/tools/repo2solv.sh +++ b/tools/repo2solv.sh @@ -38,6 +38,7 @@ if test -d repodata; then # like susedata.xml, other.xml, filelists.xml echo '' for i in primary.xml* susedata.xml*; do + test -s "$i" || continue case $i in *.gz) gzip -dc "$i";; *.bz2) bzip2 -dc "$i";; @@ -49,6 +50,7 @@ if test -d repodata; then break done for i in susedata.xml*; do + test -s "$i" || continue case $i in *.gz) gzip -dc "$i";; *.bz2) bzip2 -dc "$i";; @@ -77,6 +79,23 @@ if test -d repodata; then ) | grep -v '\?xml' | rpmmd2solv $parser_options > $prodfile || exit 4 fi + patternfile="/nonexist" + for i in patterns.xml*; do + test -s "$i" || continue + # got one! + patternfile=`mktemp` || exit 3 + ( + for i in patterns.xml*; do + test -s "$i" || continue + case $i in + *.gz) gzip -dc "$i" ;; + *.bz2) bzip2 -dc "$i" ;; + *) cat "$i" ;; + esac + done + ) | rpmmd2solv $parser_options > $patternfile || exit 4 + break + done # This contains repomd.xml # for now we only read some keys like timestamp @@ -184,6 +203,9 @@ if test -d repodata; then if test -s $primfile; then m_primfile=$primfile fi + if test -s $patternfile; then + m_patternfile=$patternfile + fi if test -s $prodfile; then m_prodfile=$prodfile fi @@ -196,8 +218,8 @@ if test -d repodata; then if test -s $deltainfofile; then m_deltainfofile=$deltainfofile fi - mergesolv $m_repomdfile $m_suseinfofile $m_primfile $m_prodfile $m_patchfile $m_updateinfofile $m_deltainfofile - rm -f $repomdfile $suseinfofile $primfile $prodfile $patchfile $updateinfofile $deltainfofile + mergesolv $m_repomdfile $m_suseinfofile $m_primfile $m_prodfile $m_patternfile $m_patchfile $m_updateinfofile $m_deltainfofile + rm -f $repomdfile $suseinfofile $primfile $patternfile $prodfile $patchfile $updateinfofile $deltainfofile elif test_susetags; then olddir=`pwd` -- cgit v1.2.3