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
=== modified file 'debian/changelog'
--- debian/changelog 2012-11-30 10:12:27 +0000
+++ debian/changelog 2012-12-03 00:32:20 +0000
@@ -1,3 +1,9 @@
1ppa-purge (0.2.8+bzr57ubuntu1) raring; urgency=low
2
3 * Specify removal of packages that don't exist in Ubuntu (LP: #706774)
4
5 -- Tim Lunn <tim@feathertop.org> Fri, 30 Nov 2012 08:25:57 +1100
6
1ppa-purge (0.2.8+bzr57) raring; urgency=low7ppa-purge (0.2.8+bzr57) raring; urgency=low
28
3 [ Tim Lunn ]9 [ Tim Lunn ]
410
=== modified file 'debian/control'
--- debian/control 2012-11-30 10:12:27 +0000
+++ debian/control 2012-12-03 00:32:20 +0000
@@ -8,7 +8,7 @@
88
9Package: ppa-purge9Package: ppa-purge
10Architecture: all10Architecture: all
11Depends: ${misc:Depends}, aptitude (>= 0.6.6-1ubuntu1.2), dpkg (>= 1.16.1)11Depends: ${misc:Depends}, dpkg (>= 1.16.1)
12Description: disables a PPA and reverts to official packages12Description: disables a PPA and reverts to official packages
13 This program disables a PPA from your Software Sources and reverts your13 This program disables a PPA from your Software Sources and reverts your
14 system back to the official Ubuntu packages. You can use this to return your 14 system back to the official Ubuntu packages. You can use this to return your
1515
=== modified file 'ppa-purge'
--- ppa-purge 2012-11-21 09:30:49 +0000
+++ ppa-purge 2012-12-03 00:32:20 +0000
@@ -104,7 +104,10 @@
104fi104fi
105105
106msg "Updating packages lists"106msg "Updating packages lists"
107$APT update > /dev/null || warn "$APT update failed for some reason"107if ! $APT update > /dev/null; then
108 warn "$APT update failed for some reason"
109 exit 1
110fi
108111
109msg "PPA to be removed: $PPAOWNER $PPANAME"112msg "PPA to be removed: $PPAOWNER $PPANAME"
110113
@@ -146,7 +149,12 @@
146# Create apt argument list for reverting packages149# Create apt argument list for reverting packages
147REINSTALL=""150REINSTALL=""
148for PACKAGE in $(cat $REVERTS); do151for PACKAGE in $(cat $REVERTS); do
149 REINSTALL="$REINSTALL $PACKAGE/$DIST"152 AVAIL=$(apt-cache policy $PACKAGE | grep -v "$PPAHOST/$PPAOWNER/$PPANAME" | grep -c "500.*$DIST" )
153 if [ $AVAIL -eq 0 ]; then
154 REINSTALL="$REINSTALL $PACKAGE-"
155 else
156 REINSTALL="$REINSTALL $PACKAGE/$DIST"
157 fi
150done158done
151159
152msg "Package revert list generated:"160msg "Package revert list generated:"
@@ -165,9 +173,7 @@
165$APT update > /dev/null || warn "$APT update failed for some reason"173$APT update > /dev/null || warn "$APT update failed for some reason"
166174
167# FIXME:175# FIXME:
168# Workaround for now in case APT fails because of a package not in Ubuntu.176# Workaround for now in case APT fails because of missing dependencies.
169# APTALT actually works but it would be preferred to remove the package
170# from $REINSTALL directly.
171177
172if $APT $APTARG install $REINSTALL; then178if $APT $APTARG install $REINSTALL; then
173 msg "PPA purged successfully"179 msg "PPA purged successfully"

Subscribers

People subscribed via source and target branches

to all changes: