Control: tag -1 patch Hi Paul!
I wrote up a quick patch that takes into account the package names when sorting (or bug id, in the case of RFSes), then added the removal time (in the case of autorm) and cleaned up a bit the surrounding code by using `sort_by` rather than `sort { |a,b| expr(a) <=> expr(b) }`. The corresponding patches are attached. Best, nicoo On Sun, Aug 28, 2016 at 10:17:17AM +0800, Paul Wise wrote: > Package: how-can-i-help > Version: 14 > Severity: minor > Tags: newcomer > > I'm diffing the daily output of `how-can-i-help --old` and I noticed > that for packages removed from testing, the output flips around, with > one package being first on one day and then the other bug the next. > This should be easy to fix with a sort, so is suitable for a newcomer. > > Some examples: > > Packages removed from Debian 'testing' (the maintainer might need help): > - - android-libdex - https://tracker.debian.org/pkg/android-platform-dalvik > - dexdump - https://tracker.debian.org/pkg/android-platform-dalvik > + - android-libdex - https://tracker.debian.org/pkg/android-platform-dalvik > > Packages removed from Debian 'testing' (the maintainer might need help): > - - dexdump - https://tracker.debian.org/pkg/android-platform-dalvik > - android-libdex - https://tracker.debian.org/pkg/android-platform-dalvik > + - dexdump - https://tracker.debian.org/pkg/android-platform-dalvik > > -- System Information: > Debian Release: stretch/sid > APT prefers testing-debug > APT policy: (900, 'testing-debug'), (900, 'testing'), (800, > 'unstable-debug'), (800, 'unstable'), (790, 'buildd-unstable'), (700, > 'experimental-debug'), (700, 'experimental'), (690, 'buildd-experimental') > Architecture: amd64 (x86_64) > > Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores) > Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8) > Shell: /bin/sh linked to /bin/dash > Init: systemd (via /run/systemd/system) > > Versions of packages how-can-i-help depends on: > ii ruby 1:2.3.0+4 > ii ruby-debian 0.3.9+b6 > ii ruby-json 2.0.1+dfsg-2 > > how-can-i-help recommends no packages. > > how-can-i-help suggests no packages. > > -- debconf-show failed > > -- > bye, > pabs > > https://wiki.debian.org/PaulWise
From 74ab5e2c3e2614c958c6b260ab9d9f39a221edca Mon Sep 17 00:00:00 2001 From: Nicolas Braud-Santoni <nico...@braud-santoni.eu> Date: Sun, 28 Aug 2016 16:51:56 +0200 Subject: [PATCH 1/3] Use a stable sort order Changes the sort order for removals from testing (effective and pending) and RFSes. Closes #835653. --- bin/how-can-i-help | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/how-can-i-help b/bin/how-can-i-help index d4186f7..cb19674 100755 --- a/bin/how-can-i-help +++ b/bin/how-can-i-help @@ -292,7 +292,7 @@ unless $kas if notesting.length > 0 puts $old ? 'Packages removed from Debian \'testing\' (the maintainer might need help):' : 'New packages removed from Debian \'testing\' (the maintainer might need help):' - notesting.sort { |a, b| a['source'] <=> b['source'] }.each do |r| + notesting.sort_by { |r| [r['source'], r['package']] }.each do |r| puts " - #{r['package']} - https://tracker.debian.org/pkg/#{r['source']}" end puts @@ -300,7 +300,7 @@ unless $kas if autoremoval.length > 0 puts $old ? 'Packages going to be removed from Debian \'testing\' (the maintainer might need help):' : 'New packages going to be removed from Debian \'testing\' (the maintainer might need help):' - autoremoval.sort { |a, b| a['source'] <=> b['source'] }.each do |r| + autoremoval.sort_by { |r| [r['source'], r['package']] }.each do |r| bugs = r['bugs'].map { |b| "##{b}" } if bugs.count == 0 bugs = '' @@ -316,7 +316,7 @@ unless $kas if rfs.length > 0 puts $old ? 'Packages waiting for sponsorship (reviews/tests are also useful):' : 'New packages waiting for sponsorship (reviews/tests are also useful):' - rfs.sort { |a, b| a['source'] <=> b['source'] }.each do |r| + rfs.sort_by { |r| [r['source'], r['id']] }.each do |r| puts " - #{r['source']} - https://bugs.debian.org/#{r['id']} - #{r['title']}" end puts -- 2.8.1
From 7bbd7543bffc11c4b2b584f27bf554d047cb287b Mon Sep 17 00:00:00 2001 From: Nicolas Braud-Santoni <nico...@braud-santoni.eu> Date: Sun, 28 Aug 2016 17:14:10 +0200 Subject: [PATCH 2/3] Use the sort_by idiom where needed, for clarity and consistency --- bin/how-can-i-help | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/how-can-i-help b/bin/how-can-i-help index cb19674..fe5c436 100755 --- a/bin/how-can-i-help +++ b/bin/how-can-i-help @@ -276,7 +276,7 @@ unless $kas if gift.length > 0 puts $old ? 'Bugs suitable for new contributors (tagged \'newcomer\'):' : 'New bugs suitable for new contributors (tagged \'newcomer\'):' - gift.sort { |a, b| [a['package'], a['bug'] ] <=> [ b['package'], b['bug'] ] }.each do |r| + gift.sort_by { |r| [r['package'], r['bug']] }.each do |r| puts " - #{r['package']} - https://bugs.debian.org/#{r['bug']} - #{r['title']}" end puts @@ -284,7 +284,7 @@ unless $kas if infra.length > 0 puts $old ? 'Bugs affecting Debian infrastructure (tagged \'newcomer\'):' : 'New bugs affecting Debian infrastructure (tagged \'newcomer\'):' - infra.sort { |a, b| [a['package'], a['bug'] ] <=> [ b['package'], b['bug'] ] }.each do |r| + infra.sort_by { |r| [r['package'], r['bug']] }.each do |r| puts " - #{r['package']} - https://bugs.debian.org/#{r['bug']} - #{r['title']}" end puts -- 2.8.1
From 096b9e58a9843462b0d19b76537f28904a87db9f Mon Sep 17 00:00:00 2001 From: Nicolas Braud-Santoni <nico...@braud-santoni.eu> Date: Sun, 28 Aug 2016 17:19:41 +0200 Subject: [PATCH 3/3] Sort the autorm list by removal time --- bin/how-can-i-help | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/how-can-i-help b/bin/how-can-i-help index fe5c436..a7a9ef7 100755 --- a/bin/how-can-i-help +++ b/bin/how-can-i-help @@ -300,7 +300,7 @@ unless $kas if autoremoval.length > 0 puts $old ? 'Packages going to be removed from Debian \'testing\' (the maintainer might need help):' : 'New packages going to be removed from Debian \'testing\' (the maintainer might need help):' - autoremoval.sort_by { |r| [r['source'], r['package']] }.each do |r| + autoremoval.sort_by { |r| [r['source'], Time.at(r['removal_time']), r['package']] }.each do |r| bugs = r['bugs'].map { |b| "##{b}" } if bugs.count == 0 bugs = '' -- 2.8.1
signature.asc
Description: PGP signature