summaryrefslogtreecommitdiff
path: root/tools/repo2solv.sh
diff options
context:
space:
mode:
authorDuncan Mac-Vicar P <dmacvicar@suse.de>2008-07-11 23:44:41 +0000
committerDuncan Mac-Vicar P <dmacvicar@suse.de>2008-07-11 23:44:41 +0000
commitea435a8e12d98eab400ff2b75c4c6b9972105cc0 (patch)
treec40a6ba5390c2ea67332e2131566a8279509e306 /tools/repo2solv.sh
parentfe66be0191b8d0baf8be50104f22ec5f01517b6a (diff)
downloadlibsolv-ea435a8e12d98eab400ff2b75c4c6b9972105cc0.tar.gz
libsolv-ea435a8e12d98eab400ff2b75c4c6b9972105cc0.tar.bz2
libsolv-ea435a8e12d98eab400ff2b75c4c6b9972105cc0.zip
- make repo2solv.sh also take repomd.xml in count
- install repomdxml2solv
Diffstat (limited to 'tools/repo2solv.sh')
-rwxr-xr-xtools/repo2solv.sh28
1 files changed, 26 insertions, 2 deletions
diff --git a/tools/repo2solv.sh b/tools/repo2solv.sh
index 25862d4..a09a427 100755
--- a/tools/repo2solv.sh
+++ b/tools/repo2solv.sh
@@ -47,6 +47,27 @@ if test -d repodata; then
$cmd $i | rpmmd2solv $parser_options > $primfile || exit 4
fi
+ # This contains repomd.xml
+ # for now we only read some keys like expiration
+ if test -f repomd.xml || test -f repomd.xml.gz || test -f repomd.xml.bz2 ; then
+ for i in repomd.xml*; do
+ case $i in
+ *.gz) cmd="gzip -dc" ;;
+ *.bz2) cmd="bzip2 -dc" ;;
+ *) cmd="cat" ;;
+ esac
+ # only check the first updateinfo.xml*, in case there are more
+ break
+ done
+
+ repomdfile="/nonexist"
+ if test -n "$cmd"; then
+ # we have some repomd.xml*
+ repomdfile=`mktemp` || exit 3
+ $cmd $i | repomdxml2solv $parser_options > $repomdfile || exit 4
+ fi
+ fi
+
# This contains a updateinfo.xml* and maybe patches
if test -f updateinfo.xml || test -f updateinfo.xml.gz || test -f updateinfo.xml.bz2 ; then
for i in updateinfo.xml*; do
@@ -102,6 +123,9 @@ if test -d repodata; then
fi
# Now merge primary, patches, updateinfo, and deltainfo
+ if test -s $repomdfile; then
+ m_repomdfile=$repomdfile
+ fi
if test -s $primfile; then
m_primfile=$primfile
fi
@@ -114,8 +138,8 @@ if test -d repodata; then
if test -s $deltainfofile; then
m_deltainfofile=$deltainfofile
fi
- mergesolv $m_primfile $m_patchfile $m_updateinfofile $m_deltainfofile
- rm -f $primfile $patchfile $updateinfofile $deltainfofile
+ mergesolv $m_repomdfile $m_primfile $m_patchfile $m_updateinfofile $m_deltainfofile
+ rm -f $repomdfile $primfile $patchfile $updateinfofile $deltainfofile
elif test_susetags; then
olddir=`pwd`