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
11 if test -d repodata; then
14 # This contains a primary.xml* and maybe patches
15 for i in primary.xml*; do
17 *.gz) cmd="gzip -dc" ;;
18 *.bz2) cmd="bzip2 -dc" ;;
21 # only check the first primary.xml*, in case there are more
25 if test -n "$cmd"; then
26 # we have some primary.xml*
27 primfile=`mktemp` || exit 3
28 $cmd $i | rpmmd2solv > $primfile
32 if test -f patches.xml; then
33 patchfile=`mktemp` || exit 3
36 for i in patch-*.xml*; do
38 *.gz) gzip -dc "$i" ;;
39 *.bz2) bzip2 -dc "$i" ;;
44 ) | grep -v '\?xml' | patchxml2solv > $patchfile
47 # Now merge primary and patches
48 if test -s $primfile && test -s $patchfile; then
49 mergesolv $primfile $patchfile
50 elif test -s $primfile; then
52 elif test -s $patchfile; then
55 rm -f $primfile $patchfile
56 elif test -d suse/setup/descr && test -s content; then
58 cd suse/setup/descr || exit 2
61 if test -s packages.gz; then
63 elif test -s packages.bz2; then
64 bzip2 -dc packages.bz2
65 elif test -s packages; then
70 if test -s packages.en.gz; then
71 gzip -dc packages.en.gz
72 elif test -s packages.en.bz2; then
73 bzip2 -dc packages.en.bz2
74 elif test -s packages.en; then
78 # XXX need to do something with packages.DU and packages.{lang}
80 # Now patterns. Not simply those files matching *.pat{,.gz,bz2},
81 # but only those mentioned in the file 'patterns'
82 if test -f patterns; then
83 for i in `cat patterns`; do
84 test -s "$i" || continue
86 *.gz) gzip -dc "$i" ;;
87 *.bz2) bzip2 -dc "$i" ;;
92 ) | susetags2solv -a -c "${olddir}/content"