-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·73 lines (63 loc) · 1.89 KB
/
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
#!/bin/sh -e
set -e
# usage: sh -e setup.sh
# Load configuration
. build.conf
# Make the state directory
mkdir ${STATEDIR}
chmod 700 ${STATEDIR}
# Describes state
mkdir ${STATEDIR}/describes
# Instruct the user about unbuilt DESCRIBE files
UNBUILT=""
for N in ${DESCRIBES_PUBLISH}; do
NEED=1
for M in ${DESCRIBES_BUILD}; do
if [ $N = $M ]; then
NEED=0
fi
done
if [ $NEED = 1 ]; then
UNBUILT="${UNBUILT} DESCRIBE.${N}"
fi
done
xargs -s 80 <<- EOF
The files ${UNBUILT} are set to be published but are not in the
list to be built; please create them in the directory
${STATEDIR}/describes. (These are probably DESCRIBE files for
old STABLE branches which no longer supported.)
EOF
echo
# Fileset state
mkdir ${STATEDIR}/fileset ${STATEDIR}/fileset/oldfiles
touch ${STATEDIR}/fileset/filedb
touch ${STATEDIR}/fileset/metadb
touch ${STATEDIR}/fileset/extradb
# Instruct the user about the need for a world tarball
xargs -s 80 <<- EOF
If you haven\\'t already done so, please create a .tar file in
${WORLDTAR} containing the portion of the FreeBSD world needed
for \\'make describe\\' to run.
EOF
# Create a directory for keys
mkdir ${STATEDIR}/keys
# Instruct the user about creating keys
echo
xargs -s 80 <<- EOF
Before you can perform Portsnap builds, you need to run keygen.sh
to create a signing key.
EOF
echo
# Create a staging area for files waiting to be uploaded
mkdir ${STATEDIR}/stage
mkdir ${STATEDIR}/stage/f
mkdir ${STATEDIR}/stage/bp
mkdir ${STATEDIR}/stage/t
mkdir ${STATEDIR}/stage/s
# Clone initial repo in ${STATEDIR}/gitrepo
# In the svn era portsnap performed metadata operations (i.e., finding the
# latest revision number) against the svn server. With git we need a local
# copy of the repository for all operations. Perform an initial clone here,
# which we will update (git fetch) in build.sh and then create worktrees from
# it as needed.
git clone --bare ${REPO} ${STATEDIR}/gitrepo