-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-setup.sh
executable file
·122 lines (105 loc) · 2.87 KB
/
archive-setup.sh
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
#!/bin/bash
#
# Copyright © 2003, 2004, 2005 Guillem Jover <[email protected]>
# Copyright © 2015 Matthias Blümel <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Import library
. archive-lib.sh
create_apt_config ()
{
cat > $apt_config <<-HERE
Default {
Packages::Extensions ".deb";
Packages::Compress ". gzip bzip2";
Sources::Compress ". gzip bzip2";
MaxContentsChange 25000;
};
APT::FTPArchive::Release {
Version "$archive_version";
Origin "$archive_name";
Label "$archive_url";
}
Dir {
ArchiveDir "$archive_dir";
OverrideDir "$indices_dir";
CacheDir "$cache_dir";
FileListDir "$cache_dir";
};
TreeDefault {
Directory "pool-\$(ARCH)/";
SrcDirectory "pool/";
FileList "\$(DIST)_\$(SECTION)_\$(ARCH).list";
};
HERE
for suite in $suite_list; do
cat >> $apt_config <<-HERE
Tree "dists/$suite" {
Sections "$(get_suite_sections $suite)";
Architectures "$(get_suite_arches $suite)";
};
HERE
touch ${indices_dir}/override.$suite.main
touch ${indices_dir}/override.$suite.main.src
touch ${indices_dir}/override.$suite.extra.main
done
}
create_repo ()
{
if [ ! -d $incoming_dir ]; then
for section in $section_list; do
mkdir -p $incoming_dir/${section}
done
fi
for suite in $suite_list; do
for section in $section_list; do
for arch in $(get_suite_arches $suite); do
if [ $arch = source ]; then
path_dir=$dists_dir/$suite/$section/$arch
else
path_dir=$dists_dir/$suite/$section/binary-$arch
mkdir -p $dists_dir/$suite/$section/debian-installer/binary-$arch
fi
mkdir -p $path_dir
cat > $path_dir/Release <<-HERE
Archive: $suite
Version: $archive_version
Component: $section
Origin: $archive_name
Label: $archive_url
Architecture: $arch
HERE
# FIXME: hardcoded check
if [ $suite = experimental ]; then
echo "NotAutomatic: yes" >> $path_dir/Release
fi
files_owner_perms $path_dir/Release
done
done
done
mkdir -p $cache_dir/dists
mkdir -p $cache_dir/changes
mkdir -p $indices_dir
mkdir -p $queue_dir
mkdir -p $unchecked_dir
mkdir -p $accepted_dir
mkdir -p $byhand_dir
mkdir -p $log_dir
for d in $(get_pool_dirs); do
mkdir -p $d
done
}
create_repo
create_apt_config