reformat list
authorJoey Hess <joey@gnu.kitenet.net>
Mon, 20 Apr 2009 19:08:37 +0000 (15:08 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Mon, 20 Apr 2009 19:08:37 +0000 (15:08 -0400)
I think this is a bit easier to understand; I was never a fan of complex
and hard to read column headers in console output (ie, dpkg -l).

Debian/Debhelper/Dh_Buildsystems.pm

index 5a3e45f41f913b60c9b5c2f8f17ada63e1121954..0a48693f4263f1a0890918290ce6c0cae5814e0f 100644 (file)
@@ -95,31 +95,29 @@ sub buildsystems_list {
        my $action=shift;
 
        # List buildsystems (including auto and specified status)
-       my $auto_found;
-       my $specified_found;
-       print "STATUS (* auto, + specified) NAME - DESCRIPTION", "\n";
+       my ($auto, $specified);
        for my $system (@BUILDSYSTEMS) {
                my $inst = create_buildsystem_instance($system, build_action => undef);
                my $is_specified = defined $opt_buildsys && $opt_buildsys eq $inst->NAME();
-               my $status;
-               if ($is_specified) {
-                       $status = "+";
-                       $specified_found = 1;
+               if (! defined $specified && defined $opt_buildsys && $opt_buildsys eq $inst->NAME()) {
+                       $specified = $inst->NAME();
                }
-               elsif (!$auto_found && $inst->check_auto_buildable($action)) {
-                       $status = "*";
-                       $auto_found = 1;
+               elsif (! defined $auto && $inst->check_auto_buildable($action)) {
+                       $auto = $inst->NAME();
                }
-               else {
-                       $status = " ";
-               }
-               printf("%s %s - %s.\n", $status, $inst->NAME(), $inst->DESCRIPTION());
+               printf("%s - %s\n", $inst->NAME(), $inst->DESCRIPTION());
        }
-       # List a 3rd party buildsystem too.
-       if (!$specified_found && defined $opt_buildsys) {
+       # List a specified 3rd party buildsystem too.
+       if (! defined $specified && defined $opt_buildsys) {
                my $inst = create_buildsystem_instance($opt_buildsys, build_action => undef);
-               printf("+ %s - %s.\n", $inst->NAME(), $inst->DESCRIPTION());
+               printf("%s - %s.\n", $inst->NAME(), $inst->DESCRIPTION());
+               $specified = $inst->NAME();
        }
+       print "\n";
+       print "Auto-selected: $auto\n" if defined $auto;
+       print "Specified: $specified\n" if defined $specified;
+       print "No system auto-selected or specified\n"
+               if ! defined $auto && ! defined $specified;
 }
 
 sub buildsystems_do {