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
8 parser_options=${PARSER_OPTIONS:-}
13 if test -d repodata; then
16 # This contains a primary.xml* and maybe patches
17 for i in primary.xml*; do
19 *.gz) cmd="gzip -dc" ;;
20 *.bz2) cmd="bzip2 -dc" ;;
23 # only check the first primary.xml*, in case there are more
27 if test -n "$cmd"; then
28 # we have some primary.xml*
29 primfile=`mktemp` || exit 3
30 $cmd $i | rpmmd2solv $parser_options > $primfile || exit 4
34 if test -f patches.xml; then
35 patchfile=`mktemp` || exit 3
38 for i in patch-*.xml*; do
40 *.gz) gzip -dc "$i" ;;
41 *.bz2) bzip2 -dc "$i" ;;
46 ) | grep -v '\?xml' | patchxml2solv $parser_options > $patchfile || exit 4
49 # Now merge primary and patches
50 if test -s $primfile && test -s $patchfile; then
51 mergesolv $primfile $patchfile
52 elif test -s $primfile; then
54 elif test -s $patchfile; then
57 rm -f $primfile $patchfile
58 elif test -d suse/setup/descr && test -s content; then
60 cd suse/setup/descr || exit 2
63 if test -s packages.gz; then
65 elif test -s packages.bz2; then
66 bzip2 -dc packages.bz2
67 elif test -s packages; then
72 if test -s packages.en.gz; then
73 gzip -dc packages.en.gz
74 elif test -s packages.en.bz2; then
75 bzip2 -dc packages.en.bz2
76 elif test -s packages.en; then
80 # XXX need to do something with packages.DU and packages.{lang}
82 # Now patterns. Not simply those files matching *.pat{,.gz,bz2},
83 # but only those mentioned in the file 'patterns'
84 if test -f patterns; then
85 for i in `cat patterns`; do
86 test -s "$i" || continue
88 *.gz) gzip -dc "$i" ;;
89 *.bz2) bzip2 -dc "$i" ;;
94 ) | susetags2solv -c "${olddir}/content" $parser_options || exit 4