summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-04-20 14:51:14 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-04-20 14:51:14 -0400
commit0ccb397a6c52894c8756b3611121b4e1bbe11e5e (patch)
tree3704a45058f5ecdc0027e47d13c12f66e8ed9fd3
parentc4a6279687b7b1a5dd4a9d3d32ddd6cd4375d4cf (diff)
factor out a buildsystems_list
-rw-r--r--Debian/Debhelper/Dh_Buildsystems.pm58
1 files changed, 32 insertions, 26 deletions
diff --git a/Debian/Debhelper/Dh_Buildsystems.pm b/Debian/Debhelper/Dh_Buildsystems.pm
index e3c7805..5a3e45f 100644
--- a/Debian/Debhelper/Dh_Buildsystems.pm
+++ b/Debian/Debhelper/Dh_Buildsystems.pm
@@ -91,6 +91,37 @@ sub buildsystems_init {
Debian::Debhelper::Dh_Lib::init(%args);
}
+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";
+ 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;
+ }
+ elsif (!$auto_found && $inst->check_auto_buildable($action)) {
+ $status = "*";
+ $auto_found = 1;
+ }
+ else {
+ $status = " ";
+ }
+ printf("%s %s - %s.\n", $status, $inst->NAME(), $inst->DESCRIPTION());
+ }
+ # List a 3rd party buildsystem too.
+ if (!$specified_found && defined $opt_buildsys) {
+ my $inst = create_buildsystem_instance($opt_buildsys, build_action => undef);
+ printf("+ %s - %s.\n", $inst->NAME(), $inst->DESCRIPTION());
+ }
+}
+
sub buildsystems_do {
my $action=shift;
@@ -104,32 +135,7 @@ sub buildsystems_do {
}
if ($opt_list) {
- # List buildsystems (including auto and specified status)
- my $auto_found;
- my $specified_found;
- print "STATUS (* auto, + specified) NAME - DESCRIPTION", "\n";
- 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;
- }
- elsif (!$auto_found && $inst->check_auto_buildable($action)) {
- $status = "*";
- $auto_found = 1;
- }
- else {
- $status = " ";
- }
- printf("%s %s - %s.\n", $status, $inst->NAME(), $inst->DESCRIPTION());
- }
- # List a 3rd party buildsystem too.
- if (!$specified_found && defined $opt_buildsys) {
- my $inst = create_buildsystem_instance($opt_buildsys, build_action => undef);
- printf("+ %s - %s.\n", $inst->NAME(), $inst->DESCRIPTION());
- }
+ buildsystems_list($action);
exit 0;
}