[Pkg-ocaml-maint-commits] [SCM] dose3 packaging branch, master, updated. debian/2.9.4-2-19-gb0cd288

2011-06-12 Thread Stefano Zacchiroli
The following commit has been merged in the master branch:
commit 1354d588d76012b5d7926d35d27fb3f98281b8f0
Author: Stefano Zacchiroli z...@upsilon.cc
Date:   Sat Jun 11 16:49:05 2011 +0200

update-cudf-solvers: add --list action

extras:
- add short getopt options
- fix detection of existing edsp/cudf solvers

diff --git a/debian/update-cudf-solvers b/debian/update-cudf-solvers
index cee0fd0..2d7037b 100755
--- a/debian/update-cudf-solvers
+++ b/debian/update-cudf-solvers
@@ -20,6 +20,7 @@ my $apt_cudf = /usr/bin/apt-cudf;
 # globals
 my $debug = 0;
 my $help_action = 0;
+my $list_action = 0;
 my $remove_action = 0;
 
 sub warning($) {
@@ -38,10 +39,10 @@ sub die_usage() {
 pod2usage(%podflags);
 }
 
-sub shallow_find($$) {
+sub shallow_find($) {
 my ($dir, $pred) = @_;
 my @found = ();
-foreach my $f (`find $dir -maxdepth 1 $pred`) {
+foreach my $f (`find $dir -maxdepth 1 -mindepth 1 -type f -o -type l`) {
chomp $f;
push @found, basename $f;
 }
@@ -100,20 +101,26 @@ sub remove_all($$) {
 
 sub main() {
 my $getopt = GetOptions(
-   debug = \$debug,
+   d|debug = \$debug,
h|help = \$help_action,
-   remove = \$remove_action,
+   l|list = \$list_action,
+   r|remove = \$remove_action,
);
 die_usage if (! $getopt || $help_action);
 
 -d $edsp_dir or make_path($edsp_dir, { mode = 0755 });
 
-my @cudf_solvers = shallow_find($cudf_dir, -type f);
-my @edsp_solvers = shallow_find($edsp_dir, -type l);
-foreach my $s (@cudf_solvers) { debug found cudf solver: $s; }
-foreach my $s (@edsp_solvers) { debug found edsp solver: $s; }
+my @cudf_solvers = shallow_find($cudf_dir);
+my @edsp_solvers = shallow_find($edsp_dir);
+if ($debug) {
+   foreach my $s (@cudf_solvers) { debug found cudf solver: $s; }
+   foreach my $s (@edsp_solvers) { debug found edsp solver: $s; }
+}
 
-if ($remove_action) {
+if ($list_action) {
+   foreach my $s (@cudf_solvers) { print cudf: $s\n; }
+   foreach my $s (@edsp_solvers) { print edsp: $s\n; }
+} elsif ($remove_action) {
remove_all(\@cudf_solvers, \@edsp_solvers);
 } else {
install_new(\@cudf_solvers, \@edsp_solvers);
@@ -138,6 +145,8 @@ update-cudf-solvers - register available CUDF solvers as 
APT external solvers
 
 =item Bupdate-cudf-solvers [IOPTION]... --remove
 
+=item Bupdate-cudf-solvers [IOPTION]... --list
+
 =back
 
 =head1 DESCRIPTION
@@ -156,6 +165,8 @@ The second form (with the mandatory C--remove option) 
will remove all
 installed external APT solvers that originated from CUDF solvers. It's a
 cleanup operation meant to be used only upon removal of the apt-cudf package.
 
+The third form just lists available solvers and exit.
+
 Note that other, non-CUDF based, APT external solvers might be present under
 F/usr/lib/apt/solvers. update-cudf-solvers leaves the untouched and act only
 on (present or past) APT solvers corresponding to CUDF solvers.
@@ -170,6 +181,8 @@ you should not be required to opearte update-cudf-solvers 
manually.
 
 =over 4
 
+=item -d
+
 =item --debug
 
 Print debugging information during operation.
@@ -180,9 +193,18 @@ Print debugging information during operation.
 
 Show usage information and exit.
 
+=item -l
+
+=item --list
+
+List available solvers and exit. Both CUDF and APT's external solvers (AKA
+EDSP solvers) will be listed.
+
+=item -r
+
 =item --remove
 
-Unregister all CUDF solvers (see DESCRIPTION above).
+Unregister all CUDF solvers.
 
 =back
 

-- 
dose3 packaging

___
Pkg-ocaml-maint-commits mailing list
Pkg-ocaml-maint-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits


[Pkg-ocaml-maint-commits] [SCM] dose3 packaging branch, master, updated. debian/2.9.4-2-19-gb0cd288

2011-06-12 Thread Stefano Zacchiroli
The following commit has been merged in the master branch:
commit 9cd288e5d189f99da0390d91634b6bf8affbc51d
Author: Stefano Zacchiroli z...@upsilon.cc
Date:   Sat Jun 11 16:32:34 2011 +0200

cosmetic changs: uniform indentation in update-cudf-solvers

diff --git a/debian/update-cudf-solvers b/debian/update-cudf-solvers
index 06a6324..cee0fd0 100755
--- a/debian/update-cudf-solvers
+++ b/debian/update-cudf-solvers
@@ -22,6 +22,22 @@ my $debug = 0;
 my $help_action = 0;
 my $remove_action = 0;
 
+sub warning($) {
+my ($msg) = @_;
+print STDERR update-cudf-solvers: W: $msg\n;
+}
+
+sub debug($) {
+my ($msg) = @_;
+print STDERR update-cudf-solvers: I: $msg\n if $debug;
+}
+
+sub die_usage() {
+my %podflags = ( verbose = 1,
+exitval = 2 );
+pod2usage(%podflags);
+}
+
 sub shallow_find($$) {
 my ($dir, $pred) = @_;
 my @found = ();
@@ -32,15 +48,6 @@ sub shallow_find($$) {
 return @found;
 }
 
-sub warning($) { my ($msg) = @_; print STDERR update-cudf-solvers: W: 
$msg\n; }
-sub debug($) { my ($msg) = @_; print STDERR update-cudf-solvers: I: $msg\n 
if $debug; }
-
-sub die_usage() {
-my %podflags = ( verbose = 1,
-exitval = 2 );
-pod2usage(%podflags);
-}
-
 # check whether a given EDSP solver path originates from a CUDF solver
 sub is_cudf_solver($) {
 my ($path) = @_;

-- 
dose3 packaging

___
Pkg-ocaml-maint-commits mailing list
Pkg-ocaml-maint-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits


[Pkg-ocaml-maint-commits] [SCM] dose3 packaging branch, master, updated. debian/2.9.4-2-19-gb0cd288

2011-06-12 Thread Stefano Zacchiroli
The following commit has been merged in the master branch:
commit b0cd288290da53e3c397299bb0c37d594e8b92f1
Author: Stefano Zacchiroli z...@upsilon.cc
Date:   Sat Jun 11 17:06:23 2011 +0200

update-cudf-solvers manpage: rename as belonging to section 8

diff --git a/debian/apt-cudf.manpages b/debian/apt-cudf.manpages
index db08673..dfe8c9f 100644
--- a/debian/apt-cudf.manpages
+++ b/debian/apt-cudf.manpages
@@ -1,2 +1,2 @@
 doc/manpages/apt-cudf.1
-debian/update-cudf-solvers.1
+debian/update-cudf-solvers.8
diff --git a/debian/rules b/debian/rules
index d7a43c6..6f8da5f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -25,10 +25,10 @@ override_dh_auto_build:
dh_auto_build
pod2man --section 8 \
  --release apt-cudf $(shell dpkg-parsechangelog | grep ^Version: | 
cut -f 2 -d' ') \
- debian/update-cudf-solvers  debian/update-cudf-solvers.1
+ debian/update-cudf-solvers  debian/update-cudf-solvers.8
 
 override_dh_auto_clean:
dh_auto_clean
-   rm -f debian/update-cudf-solvers.1
+   rm -f debian/update-cudf-solvers.8
rm -f _tags
 

-- 
dose3 packaging

___
Pkg-ocaml-maint-commits mailing list
Pkg-ocaml-maint-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits