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
1diff --git a/tools/curtainer b/tools/curtainer
2index 525a998..6c0628f 100755
3--- a/tools/curtainer
4+++ b/tools/curtainer
5@@ -3,7 +3,7 @@
6
7 set -o pipefail
8
9-VERBOSITY=0
10+VERBOSITY=1
11 CONTAINER=""
12
13 error() { echo "$@" 1>&2; }
14@@ -171,17 +171,19 @@ main() {
15
16 if [ "${getsource}" != "none" ]; then
17 local isrcd="/tmp/curtin-source"
18- debug 1 "getting source for curtin to $getsource"
19+ debug 1 "getting source for curtin at $pkg_ver to $getsource"
20 inside "$name" $eatmydata sh -ec '
21 target="$1"
22+ pkg="$2"
23+ ver="$3"
24 d=$(mktemp -d)
25 cd "$d"
26- apt-get source curtin
27+ apt-get source "${pkg}${ver:+=${ver}}"
28 for x in *; do [ -d "$x" ] && break; done
29 [ -d "$x" ] || { echo no source dir found.; exit 1; }
30 cp -a $x "$target"
31 rm -Rf "$d"
32- ' -- "$isrcd"
33+ ' -- "$isrcd" "curtin" "$pkg_ver"
34 mkdir "$getsource" || fail "failed to create dir '$getsource'"
35 inside "$name" tar -C "$isrcd" -cf - . |
36 tar -C "$getsource" -xf - ||

Subscribers

People subscribed via source and target branches