628
by Arch Librarian
(Temporary) check in of the old version of scansources,... |
1 |
#!/bin/sh
|
2 |
||
3 |
# Copyright 1999 Raphaƫl Hertzog <hertzog@debian.org>
|
|
4 |
# See the README file for the license
|
|
5 |
||
6 |
# This script will create the Sources.gz files
|
|
7 |
# First arg = directory of the CD
|
|
8 |
||
9 |
set -e
|
|
10 |
||
11 |
PREFIX=$1 |
|
12 |
if [ -n "$NONFREE" -o -n "$EXTRANONFREE" ]; then |
|
13 |
SECTIONS="main contrib non-free" |
|
14 |
else
|
|
15 |
SECTIONS="main contrib" |
|
16 |
fi
|
|
17 |
||
18 |
cd $PREFIX |
|
19 |
||
20 |
# We have to scan all possible dists where sources can be
|
|
21 |
DISTS="" |
|
22 |
DISTSNONUS="" |
|
23 |
for i in `cd dists; echo *; cd ..`; do |
|
24 |
if [ ! -L "dists/$i" -a -d "dists/$i" ]; then |
|
25 |
if [ -d "dists/$i/main/source" -o \ |
|
26 |
-d "dists/$i/non-free/source" -o \ |
|
27 |
-d "dists/$i/contrib/source" ]; then |
|
28 |
DISTS="$DISTS $i" |
|
29 |
fi
|
|
30 |
if [ -d "dists/$i/non-US/main/source" -o \ |
|
31 |
-d "dists/$i/non-US/non-free/source" -o \ |
|
32 |
-d "dists/$i/non-US/contrib/source" ]; then |
|
33 |
DISTSNONUS="$DISTSNONUS $i" |
|
34 |
fi
|
|
35 |
fi
|
|
36 |
done
|
|
37 |
||
38 |
if [ -e "$MIRROR/dists/$CODENAME/Release" ]; then |
|
1216
by Colin Watson
strip SHA256 field from Release file |
39 |
# Strip the MD5Sum, SHA1, and SHA256 fields
|
40 |
perl -ne 'if (/^(MD5Sum|SHA1|SHA256):/) { $f=1; next; }
|
|
628
by Arch Librarian
(Temporary) check in of the old version of scansources,... |
41 |
if ($f) {
|
42 |
unless (/^ /) { print; $f=0 }
|
|
43 |
} else { print }' \ |
|
44 |
$MIRROR/dists/$CODENAME/Release > dists/$CODENAME/Release |
|
45 |
fi
|
|
46 |
if [ -n "$NONUS" -a -e "$NONUS/dists/$CODENAME/non-US/Release" ]; then |
|
1216
by Colin Watson
strip SHA256 field from Release file |
47 |
# Strip the MD5Sum, SHA1, and SHA256 fields
|
48 |
perl -ne 'if (/^(MD5Sum|SHA1|SHA256):/) { $f=1; next; }
|
|
628
by Arch Librarian
(Temporary) check in of the old version of scansources,... |
49 |
if ($f) {
|
50 |
unless (/^ /) { print; $f=0 }
|
|
51 |
} else { print }' \ |
|
52 |
$NONUS/dists/$CODENAME/non-US/Release \ |
|
53 |
> dists/$CODENAME/non-US/Release
|
|
54 |
fi
|
|
55 |
||
56 |
for SECT in $SECTIONS; do |
|
57 |
||
58 |
if [ -d "pool/$SECT" ]; then |
|
59 |
dpkg-scansources pool/$SECT > dists/$CODENAME/$SECT/source/Sources |
|
60 |
fi
|
|
61 |
for DIST in $DISTS; do |
|
62 |
if [ -d "dists/$DIST/$SECT/source" ] ; then |
|
63 |
dpkg-scansources dists/$DIST/$SECT/source \ |
|
64 |
>> dists/$CODENAME/$SECT/source/Sources |
|
65 |
fi
|
|
66 |
done
|
|
67 |
if [ -f dists/$CODENAME/$SECT/source/Sources ] ; then |
|
68 |
gzip --best dists/$CODENAME/$SECT/source/Sources |
|
69 |
fi
|
|
70 |
||
71 |
if [ -n "$NONUS" -a "$CODENAME" != "slink" ]; then |
|
72 |
if [ -d "pool/non-US/$SECT" ]; then |
|
73 |
dpkg-scansources pool/non-US/$SECT \ |
|
74 |
> dists/$CODENAME/non-US/$SECT/source/Sources |
|
75 |
fi
|
|
76 |
for DIST in $DISTSNONUS; do |
|
77 |
if [ -d "dists/$DIST/non-US/$SECT/source" ] ; then |
|
78 |
dpkg-scansources dists/$DIST/non-US/$SECT/source \ |
|
79 |
>> dists/$CODENAME/non-US/$SECT/source/Sources |
|
80 |
fi
|
|
81 |
done
|
|
82 |
if [ -f dists/$CODENAME/non-US/$SECT/source/Sources ] ; then |
|
83 |
gzip --best dists/$CODENAME/non-US/$SECT/source/Sources |
|
84 |
fi
|
|
85 |
fi
|
|
86 |
||
87 |
done
|
|
88 |
||
89 |
# Slink special case
|
|
90 |
if [ -n "$NONUS" -a "$CODENAME" = "slink" ]; then |
|
91 |
dpkg-scansources dists/$CODENAME/non-US/source \ |
|
92 |
| gzip --best > dists/$CODENAME/non-US/source/Sources.gz |
|
93 |
fi
|
|
94 |
||
95 |
if [ -n "$LOCAL" ]; then |
|
96 |
dpkg-scansources dists/$CODENAME/local/source \ |
|
97 |
| gzip --best > dists/$CODENAME/local/source/Sources.gz |
|
98 |
fi
|
|
99 |
||
100 |
exit 0 |