Merge lp:~xnox/debian-cd/missing-tools-groovy into lp:~ubuntu-cdimage/debian-cd/ubun3

Proposed by Dimitri John Ledkov
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: 2057
Merge reported by: Łukasz Zemczak
Merged at revision: not available
Proposed branch: lp:~xnox/debian-cd/missing-tools-groovy
Merge into: lp:~ubuntu-cdimage/debian-cd/ubun3
Diff against target: 230 lines (+215/-0)
3 files modified
tools/groovy/app-install.sh (+71/-0)
tools/groovy/installtools.sh (+103/-0)
tools/groovy/upgrade.sh (+41/-0)
To merge this branch: bzr merge lp:~xnox/debian-cd/missing-tools-groovy
Reviewer Review Type Date Requested Status
Ubuntu CD Image Team Pending
Review via email: mp+384336@code.launchpad.net

Commit message

Add missing tools/groovy

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'tools/groovy'
2=== added file 'tools/groovy/app-install.sh'
3--- tools/groovy/app-install.sh 1970-01-01 00:00:00 +0000
4+++ tools/groovy/app-install.sh 2020-05-21 09:20:54 +0000
5@@ -0,0 +1,71 @@
6+#! /bin/sh
7+
8+set -e
9+
10+N="$1"
11+# The location of the tree where we should install app-install data files
12+DIR="$2"
13+
14+if [ "$PROJECT" = edubuntu ]; then
15+ EDU_APP_INSTALL_DATA_DEB="$($BASEDIR/tools/apt-selection cache \
16+ show app-install-data-edubuntu | \
17+ grep ^Filename: | awk '{print $2}' || true)"
18+
19+ [ "$EDU_APP_INSTALL_DATA_DEB" ] || exit 0
20+
21+ mkdir -p "$DIR/app-install/edubuntu/"
22+ TMP_EDU="$DIR/app-install/edubuntu/"
23+
24+ dpkg -x "$MIRROR/$EDU_APP_INSTALL_DATA_DEB" "$TMP_EDU"
25+fi
26+
27+APP_INSTALL_DATA_DEB="$($BASEDIR/tools/apt-selection cache \
28+ show app-install-data | \
29+ grep ^Filename: | awk '{print $2}' || true)"
30+[ "$APP_INSTALL_DATA_DEB" ] || exit 0
31+
32+mkdir -p "$DIR/app-install/channels" "$DIR/app-install/desktop" \
33+ "$DIR/app-install/icons" "$DIR/app-install/tmp"
34+TMP="$DIR/app-install/tmp"
35+dpkg -x "$MIRROR/$APP_INSTALL_DATA_DEB" "$TMP"
36+
37+find "$TMP/usr/share/app-install/desktop" \
38+ -name \*.desktop -print0 | \
39+ xargs -r0 grep -aHi '^X-AppInstall-Package=' | \
40+ perl -pe "s,^$TMP/usr/share/app-install/desktop/,,; s/\.desktop:.*?=/ /" | \
41+ sort -k2 > "$TMP/desktop-list"
42+DESKTOPS="$(sort "$DIR/../$N.packages" | \
43+ join -1 2 -o 1.1 "$TMP/desktop-list" -)"
44+
45+for name in $DESKTOPS; do
46+ desktop="$TMP/usr/share/app-install/desktop/$name.desktop"
47+ cp -a "$desktop" "$DIR/app-install/desktop/"
48+ icon="$(grep -ai '^Icon=' "$desktop" | head -n1 | cut -d= -f2)"
49+ if [ "$icon" ]; then
50+ if [ "${icon%.*}" = "$icon" ]; then
51+ cp -a "$TMP/usr/share/app-install/icons/$icon".* \
52+ "$DIR/app-install/icons/" || true
53+ else
54+ cp -a "$TMP/usr/share/app-install/icons/$icon" \
55+ "$DIR/app-install/icons/" || true
56+ fi
57+ fi
58+done
59+
60+if [ "$PROJECT" = edubuntu ]; then
61+ find "$TMP_EDU/usr/share/app-install-data-edubuntu/desktop/" -type f -print0 | \
62+ xargs -0r cp --target-directory "$DIR/app-install/desktop" || true
63+ find "$TMP_EDU/usr/share/app-install-data-edubuntu/icons/" -type f -print0 | \
64+ xargs -0r cp --target-directory "$DIR/app-install/icons" || true
65+ rm -rf "$DIR/app-install/edubuntu"
66+else
67+ cp -a "$TMP/usr/share/app-install/desktop/applications.menu" \
68+ "$DIR/app-install/desktop/" || true
69+fi
70+
71+rm -rf "$DIR/app-install/tmp"
72+
73+mkdir -p "$DIR/.disk"
74+echo '/app-install' > "$DIR/.disk/add-on"
75+
76+exit 0
77
78=== added file 'tools/groovy/installtools.sh'
79--- tools/groovy/installtools.sh 1970-01-01 00:00:00 +0000
80+++ tools/groovy/installtools.sh 2020-05-21 09:20:54 +0000
81@@ -0,0 +1,103 @@
82+#!/bin/bash
83+
84+# Install files in /install and some in /doc
85+set -e
86+
87+# The location of the tree for CD#1, passed in
88+DIR=$1
89+
90+if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
91+ DOCDIR=doc
92+
93+ if [ -n "$BOOTDISKS" -a -e $BOOTDISKS/current/$DOCDIR ] ; then
94+ DOCS=$BOOTDISKS/current/$DOCDIR
95+ elif MANUALDEB="$($BASEDIR/tools/apt-selection cache show "installation-guide-$ARCH")"; then
96+ MANUALDEB="$(echo "$MANUALDEB" | grep ^Filename | awk '{print $2}')"
97+ else
98+ echo "WARNING: Using $DI_CODENAME bootdisk documentation"
99+ DOCS=$MIRROR/dists/$DI_CODENAME/main/installer-$ARCH/current/$DOCDIR
100+ fi
101+
102+ # Put the install documentation in /doc/install
103+ if [ "$DOCS" ] && [ -d "$DOCS" ]; then
104+ cd $DOCS
105+ mkdir -p $DIR/$DOCDIR/install
106+ if ! cp -a * $DIR/$DOCDIR/install; then
107+ echo "ERROR: Unable to copy installer documentation to CD."
108+ fi
109+ elif [ "$MANUALDEB" ]; then
110+ mkdir -p "$DIR/$DOCDIR/install/tmp" "$DIR/$DOCDIR/install/manual"
111+ dpkg -x "$MIRROR/$MANUALDEB" "$DIR/$DOCDIR/install/tmp"
112+ mv "$DIR/$DOCDIR/install/tmp/usr/share/doc/installation-guide-$ARCH"/* "$DIR/$DOCDIR/install/manual/"
113+ rm -rf "$DIR/$DOCDIR/install/tmp"
114+ # just keep the HTML version
115+ rm -f "$DIR/$DOCDIR/install/manual/copyright" \
116+ "$DIR/$DOCDIR/install/manual/changelog.gz" \
117+ "$DIR/$DOCDIR/install/manual"/*/install.*.pdf* \
118+ "$DIR/$DOCDIR/install/manual"/*/install.*.txt*
119+ else
120+ echo "ERROR: Unable to copy installer documentation to CD."
121+ fi
122+fi
123+
124+# Preseed files for special install types
125+mkdir -p $DIR/preseed
126+PRESEED_ROOT=$BASEDIR/data/$CODENAME/preseed
127+for preseed_dir in \
128+ $PRESEED_ROOT $PRESEED_ROOT/$ARCH \
129+ $PRESEED_ROOT/$PROJECT $PRESEED_ROOT/$PROJECT/$ARCH; do
130+ [ -d "$preseed_dir" ] || continue
131+ for file in $preseed_dir/*.seed; do
132+ cp -a "$file" $DIR/preseed/
133+ done
134+done
135+if [ "$CDIMAGE_DVD" = 1 ] && [ "$PROJECT" != ubuntu-server ]; then
136+ # include server on normal DVDs
137+ for preseed_dir in \
138+ $PRESEED_ROOT/ubuntu-server $PRESEED_ROOT/ubuntu-server/$ARCH; do
139+ [ -d "$preseed_dir" ] || continue
140+ for file in $preseed_dir/*.seed; do
141+ cp -a "$file" $DIR/preseed/
142+ done
143+ done
144+ # we normally preseed tasksel to install the desktop task, but this is
145+ # inappropriate on DVDs where much more choice is available
146+ if [ -e "$DIR/preseed/$PROJECT.seed" ]; then
147+ perl -ni -e '
148+ if (/^#/) { $out .= $_ }
149+ elsif (m[^tasksel\s+tasksel/first\s]) { print $out; print; print "tasksel\ttasksel/first\tseen false\n"; $out = "" }
150+ else { print $out; print; $out = "" }' \
151+ "$DIR/preseed/$PROJECT.seed"
152+ if [ ! -s "$DIR/preseed/$PROJECT.seed" ]; then
153+ rm -f "$DIR/preseed/$PROJECT.seed"
154+ fi
155+ fi
156+fi
157+# On live CDs, remove preseed/early_command settings that use the debconf
158+# confmodule. Live CDs implement preseed/early_command in casper which
159+# doesn't have the confmodule available.
160+if [ "$CDIMAGE_LIVE" = 1 ]; then
161+ for file in $DIR/preseed/*.seed; do
162+ [ -f "$file" ] || continue
163+ sed -i '/preseed\/early_command.*confmodule/d' "$file"
164+ done
165+fi
166+
167+if [ "$BACKPORT_KERNEL" ]; then
168+ (cd $DIR/preseed/ &&
169+ case $ARCH in
170+ amd64|i386|arm64|ppc64el|s390x)
171+ for file in *.seed; do
172+ [ -f "$file" ] || continue
173+ cp "$file" hwe-"$file"
174+ if grep -q base-installer/kernel/override-image "$file"; then
175+ sed -i -e "s/string linux-virtual/string linux-virtual-$BACKPORT_KERNEL/" hwe-"$file"
176+ elif ! grep -q base-installer/kernel/altmeta "$file"; then
177+ echo "d-i base-installer/kernel/altmeta string $BACKPORT_KERNEL" >> hwe-"$file"
178+ fi
179+ [ "$PROJECT" = "ubuntu-server" ] || mv hwe-"$file" "$file"
180+ done
181+ ;;
182+ esac
183+ )
184+fi
185
186=== added file 'tools/groovy/upgrade.sh'
187--- tools/groovy/upgrade.sh 1970-01-01 00:00:00 +0000
188+++ tools/groovy/upgrade.sh 2020-05-21 09:20:54 +0000
189@@ -0,0 +1,41 @@
190+#!/bin/sh
191+set -e
192+
193+# Include dist-upgrader dir when available
194+
195+DIR="$1/CD1"
196+TARGETDIR="$DIR/dists/$CODENAME/main/dist-upgrader/binary-all"
197+
198+# Assume that -security is always pocket copied to -updates
199+UPGRADER_POCKETS="$CODENAME-updates $CODENAME"
200+if [ "${PROPOSED:-0}" != "0" ]; then
201+ UPGRADER_POCKETS="$CODENAME-proposed $UPGRADER_POCKETS"
202+fi
203+
204+SOURCEDIR=""
205+for POCKET in $UPGRADER_POCKETS; do
206+ if [ -e "$MIRROR/dists/$POCKET/main/dist-upgrader-all/current/$CODENAME.tar.gz" ]; then
207+ SOURCEDIR="$MIRROR/dists/$POCKET/main/dist-upgrader-all/current"
208+ break
209+ fi
210+done
211+
212+if [ -n "$SOURCEDIR" ]; then
213+ mkdir -p "$TARGETDIR"
214+ # copy upgrade tarball + signature
215+ cp -av "$SOURCEDIR/$CODENAME"* "$TARGETDIR"
216+ # extract the cdromupgrade script from the archive and put it
217+ # onto the top-level of the CD
218+ tar -C "$DIR" -x -z -f "$TARGETDIR/$CODENAME.tar.gz" ./cdromupgrade
219+fi
220+
221+# now check if any prerequisites need to go onto the CD
222+PACKAGESGZ="$MIRROR/dists/$PREV_CODENAME-updates/main/binary-$ARCH/Packages.gz"
223+ARCH_TARGETDIR="$DIR/dists/$CODENAME/main/dist-upgrader/binary-$ARCH"
224+mkdir -p "$ARCH_TARGETDIR"
225+for pkg in $(zcat "$PACKAGESGZ" | grep-dctrl -PensFilename '^(release-upgrader-python-apt|libapt-inst1|libapt-pkg4)'); do
226+ echo "Adding: $pkg"
227+ cp -a "$MIRROR/$pkg" "$ARCH_TARGETDIR"
228+done
229+
230+exit 0

Subscribers

People subscribed via source and target branches