-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.sh
executable file
·78 lines (62 loc) · 2.25 KB
/
build.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
#!/bin/bash
set -e
DIST="$1"
CHANNEL="$2"
apt-get update
apt-get install -y elementary-icon-theme appstream-generator apt-mirror
# Configure apt-mirror and use it to mirror the needed series from the PPA
cat <<EOF > /etc/apt/mirror.list
set nthreads 20
set _tilde 0
deb http://ppa.launchpad.net/elementary-os/${CHANNEL}/ubuntu ${DIST} main
EOF
apt-mirror
APPSTREAM_DIR=/workdir
mkdir ${APPSTREAM_DIR}
pushd ${APPSTREAM_DIR}
cat <<EOF > asgen-config.json
{
"ProjectName": "elementary-${CHANNEL}",
"ArchiveRoot": "/var/spool/apt-mirror/mirror/ppa.launchpad.net/elementary-os/${CHANNEL}/ubuntu",
"Backend": "debian",
"Suites":
{
"${DIST}":
{
"sections": ["main"],
"architectures": ["amd64"],
"useIconTheme": "elementary"
}
}
}
EOF
appstream-generator process ${DIST}
popd
# Clear out the old data
rm -rf pantheon-data/main/*
rm -f debian/appstream-data-pantheon-icons-hidpi.install
rm -f debian/appstream-data-pantheon-icons.install
mkdir -p debian
touch debian/appstream-data-pantheon-icons-hidpi.install
touch debian/appstream-data-pantheon-icons.install
# Copy in the new
mkdir -p pantheon-data/main
cp ${APPSTREAM_DIR}/export/data/${DIST}/main/Components-amd64.yml.gz pantheon-data/main/pantheon_${DIST}-main_amd64.yml.gz
for f in ${APPSTREAM_DIR}/export/data/${DIST}/main/icons-*; do
# Ignore icon archives with no icons
FILECOUNT=$(tar -tzvvf ${f} | grep -c ^-) || true
[[ $FILECOUNT -gt 0 ]] || continue
# Strip a path like export/data/bionic/main/[email protected] down to 128x128@2
OUTDIR=`basename ${f} .tar.gz | cut -d- -f2`
mkdir -p pantheon-data/main/icons/${OUTDIR}
tar -C pantheon-data/main/icons/${OUTDIR} -xf ${f}
# Add the extracted directory path to the debian install scripts (either HiDPI or not)
if [[ $OUTDIR == *"@2" ]]; then
echo "pantheon-data/main/icons/${OUTDIR}/* usr/share/app-info/icons/elementary-${CHANNEL}-${DIST}-main/$OUTDIR/" >> debian/appstream-data-pantheon-icons-hidpi.install
else
echo "pantheon-data/main/icons/${OUTDIR}/* usr/share/app-info/icons/elementary-${CHANNEL}-${DIST}-main/$OUTDIR/" >> debian/appstream-data-pantheon-icons.install
fi
done
# Change the ownership to the current user
chown -R $(id -u):$(id -g) pantheon-data
chown -R $(id -u):$(id -g) debian