Merge ~smoser/curtin:cleanup/curtainer-get-source-by-version into curtin:master

Proposed by Scott Moser
Status: Merged
Merged at revision: fb11a5640f502ce5375d6c5e46b8d654f1e909b6
Proposed branch: ~smoser/curtin:cleanup/curtainer-get-source-by-version
Merge into: curtin:master
Diff against target: 36 lines (+6/-4)
1 file modified
tools/curtainer (+6/-4)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Ryan Harper (community) Approve
Review via email: mp+337290@code.launchpad.net

Commit message

tools: fix curtainer to specify source version to apt-get source.

We were seeing version skew from the binary package to the source
package, and had recently added code to exit failure if we saw
that case.

This change will make curtainer explicitly request the version
of source that it has the binary for. It is possible that the
ppa would not have that version (if it had been supersceeded),
but hopefully the archive holds onto source for current binary
packages.

Description of the change

see commit message

To post a comment you must log in.
Revision history for this message
Ryan Harper (raharper) wrote :

That's a good fix for the race.

review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/tools/curtainer b/tools/curtainer
index 525a998..6c0628f 100755
--- a/tools/curtainer
+++ b/tools/curtainer
@@ -3,7 +3,7 @@
33
4set -o pipefail4set -o pipefail
55
6VERBOSITY=06VERBOSITY=1
7CONTAINER=""7CONTAINER=""
88
9error() { echo "$@" 1>&2; }9error() { echo "$@" 1>&2; }
@@ -171,17 +171,19 @@ main() {
171171
172 if [ "${getsource}" != "none" ]; then172 if [ "${getsource}" != "none" ]; then
173 local isrcd="/tmp/curtin-source"173 local isrcd="/tmp/curtin-source"
174 debug 1 "getting source for curtin to $getsource"174 debug 1 "getting source for curtin at $pkg_ver to $getsource"
175 inside "$name" $eatmydata sh -ec '175 inside "$name" $eatmydata sh -ec '
176 target="$1"176 target="$1"
177 pkg="$2"
178 ver="$3"
177 d=$(mktemp -d)179 d=$(mktemp -d)
178 cd "$d"180 cd "$d"
179 apt-get source curtin181 apt-get source "${pkg}${ver:+=${ver}}"
180 for x in *; do [ -d "$x" ] && break; done182 for x in *; do [ -d "$x" ] && break; done
181 [ -d "$x" ] || { echo no source dir found.; exit 1; }183 [ -d "$x" ] || { echo no source dir found.; exit 1; }
182 cp -a $x "$target"184 cp -a $x "$target"
183 rm -Rf "$d"185 rm -Rf "$d"
184 ' -- "$isrcd"186 ' -- "$isrcd" "curtin" "$pkg_ver"
185 mkdir "$getsource" || fail "failed to create dir '$getsource'"187 mkdir "$getsource" || fail "failed to create dir '$getsource'"
186 inside "$name" tar -C "$isrcd" -cf - . |188 inside "$name" tar -C "$isrcd" -cf - . |
187 tar -C "$getsource" -xf - ||189 tar -C "$getsource" -xf - ||

Subscribers

People subscribed via source and target branches