Merge ~iconstantin/ubuntu-security-tools:master into ubuntu-security-tools:master
Status: | Merged |
---|---|
Merged at revision: | b8411101b4792b6df16dd74f7b827c0034811d72 |
Proposed branch: | ~iconstantin/ubuntu-security-tools:master |
Merge into: | ubuntu-security-tools:master |
Diff against target: |
28 lines (+4/-4) 1 file modified
package-tools/check-source-package (+4/-4) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alex Murray | Approve | ||
Review via email: mp+413822@code.launchpad.net |
Commit message
Added surrounding quotes when echoing $rmadout (in package-
Description of the change
~rodrigo-zaiden found `umt check` incorrectly failing for an update, with the root cause traced to UST/package-
At one point in the script, variable rmadout may be set via:
rmadout=
In several potential operations later, rmadout is parsed via grep to produce a value for rmadoutrel (and at times intermediately for tmp). The issue is that when echoing $rmadout and piping to grep, if $rmadout is not surrounded by quotes, new lines are not preserved resulting in incorrect output.
e.g.
$ package=cpanminus
$ /usr/bin/apt-cache madison $package
Results to the following:
cpanminus | 1.7044-2 | http://
cpanminus | 1.7044-2 | http://
cpanminus | 1.7044-2 | http://
cpanminus | 1.7001-1 | http://
cpanminus | 1.7040-1 | http://
cpanminus | 1.7043-1 | http://
cpanminus | 1.7044-1 | http://
cpanminus | 1.7044-2 | http://
cpanminus | 1.7044-2 | http://
cpanminus | 1.7044-2 | http://
cpanminus | 1.7044-2 | http://
cpanminus | 1.7044-1 | http://
cpanminus | 1.7042-2 | http://
cpanminus | 1.7014-1 | http://
If we instead assign the output to rmadout:
rmadout=
And echo $rmadout without quotes:
$ echo $rmadout
We get:
cpanminus | 1.7044-2 | http://
Versus, if we use quotes:
$ echo "$rmadout"
We get the desired output in which new lines are preserved:
cpanminus | 1.7044-2 | http://
cpanminus | 1.7044-2 | http://
cpanminus | 1.7044-2 | http://
cpanminus | 1.7001-1 | http://
cpanminus | 1.7040-1 | http://
cpanminus | 1.7043-1 | http://
cpanminus | 1.7044-1 | http://
cpanminus | 1.7044-2 | http://
cpanminus | 1.7044-2 | http://
cpanminus | 1.7044-2 | http://
cpanminus | 1.7044-2 | http://
cpanminus | 1.7044-1 | http://
cpanminus | 1.7042-2 | http://
cpanminus | 1.7014-1 | http://
Which is important for the following grep operations to work correctly.
LGTM! Thanks.