Merge lp:~darkxst/ppa-purge/lp706774 into lp:ppa-purge

Proposed by Tim Lunn
Status: Merged
Merge reported by: Tim Lunn
Merged at revision: not available
Proposed branch: lp:~darkxst/ppa-purge/lp706774
Merge into: lp:ppa-purge
Diff against target: 67 lines (+18/-6)
3 files modified
debian/changelog (+6/-0)
debian/control (+1/-1)
ppa-purge (+11/-5)
To merge this branch: bzr merge lp:~darkxst/ppa-purge/lp706774
Reviewer Review Type Date Requested Status
Robert Hooker Pending
ppa-purge Pending
Review via email: mp+137061@code.launchpad.net

Description of the change

Specify removal of packages (via $REINSTALL) that don't exist in the ubuntu archives. This allows apt-get to handle the ppa purge in most cases.

I have removed the dependency on aptitude, however leaving the fallback code in the script, since there may be rare cases where apt-get will fail if for some reason we are left with missing/unsatisfied dependencies. Although I have not seen this happen in my testing.

To post a comment you must log in.
lp:~darkxst/ppa-purge/lp706774 updated
62. By Tim Lunn

update grep expression

Revision history for this message
Tim Lunn (darkxst) wrote :

Would be good to get this merged. I have noticed some cases where aptitude still fails to work 100% correctly, when running without this patch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-11-30 10:12:27 +0000
3+++ debian/changelog 2012-12-03 00:32:20 +0000
4@@ -1,3 +1,9 @@
5+ppa-purge (0.2.8+bzr57ubuntu1) raring; urgency=low
6+
7+ * Specify removal of packages that don't exist in Ubuntu (LP: #706774)
8+
9+ -- Tim Lunn <tim@feathertop.org> Fri, 30 Nov 2012 08:25:57 +1100
10+
11 ppa-purge (0.2.8+bzr57) raring; urgency=low
12
13 [ Tim Lunn ]
14
15=== modified file 'debian/control'
16--- debian/control 2012-11-30 10:12:27 +0000
17+++ debian/control 2012-12-03 00:32:20 +0000
18@@ -8,7 +8,7 @@
19
20 Package: ppa-purge
21 Architecture: all
22-Depends: ${misc:Depends}, aptitude (>= 0.6.6-1ubuntu1.2), dpkg (>= 1.16.1)
23+Depends: ${misc:Depends}, dpkg (>= 1.16.1)
24 Description: disables a PPA and reverts to official packages
25 This program disables a PPA from your Software Sources and reverts your
26 system back to the official Ubuntu packages. You can use this to return your
27
28=== modified file 'ppa-purge'
29--- ppa-purge 2012-11-21 09:30:49 +0000
30+++ ppa-purge 2012-12-03 00:32:20 +0000
31@@ -104,7 +104,10 @@
32 fi
33
34 msg "Updating packages lists"
35-$APT update > /dev/null || warn "$APT update failed for some reason"
36+if ! $APT update > /dev/null; then
37+ warn "$APT update failed for some reason"
38+ exit 1
39+fi
40
41 msg "PPA to be removed: $PPAOWNER $PPANAME"
42
43@@ -146,7 +149,12 @@
44 # Create apt argument list for reverting packages
45 REINSTALL=""
46 for PACKAGE in $(cat $REVERTS); do
47- REINSTALL="$REINSTALL $PACKAGE/$DIST"
48+ AVAIL=$(apt-cache policy $PACKAGE | grep -v "$PPAHOST/$PPAOWNER/$PPANAME" | grep -c "500.*$DIST" )
49+ if [ $AVAIL -eq 0 ]; then
50+ REINSTALL="$REINSTALL $PACKAGE-"
51+ else
52+ REINSTALL="$REINSTALL $PACKAGE/$DIST"
53+ fi
54 done
55
56 msg "Package revert list generated:"
57@@ -165,9 +173,7 @@
58 $APT update > /dev/null || warn "$APT update failed for some reason"
59
60 # FIXME:
61-# Workaround for now in case APT fails because of a package not in Ubuntu.
62-# APTALT actually works but it would be preferred to remove the package
63-# from $REINSTALL directly.
64+# Workaround for now in case APT fails because of missing dependencies.
65
66 if $APT $APTARG install $REINSTALL; then
67 msg "PPA purged successfully"

Subscribers

People subscribed via source and target branches

to all changes: