Skip to content

Commit

Permalink
Support susedata.<lang>.xml language files
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Feb 9, 2016
1 parent 380a648 commit bc7a6b0
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions tools/repo2solv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repomd_findfile() {
local p=$2
local f
if test -n "$t" -a -s repomd.xml ; then
f=`repomdxml2solv -q $t:location < repomd.xml 2>/dev/null`
f=`repomdxml2solv -q "$t:location" < repomd.xml 2>/dev/null`
f=${f##*/}
if test -f "$f" ; then
echo "$f"
Expand All @@ -44,6 +44,10 @@ repomd_findfile() {
fi
}

repomd_types() {
test -s repomd.xml && repomdxml2solv -q type < repomd.xml
}

repomd_decompress() {
case $1 in
*.gz) gzip -dc "$1" ;;
Expand Down Expand Up @@ -147,6 +151,17 @@ if test "$repotype" = rpmmd ; then
if test -f "$susedataxml" ; then
repomd_decompress "$susedataxml"
fi
# all the languages as well
for t in `repomd_types` ; do
case "$t" in
susedata.*)
susedataxml=`repomd_findfile "$t" "$t.xml"`
if test -f "$susedataxml" ; then
repomd_decompress "$susedataxml"
fi
;;
esac
done
echo '</rpmmd>'
) | sed 's/<?xml[^>]*>//g' | sed '1i\<?xml version="1.0" encoding="UTF-8"?>' | rpmmd2solv $parser_options > $primfile || exit 4
fi
Expand Down Expand Up @@ -244,6 +259,9 @@ elif test "$repotype" = susetags ; then
# Now default language
susetags_findfile_cat packages.en

# DL (delta rpms)
susetags_findfile_cat packages.DL

# Now patterns. Not simply those files matching *.pat{,.gz,bz2},
# but only those mentioned in the file 'patterns'
if test -f patterns ; then
Expand All @@ -263,7 +281,7 @@ elif test "$repotype" = susetags ; then
esac
case $name in
# ignore files we handled already
*.DU | *.en | *.FL | packages ) continue ;;
*.DU | *.en | *.FL | *.DL | packages ) continue ;;
*)
suff=${name#packages.}
echo "=Lan: $suff"
Expand Down

0 comments on commit bc7a6b0

Please sign in to comment.