4 # give it a directory of a local mirror of a repo and this
5 # tries to detect the repo type and generate one SOLV file on stdout
7 # this should signal an error if there is a problem
11 parser_options=${PARSER_OPTIONS:-}
16 if test -d repodata; then
19 # This contains a primary.xml* and maybe patches
20 for i in primary.xml*; do
22 *.gz) cmd="gzip -dc" ;;
23 *.bz2) cmd="bzip2 -dc" ;;
26 # only check the first primary.xml*, in case there are more
30 if test -n "$cmd"; then
31 # we have some primary.xml*
32 primfile=`mktemp` || exit 3
33 $cmd $i | rpmmd2solv $parser_options > $primfile || exit 4
37 if test -f patches.xml; then
38 patchfile=`mktemp` || exit 3
41 for i in patch-*.xml*; do
43 *.gz) gzip -dc "$i" ;;
44 *.bz2) bzip2 -dc "$i" ;;
49 ) | grep -v '\?xml' | patchxml2solv $parser_options > $patchfile || exit 4
52 # Now merge primary and patches
53 if test -s $primfile && test -s $patchfile; then
54 mergesolv $primfile $patchfile
55 elif test -s $primfile; then
57 elif test -s $patchfile; then
60 rm -f $primfile $patchfile
61 elif test -d suse/setup/descr && test -s content; then
63 cd suse/setup/descr || exit 2
66 if test -s packages.gz; then
68 elif test -s packages.bz2; then
69 bzip2 -dc packages.bz2
70 elif test -s packages; then
75 if test -s packages.en.gz; then
76 gzip -dc packages.en.gz
77 elif test -s packages.en.bz2; then
78 bzip2 -dc packages.en.bz2
79 elif test -s packages.en; then
83 # XXX need to do something with packages.DU and packages.{lang}
85 # Now patterns. Not simply those files matching *.pat{,.gz,bz2},
86 # but only those mentioned in the file 'patterns'
87 if test -f patterns; then
88 for i in `cat patterns`; do
89 test -s "$i" || continue
91 *.gz) gzip -dc "$i" ;;
92 *.bz2) bzip2 -dc "$i" ;;
97 ) | susetags2solv -c "${olddir}/content" $parser_options || exit 4
105 if test -n "$rpms" ; then
106 echo "$rpms" | rpms2solv -m -