Merge ~ghadi-rahme/ubuntu/+source/ppa-purge:ubuntu/devel into ubuntu/+source/ppa-purge:ubuntu/devel

Proposed by Ghadi Rahme
Status: Merged
Approved by: Andreas Hasenack
Approved revision: bbc86de709d50f796b0a00ba6b3ca9526e0889eb
Merged at revision: bbc86de709d50f796b0a00ba6b3ca9526e0889eb
Proposed branch: ~ghadi-rahme/ubuntu/+source/ppa-purge:ubuntu/devel
Merge into: ubuntu/+source/ppa-purge:ubuntu/devel
Diff against target: 39 lines (+11/-3)
2 files modified
debian/changelog (+6/-0)
ppa-purge (+5/-3)
Reviewer Review Type Date Requested Status
Andreas Hasenack Approve
Ubuntu Sponsors Pending
Review via email: mp+463813@code.launchpad.net

Commit message

control: Add gawk as a dependency (LP: #2036761)

Description of the change

Currently ppa-purge makes use of the -i option within awk, this option is not available with mawk and only available within gawk 4.1 and higher. Tests were originally done on Ubuntu server which came with gawk installed by default, however desktop instances come with mawk instead.
This change makes sure gawk is installed when installing ppa-purge

To post a comment you must log in.
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

gawk has a much heavier footprint than mawk:

gawk:
Installed-Size: 1.778 kB
Pre-Depends: libc6 (>= 2.34), libgmp10 (>= 2:6.2.1+dfsg1), libmpfr6 (>= 3.1.3), libreadline8 (>= 6.0), libsigsegv2 (>= 2.9)

mawk:
Installed-Size: 275 kB
Depends: libc6 (>= 2.36)

Since ppa-purge is seeded in some flavors:
$ seeded-in-ubuntu ppa-purge
ppa-purge (from ppa-purge) is seeded in:
  kubuntu: daily-live
  ubuntu-budgie: daily-live
  ubuntu-unity: daily-live
  ubuntustudio: dvd

This would affect their dependency tree, late in the cycle (we are post-beta in noble now).

Is there a way to not use gawk's -i option, and stick to the feature set of mawk? Or perhaps just use sed instead?

review: Needs Information
Revision history for this message
Ghadi Rahme (ghadi-rahme) wrote :

Hello Andreas,

Sure I will switch to use sed instead as there is no alternative to the -i option in mawk.
The only way to achieve the same behavior as the -i option in mawk would be to do something like:

awk '/^Components:/ {print; print "Enabled: no"; next}1' "$LIST" > $LIST.tmp && chmod --reference=$LIST $LIST.tmp && chown --reference=$LIST $LIST.tmp && mv $LIST.tmp $LIST

while with sed it would be:

sed -i '/^Components:/a\\Enabled: no' "$LIST"

which seems much less error prone to me.

Revision history for this message
Ghadi Rahme (ghadi-rahme) wrote :

I also took advantage of this patch to update the help message on how to re-enable PPAs

Revision history for this message
Andreas Hasenack (ahasenack) :
review: Needs Information
Revision history for this message
Ghadi Rahme (ghadi-rahme) wrote :

I modified the help message to incorporate both methods of re-enabling the PPA based on if its in a .sources file or a .list file.
The double backslashes were a remnant of different implementations I was testing with sed and missed removing them after finalizing and testing the command.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

+1

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

The bug in the changelog is incorrect, but I can fix that prior to upload.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

For SRUs, if you want to pursue that, you will have to change slightly the [Impact] section where it still describes that the fix is a new dependency, instead of a switch to sed.

Revision history for this message
Ghadi Rahme (ghadi-rahme) wrote :

Thank you for reviewing the MR Andreas! I will be updating the bug description to reflect the new iteration of the fix.
Just out of curiosity, I assume the problem with the changelog is the fact that it is targeting noble instead of oracular?
I had it written before noble's release and didn't think of updating it to oracular, apologies for that.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Uploaded:
Uploading ppa-purge_0.2.8+bzr63-0ubuntu3.dsc
Uploading ppa-purge_0.2.8+bzr63-0ubuntu3.tar.xz
Uploading ppa-purge_0.2.8+bzr63-0ubuntu3_source.buildinfo
Uploading ppa-purge_0.2.8+bzr63-0ubuntu3_source.changes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 384f2a4..2de04e7 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,9 @@
6+ppa-purge (0.2.8+bzr63-0ubuntu3) noble; urgency=medium
7+
8+ * Replace awk with sed to avoid dependency issues. (LP: #2036761)
9+
10+ -- Ghadi Elie Rahme <ghadi.rahme@canonical.com> Mon, 08 Apr 2024 09:45:03 +0000
11+
12 ppa-purge (0.2.8+bzr63-0ubuntu2) noble; urgency=high
13
14 * Add support for deb822 source format. (LP: #2036761)
15diff --git a/ppa-purge b/ppa-purge
16index 81fa00a..304e41d 100755
17--- a/ppa-purge
18+++ b/ppa-purge
19@@ -49,8 +49,10 @@ usage() {
20 echo " will remove https://launchpad.net/~ubuntu-x-swat/+archive/x-updates"
21 echo
22 echo "Notice: If ppa-purge fails for some reason and you wish to try again,"
23- echo "(For example: you left synaptic open while attempting to run it) simply"
24- echo "uncomment the PPA from your sources, run apt-get update and try again."
25+ echo "(For example: you left synaptic open while attempting to run it) remove"
26+ echo "the line \"Enabled: no\" from the Components section in the PPA \".sources\""
27+ echo "file or uncomment the PPA from its \".list\" file, run apt-get update and"
28+ echo "try again."
29 echo
30 exit $1
31 }
32@@ -184,7 +186,7 @@ done
33 for LIST in $(find /etc/apt/ -name "*.sources" -exec readlink -f '{}' \;); do
34 if [ -e $LIST ] && grep -q $PPAOWNER/$PPANAME $LIST; then
35 sed -i '/^Enabled:/d' "$LIST"
36- awk -i inplace '/^Components:/ {print; print "Enabled: no"; next}1' "$LIST"
37+ sed -i '/^Components:/aEnabled: no' "$LIST"
38 fi
39 done
40

Subscribers

People subscribed via source and target branches

to all changes: