Merge ~alexmurray/ubuntu-security-tools:check-source-package-improvements into ubuntu-security-tools:master

Proposed by Alex Murray
Status: Merged
Merged at revision: fd5fa1f57b8309cb2516616d86ed3eae8fbd16d2
Proposed branch: ~alexmurray/ubuntu-security-tools:check-source-package-improvements
Merge into: ubuntu-security-tools:master
Diff against target: 131 lines (+22/-17)
1 file modified
package-tools/check-source-package (+22/-17)
Reviewer Review Type Date Requested Status
Alex Murray Needs Fixing
Review via email: mp+411647@code.launchpad.net

Description of the change

A couple improvements to check-source-package to make umt check a bit better.

To post a comment you must log in.
Revision history for this message
Seth Arnold (seth-arnold) wrote :

Makes sense to me :) Thanks

Revision history for this message
Alex Murray (alexmurray) wrote :

Actually turns out we can't use $rmadout as https://git.launchpad.net/~alexmurray/ubuntu-security-tools/commit/?id=547da08e7a582382311071a1174bcfb14d7ddf2c since this is the rmadison output but only for the current release of the package - but we need it for all the releases... so I'll have to try and come up with something else...

Revision history for this message
Alex Murray (alexmurray) :
review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/package-tools/check-source-package b/package-tools/check-source-package
2index 63afba1..27513b5 100755
3--- a/package-tools/check-source-package
4+++ b/package-tools/check-source-package
5@@ -50,6 +50,8 @@ error=""
6
7 # rmadison output is called only once and stored here
8 rmadout=""
9+# also store the rmadison output just for the release of this package
10+rmadoutrel=""
11
12 FILTERDIFF=${FILTERDIFF:-/usr/bin/filterdiff}
13
14@@ -127,7 +129,7 @@ exit_script() {
15 check_merge() {
16 format_test_name "Merged changelog"
17 dist=$(awk '/^Distribution: / { print $2 }' "$schanges")
18- if [ "$dist" = "$devel" ] && [ -n "$rmadout" ]; then
19+ if [ "$dist" = "$devel" ] && [ -n "$rmadoutrel" ]; then
20 # Verify that no merge entries are missing...
21 newest="0~"
22 while read -r pkg n1 ver n2 rel rest
23@@ -135,7 +137,7 @@ check_merge() {
24 if dpkg --compare-versions "$newest" le "$ver"; then
25 newest="$ver"
26 fi
27- done < <(echo "$rmadout")
28+ done < <(echo "$rmadoutrel")
29
30 changelog_text=$(cd "$unpacked" && dpkg-parsechangelog --since "$newest" 2>/dev/null | $UST/utilities/snip '^Changes:\s*$' '^[^ ]')
31 changelog_count=$(echo "$changelog_text" | grep "^ $PKG " | wc -l)
32@@ -153,7 +155,7 @@ check_merge() {
33
34 check_lp_autoclose() {
35 format_test_name "Changelog autocloses LP bugs"
36- if [ -n "$rmadout" ]; then
37+ if [ -n "$rmadoutrel" ]; then
38 # Verify that no merge entries are missing...
39 newest="0~"
40 while read -r pkg n1 ver n2 rel rest
41@@ -161,7 +163,7 @@ check_lp_autoclose() {
42 if dpkg --compare-versions "$newest" le "$ver"; then
43 newest="$ver"
44 fi
45- done < <(echo "$rmadout")
46+ done < <(echo "$rmadoutrel")
47
48 changelog_text=$(cd "$unpacked" && dpkg-parsechangelog --since "$newest" 2>/dev/null | $UST/utilities/snip '^Changes:\s*$' '^[^ ]')
49 bad_lp_references=$(echo "$changelog_text" | grep -q -E "LP: +[0-9]" | wc -l)
50@@ -690,7 +692,7 @@ check_version() {
51 # check that no other version snuck in (based on KeesCook's
52 # code (don't bother with -backports pocket)
53 format_test_name "Newest version"
54- madvers=$(echo "$rmadout" | awk -F\| '{print $2}' | uniq)
55+ madvers=$(echo "$rmadoutrel" | awk -F\| '{print $2}' | uniq)
56 older=""
57 for v in $madvers
58 do
59@@ -731,7 +733,7 @@ check_version() {
60 else
61 echo "SKIP: Unable to get date_created for old release $olddist"
62 fi
63- done < <(rmadison -u ubuntu "$package" | awk '{print $3 " " $5}')
64+ done < <(echo "$rmadout" | awk '{print $3 " " $5}')
65 if [ -n "$superceded" ]; then
66 failed "FAIL"
67 echo " Current: $version in $dist"
68@@ -876,7 +878,7 @@ check_reverse_debdiff() {
69 else
70 failed "FAIL"
71 echo "Debdiff Errors:"
72- patch -i "$abs_debdiff" --dry-run -R -p$patchlevel || true
73+ patch -i "$abs_debdiff" --dry-run -t -R -p$patchlevel || true
74 echo ""
75 fi
76 cd "$prevdir" >/dev/null
77@@ -1213,7 +1215,7 @@ check_security_changelog() {
78 format_test_name "Security formatted changelog"
79 prevdir=$(pwd)
80
81- if [ -n "$rmadout" ]; then
82+ if [ -n "$rmadoutrel" ]; then
83 # Verify that no merge entries are missing...
84 newest="0~"
85 while read -r pkg n1 ver n2 rel rest
86@@ -1221,7 +1223,7 @@ check_security_changelog() {
87 if dpkg --compare-versions "$newest" le "$ver"; then
88 newest="$ver"
89 fi
90- done < <(echo "$rmadout")
91+ done < <(echo "$rmadoutrel")
92 changelog_text=$(cd "$unpacked" && dpkg-parsechangelog --since "$newest" 2>/dev/null | $UST/utilities/snip '^Changes:\s*$' '^[^ ]')
93 changelog_count=$(echo "$changelog_text" | grep "^ $PKG " | wc -l)
94 changes_text=$($UST/utilities/snip '^Changes:\s*$' '^[^ ]' "$schanges")
95@@ -1512,25 +1514,28 @@ echo ""
96 format_test_name "Retrieving madison output"
97 pkg_dist=$(grep -E "^Distribution: " "$schanges" | awk '{print $2}' | cut -d '-' -f 1)
98 if [ "$pkg_dist" = "unstable" ]; then
99- rmadout=$(rmadison -u debian "$package" | grep -E " (unstable|sid) +\| ") || true
100+ rmadoutrel=$(rmadison -u debian "$package" | grep -E " (unstable|sid) +\| ") || true
101+ rmadout=$rmadoutrel
102 else
103 if [ "$pkg_dist" == "precise" ] || [ "$pkg_dist" == "trusty" ]; then
104 # TODO: fix this through lp api, but for now this workaround fix the precise issue
105- tmp=$(/usr/bin/apt-cache madison $package | grep "ubuntu-esm" | grep "$pkg_dist" || true)
106+ rmadout=$(/usr/bin/apt-cache madison $package)
107+ tmp=$(echo $rmadout | grep "ubuntu-esm" | grep "$pkg_dist" || true)
108 # if the pkg is not in -esm yet, try to get the prev-ppa
109 if [ -z "$tmp" ]; then
110- tmp=$(/usr/bin/apt-cache madison $package | grep "$pkg_dist" || true)
111+ tmp=$(echo $rmadout | grep "$pkg_dist" || true)
112 fi
113- rmadout=$tmp
114+ rmadoutrel=$tmp
115 elif [ "$force_rmadison" != "yes" ] && [ -x "$UQT/security-tools/lpmad" ]; then
116- rmadout=$($UQT/security-tools/lpmad "$pkg_dist" "$package" | grep "^$package" | grep -v " | ${pkg_dist}-backports" || true)
117+ rmadout=$($UQT/security-tools/lpmad "$package" || true)
118+ rmadoutrel=$(echo $rmadout | grep "$pkg_dist" | grep "^$package" | grep -v " | ${pkg_dist}-backports" || true)
119 else
120- tmp=$(rmadison "$package")
121+ rmadout=$(rmadison "$package")
122 # it's ok if the package doesn't exist yet
123- rmadout=$(echo $tmp | grep -E " ${pkg_dist}(-[a-z]+)?(/[a-z]+)? ") || true
124+ rmadoutrel=$(echo $rmadout | grep -E " ${pkg_dist}(-[a-z]+)?(/[a-z]+)? ") || true
125 fi
126 fi
127-if [ -z "$rmadout" ]; then
128+if [ -z "$rmadoutrel" ]; then
129 echo -n "pass (empty-- ok if new)"
130 else
131 echo -n "pass"

Subscribers

People subscribed via source and target branches