1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
#!/bin/bash
# mklist v 1.13 (c) Steve McIntyre <stevem@chiark.greenend.org.uk>
# Released under GPL 31 Mar 1999
# See the file COPYING for license details
# Released as part of the slink_cd package, not much use standalone
#
# $1 is Debian-mirror location
# $2 is start directory location (where the scripts live)
# $3 is tmpdir location
# $4 is the binary arch
# $5 is codename of branch of archive.
# $6 is status of branch of archive
# $7 is the scanpackages binary.
# $8 is debug level
VERBOSE=$8
. $2/vecho # Local definitions for vecho, vvecho, vvvecho
vecho Creating file lists for CDs 1 and 2
cd $3
rm -rf list
mkdir list
if [ -f $1/dists/$5/main/binary-$4/Packages.gz ]; then
PACKAGES=$1/dists/$5/main/binary-$4/Packages.gz
elif [ -f $1/dists/$5/main/binary-$4/Packages ]; then
PACKAGES=$1/dists/$5/main/binary-$4/Packages
else
echo "$0: Could not find packages file. Exit."
exit 1
fi
# AAAAAAAAaargh! We're f**ked if the Packages file is out-of-date
# (e.g. borken mirror), so check if there are any newer files in the
# archive _now_. If so, we'll need to create a newer copy for our own
# purposes. Warn the user a _lot_, as this may be a symptom of a
# really broken setup...
find $1/dists/$5/main/binary-$4 -type f -follow -newer $PACKAGES >$3/newer.packages
if [ -s $3/newer.packages ] ; then
PACKAGES=$3/Packages.regenerated
echo " Awooga!"
echo " Awooga!"
echo " Awooga!"
echo " Awooga! The main Packages file in the mirror is out of date."
echo " Generating a new one in $PACKAGES."
echo " Your md5sums results will be bogus, and so might your images."
echo " Awooga!"
echo " Awooga!"
echo " Awooga!"
echo " Awooga!"
(cd $1/dists/$5/main && \
$7 binary-$4 $1/indices/override.$5.gz \
dists/$6/main/ > $PACKAGES)
ls -al $PACKAGES
fi
# optional/extra packages that should be on disc 1 should be listed in
# cd1.needed. Important/required/standard packages will
# automatically go there, and duplication is OK. cd1.needed no
# longer needs to be up-to-date with the boot-floppies package, as we
# generate it from their master file now.
# Remove hashed-out lines to allow hash comments...
# And use EOP as a header between sections
# the first section should be the list of packages to go on CD 1
# the second section should be the list of packages to remove _completely_
# the third is the Packages file, i.e. the raw data that we're going to use.
# Output will go to list1 for CD 1, list2 for CD 2, EXCLUDED for removed.
zcat -f $3/cd1.needed $3/cd1.useful $2/EOP $2/exclude-$4 $2/EOP $PACKAGES | grep -v '^#' | awk -v verbose=$VERBOSE '
/END_OF_PROCESSING/ {leave_done++}
/.*/ {
if(!leave_done)
{
leave[$1]++
}
else
{
if(leave_done==1)
{
remove[$1]++
}
}
}
/^Package:/ {
if(leave_done==2)
{
priority="unlisted";
package=$2;
list="list2"
}
}
/^Priority:/ {
if(leave_done==2)
{
priority = $2;
if(leave[package])
{
list="list1"
}
if(remove[package])
{
list="EXCLUDED"
}
}
}
/^Section:/ {
if(leave_done==2)
{
section=$2;
}
}
/^Filename:/ {
if(leave_done==2)
{
filename = $2
}
}
/^Size:/ {if(leave_done==2)
{
if(match(priority,"^required")) {list="list1"}
if(match(priority,"^important")) {list="list1"}
if(match(priority,"^standard")) {list="list1"}
if(match(section,"^base")) {list="list1"}
if(verbose>1) {print priority, section, "package ", package, "moved to", list}
print package,filename," ",$2 >>"list/"list
print package,filename," ",$2 >>"list/"priority
}
}
'
cd list
for file in *
do
sort $file -o $file.1
mv $file.1 $file
done
vecho "Sizes for each priority in main binary-$4 (bytes):"
for file in required important standard optional extra unlisted
do
if [ -e $file ] ; then
vecho -n $file
if [ "$VERBOSE" -gt 0 ] ; then
cat $file | awk '{size=size+$3};END{print " ",size}'
fi
fi
done
vecho
vecho "Sizes for each disc (bytes):"
for file in list1 list2 EXCLUDED
do
touch $file # so we don't get ENOENT
vecho -n $file
if [ "$VERBOSE" -gt 0 ] ; then
cat $file | awk '{size=size+$3};END{print " ",size}'
fi
done
vecho "These only count packages in main binary-$4. Other"
vecho "sections will fill these two discs up further"
cd $1
for i in 1 2
do
vecho "Filling in binary-all links... $i"
for file in `cat $3/list/list$i | sed "s/frozen/$CODENAME/g;s/$6/$5/g" | awk -v ARCH=$4 '{print $2; REPL=sprintf("binary-%s/",ARCH);gsub(REPL,"binary-all/",$2); print $2}'`
do
if [ -f $file ] ; then
vvecho $file
echo $file >>/$3/list/OUT$i
fi
done
done
|