Hi Lucas, Please review the attached patch, I think it meets the requirements. About the configuration file format, I considered a whitespace separated list to be practical.
In regard to the usage, maybe we can document the following command as a way to monitor all packages from a server. ssh myserver dpkg -l | tail -n+5 | awk '{ print $2 }' >> ~/.config/how-can-i-help/packages > Alternatively, we could just display new opportunities when running as > user, and display them again the next time we are running as root. > That's a bit simpler. What do you think? Yes that is better. And it makes perfect sense to display the information once per user. Christophe
diff --git a/bin/how-can-i-help b/bin/how-can-i-help index 7e34119..dcbbcff 100755 --- a/bin/how-can-i-help +++ b/bin/how-can-i-help @@ -27,6 +27,7 @@ require 'optparse' HELPITEMS_URL = 'http://udd.debian.org/how-can-i-help.json.gz' DATADIR = '/var/lib/how-can-i-help' SEEN_LOCAL = "#{DATADIR}/seen.json" +PACKAGES = "#{Dir.home}/.config/how-can-i-help/packages" include Debian @@ -95,6 +96,12 @@ str.split(/\n/).each do |l| end end +# add user defined packages +if File.file?(PACKAGES) + additionals = File.read(PACKAGES).gsub(/\s+/m, ' ').strip.split(" ") + packages += additionals +end + helpitems_filtered = [] helpitems.each do |hi| next if (not $all) and seen.include?(hi['hash']) diff --git a/how-can-i-help.1 b/how-can-i-help.1 index 775ab31..a116b69 100644 --- a/how-can-i-help.1 +++ b/how-can-i-help.1 @@ -1,13 +1,13 @@ '\" t .\" Title: how-can-i-help .\" Author: [see the "AUTHOR" section] -.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 09/12/2013 +.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> +.\" Date: 09/20/2013 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "HOW\-CAN\-I\-HELP" "1" "09/12/2013" "\ \&" "\ \&" +.TH "HOW\-CAN\-I\-HELP" "1" "09/20/2013" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -53,6 +53,9 @@ Show all opportunities for contribution\&. * .RS 4 Do not display header and footer\&. .RE +.SH "ADDITIONAL PACKAGES" +.sp +how\-can\-i\-help can also monitor packages not installed locally\&. These are listed in ~/\&.config/how\-can\-i\-help/packages separated by whitespaces or newlines\&. .SH "SEE ALSO" .sp https://wiki\&.debian\&.org/how\-can\-i\-help diff --git a/how-can-i-help.1.txt b/how-can-i-help.1.txt index db175f2..fffdf63 100644 --- a/how-can-i-help.1.txt +++ b/how-can-i-help.1.txt @@ -30,6 +30,12 @@ Options must come before the other command line arguments. *-q*, *--quiet*:: Do not display header and footer. +ADDITIONAL PACKAGES +------------------- +how-can-i-help can also monitor packages not installed locally. These are +listed in ~/.config/how-can-i-help/packages separated by whitespaces or +newlines. + SEE ALSO -------- https://wiki.debian.org/how-can-i-help