From: Duncan Mac-Vicar P Date: Wed, 9 Apr 2008 15:28:25 +0000 (+0000) Subject: - add support for parsing updateinfo.xml from repo2solv.sh so X-Git-Tag: BASE-SuSE-Code-12_1-Branch~734 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1089e539032047df433b55fc9203f4154412e876;p=platform%2Fupstream%2Flibsolv.git - add support for parsing updateinfo.xml from repo2solv.sh so I dont need any convertors :-) --- diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 8915101..e85b602 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -50,6 +50,7 @@ install(TARGETS rpmmd2solv rpmdb2solv rpms2solv + updateinfoxml2solv DESTINATION ${BIN_INSTALL_DIR} ) install(PROGRAMS repo2solv.sh DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/tools/repo2solv.sh b/tools/repo2solv.sh index 7437681..7f8fc7a 100755 --- a/tools/repo2solv.sh +++ b/tools/repo2solv.sh @@ -33,6 +33,25 @@ if test -d repodata; then $cmd $i | rpmmd2solv $parser_options > $primfile || exit 4 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 + 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 + updateinfofile="/nonexist" + if test -n "$cmd"; then + # we have some updateinfo.xml* + updateinfofile=`mktemp` || exit 3 + $cmd $i | updateinfoxml2solv $parser_options > $updateinfofile || exit 4 + fi + fi + patchfile="/nonexist" if test -f patches.xml; then patchfile=`mktemp` || exit 3 @@ -49,15 +68,19 @@ if test -d repodata; then ) | grep -v '\?xml' | patchxml2solv $parser_options > $patchfile || exit 4 fi - # Now merge primary and patches - if test -s $primfile && test -s $patchfile; then + # Now merge primary and patches and updateinfo + if test -s $primfile && test -s $patchfile && test -s $updateinfofile; then + mergesolv $primfile $patchfile $updateinfofile + elif test -s $primfile && test -s $updateinfofile; then + mergesolv $primfile $updateinfofile + elif test -s $primfile && test -s $patchfile; then mergesolv $primfile $patchfile elif test -s $primfile; then cat $primfile elif test -s $patchfile; then cat $patchfile fi - rm -f $primfile $patchfile + rm -f $primfile $patchfile $updateinfofile elif test -d suse/setup/descr && test -s content; then olddir=`pwd` cd suse/setup/descr || exit 2