if test -z "$repotype" ; then
# autodetect repository type
- if test -d repodata ; then
+ if test -d repodata -o -f repomd.xml; then
repotype=rpmmd
elif test_susetags ; then
repotype=susetags
fi
if test "$repotype" = rpmmd ; then
- cd repodata || exit 2
+ test -d repodata && {
+ cd repodata || exit 2
+ }
primfile=
primxml=`repomd_findfile primary primary.xml`
echo
fi
susedataxml=`repomd_findfile susedata susedata.xml`
- if test -f $susedataxml ; then
- repomd_decompress $susedataxml
+ if test -f "$susedataxml" ; then
+ repomd_decompress "$susedataxml"
fi
echo '</rpmmd>'
) | grep -v '\?xml' | sed '1i\<?xml version="1.0" encoding="UTF-8"?>' | rpmmd2solv $parser_options > $primfile || exit 4
prodxml=`repomd_findfile product product.xml`
fi
if test -n "$prodxml" -a -s "$prodxml" ; then
- prodfile=`mktemp` || exit 3
- (
- echo '<products>'
- repomd_decompress "$prodxml"
- echo '</products>'
- ) | grep -v '\?xml' | rpmmd2solv $parser_options > $prodfile || exit 4
+ prodfile=`mktemp` || exit 3
+ repomd_decompress "$prodxml" | rpmmd2solv $parser_options > $prodfile || exit 4
fi
patternfile=