Merge lp:~altair-ibn-la-ahad/update-notifier/bug-887650 into lp:update-notifier/ubuntu

Proposed by Andreas Altaïr Redmer
Status: Merged
Merged at revision: 782
Proposed branch: lp:~altair-ibn-la-ahad/update-notifier/bug-887650
Merge into: lp:update-notifier/ubuntu
Diff against target: 33 lines (+14/-1)
2 files modified
data/apt-cdrom-check (+8/-1)
debian/changelog (+6/-0)
To merge this branch: bzr merge lp:~altair-ibn-la-ahad/update-notifier/bug-887650
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+152586@code.launchpad.net

Description of the change

fix for bug lp:887650

To post a comment you must log in.
783. By Andreas Altaïr Redmer

* using $(command) instead of `command`
* using dpkg --compare-versions to compare the Ubuntu versions

Revision history for this message
Brian Murray (brian-murray) wrote :

It'd actually be easier to use the file in $mount_point/.disk/info as a simple awk {'print $2'} would return the release.

Revision history for this message
Brian Murray (brian-murray) wrote :

This check should also be done outside of the dist-upgrader loop so that the package management dialog is not presented for a media with packages older than the current release.

Revision history for this message
Brian Murray (brian-murray) wrote :

I've gone ahead and merged your branch and made the changes I mentioned. Thanks for you work on this.

review: Approve
Revision history for this message
Sebastien Bacher (seb128) wrote :

@Brian: there was an issue with the patch (both here and in the commited version), the $mount_point needed to be put under "" otherwise it wouldn't work with CDs with spaces in their title (e.g "Ubuntu 12.10"). I've uploaded the version including the fix to raring

Revision history for this message
Andreas Altaïr Redmer (altair-ibn-la-ahad) wrote :

@Brian: Thanks for your help, but I think you did something wrong. My fix checked the release information in all the dist-directories of the media. It was intended to be in the loop, because if there is any better version on the media, it will offer to update. There was no misbehaviour for older packages.

This is case happens if you create a USB stick with 2 distros (e.g. precise and orienic). I have had tested it with such a USB stick. But maybe noone else than me would do that ?!

If you agree, you can put that awk line back in the loop.

Cheers.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/apt-cdrom-check'
2--- data/apt-cdrom-check 2013-01-31 00:46:48 +0000
3+++ data/apt-cdrom-check 2013-03-12 13:04:26 +0000
4@@ -78,7 +78,14 @@
5 if $GPG "$d/"*.tar.gz.gpg "$d"/*.tar.gz; then
6 # verified ok, we have a valid upgrader, if it was not ok, the
7 # fallback to the end is ok because we still have packages on it
8- exit 2
9+
10+ #LP Bug 887650: check if the version on the CD is older
11+ THIS_VERSION=$(lsb_release -sr)
12+ VERSION_ON_CD=$(grep "Version" $mount_point/dists/*/Release | head -n1 | egrep -o "[0-9.]*")
13+ # return 2 if the version on CD is newer
14+ if dpkg --compare-versions "$THIS_VERSION" lt "$VERSION_ON_CD"; then
15+ exit 2
16+ fi;
17 fi
18 fi
19 done
20
21=== modified file 'debian/changelog'
22--- debian/changelog 2013-02-01 16:57:15 +0000
23+++ debian/changelog 2013-03-12 13:04:26 +0000
24@@ -1,3 +1,9 @@
25+update-notifier (0.132ubuntu1) precise; urgency=low
26+
27+ * data/apt-cdrom-check: return 2 if the version on CD is newer (fixes LP: #887650)
28+
29+ -- Andreas Altaïr Redmer <altair.ibn.la.ahad.sy@gmail.com> Sun, 10 Mar 2013 21:24:46 +0800
30+
31 update-notifier (0.132) UNRELEASED; urgency=low
32
33 [ Colin Watson ]

Subscribers

People subscribed via source and target branches

to all changes: