Debian Codegraph @

storage/mroonga/packages/apt/update-repository.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2
3 script_base_dir=`dirnamescip-shell system . . dirname. $0`
4
5 if [scip-shell system . . `[`. $# != 4 ]; then
6 echoscip-shell system . . echo. "Usage: $0 PROJECT_NAME DESTINATION ARCHITECTURES CODES"
7 echoscip-shell system . . echo. " e.g.: $0 mroonga repositories/ 'i386 amd64' 'lenny unstable hardy karmic'"
8 exit 1
9 fi
10
11 PROJECT_NAME=$1
12 DESTINATION=$2
13 ARCHITECTURES=$3
14 CODES=$4
15
16 runscip-shell shell mariadb 1:11.8.8-1 run().()
17 {
18 "$@"
19 if testscip-shell system . . test. $? -ne 0; then
20 echoscip-shell system . . echo. "Failed $@"
21 exit 1
22 fi
23 }
24
25 update_repositoryscip-shell shell mariadb 1:11.8.8-1 update_repository().()
26 {
27 distribution=$1
28 code_name=$2
29 component=$3
30
31 rmscip-shell system . . rm. -rf dists/${code_name}
32 mkdirscip-shell system . . mkdir. -p dists/${code_name}/${component}/binary-i386/
33 mkdirscip-shell system . . mkdir. -p dists/${code_name}/${component}/binary-amd64/
34 mkdirscip-shell system . . mkdir. -p dists/${code_name}/${component}/source/
35
36 catscip-shell system . . cat. <<EOF > dists/.htaccess
37 Options +Indexes
38 EOF
39
40 catscip-shell system . . cat. <<EOF > dists/${code_name}/${component}/binary-i386/Release
41 Archive: ${code_name}
42 Component: ${component}
43 Origin: The ${PROJECT_NAME} project
44 Label: The ${PROJECT_NAME} project
45 Architecture: i386
46 EOF
47
48 catscip-shell system . . cat. <<EOF > dists/${code_name}/${component}/binary-amd64/Release
49 Archive: ${code_name}
50 Component: ${component}
51 Origin: The ${PROJECT_NAME} project
52 Label: The ${PROJECT_NAME} project
53 Architecture: amd64
54 EOF
55
56 catscip-shell system . . cat. <<EOF > dists/${code_name}/${component}/source/Release
57 Archive: ${code_name}
58 Component: ${component}
59 Origin: The ${PROJECT_NAME} project
60 Label: The ${PROJECT_NAME} project
61 Architecture: source
62 EOF
63
64 catscip-shell system . . cat. <<EOF > generate-${code_name}.conf
65 Dir::ArchiveDir ".";
66 Dir::CacheDir ".";
67 TreeDefault::Directory "pool/${code_name}/${component}";
68 TreeDefault::SrcDirectory "pool/${code_name}/${component}";
69 Default::Packages::Extensions ".deb";
70 Default::Packages::Compress ". gzip bzip2";
71 Default::Sources::Compress ". gzip bzip2";
72 Default::Contents::Compress "gzip bzip2";
73
74 BinDirectory "dists/${code_name}/${component}/binary-i386" {
75 Packages "dists/${code_name}/${component}/binary-i386/Packages";
76 Contents "dists/${code_name}/Contents-i386";
77 SrcPackages "dists/${code_name}/${component}/source/Sources";
78 };
79
80 BinDirectory "dists/${code_name}/${component}/binary-amd64" {
81 Packages "dists/${code_name}/${component}/binary-amd64/Packages";
82 Contents "dists/${code_name}/Contents-amd64";
83 SrcPackages "dists/${code_name}/${component}/source/Sources";
84 };
85
86 Tree "dists/${code_name}" {
87 Sections "${component}";
88 Architectures "i386 amd64 source";
89 };
90 EOF
91 apt-ftparchivescip-shell system . . apt-ftparchive. generate generate-${code_name}.conf
92 chmodscip-shell system . . chmod. 644 dists/${code_name}/Contents-*
93
94 rmscip-shell system . . rm. -f dists/${code_name}/Release*
95 rmscip-shell system . . rm. -f *.db
96 catscip-shell system . . cat. <<EOF > release-${code_name}.conf
97 APT::FTPArchive::Release::Origin "The ${PROJECT_NAME} project";
98 APT::FTPArchive::Release::Label "The ${PROJECT_NAME} project";
99 APT::FTPArchive::Release::Architectures "i386 amd64";
100 APT::FTPArchive::Release::Codename "${code_name}";
101 APT::FTPArchive::Release::Suite "${code_name}";
102 APT::FTPArchive::Release::Components "${component}";
103 APT::FTPArchive::Release::Description "${PACKAGE_NAME} packages";
104 EOF
105 apt-ftparchivescip-shell system . . apt-ftparchive. -c release-${code_name}.conf \
106 release dists/${code_name} > /tmp/Releasescip-shell filesystem . . `/tmp/Release`.
107 mvscip-shell system . . mv. /tmp/Releasescip-shell filesystem . . `/tmp/Release`. dists/${code_name}
108 }
109
110 for code_name in ${CODES}; do
111 case ${code_name} in
112 jessie|stretch|unstable)
113 distribution=debian
114 component=main
115 ;;
116 *)
117 distribution=ubuntu
118 component=universe
119 ;;
120 esac
121
122 mkdirscip-shell system . . mkdir. -p ${DESTINATION}${distribution}
123 (cd ${DESTINATION}${distribution}
124 update_repositoryscip-shell shell mariadb 1:11.8.8-1 update_repository(). $distribution $code_name $component) &
125 if [scip-shell system . . `[`. "${PARALLEL}" != "yes" ]; then
126 wait
127 fi
128 done
129
130 wait