]> git.donarmstrong.com Git - debhelper.git/commitdiff
use foreach instead of for when looping thru array
authorJoey Hess <joey@gnu.kitenet.net>
Thu, 19 Nov 2009 19:54:23 +0000 (14:54 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Thu, 19 Nov 2009 19:54:23 +0000 (14:54 -0500)
Debian/Debhelper/Buildsystem.pm
Debian/Debhelper/Dh_Buildsystems.pm
Debian/Debhelper/Dh_Lib.pm

index 5b3423e60e6f9542c3e337102ced6a645e8d1677..f729c0da4ac4bd1debdd9c8491b1507b27ddd807 100644 (file)
@@ -169,7 +169,7 @@ sub canonpath {
        my ($this, $path)=@_;
        my @canon;
        my $back=0;
-       for my $comp (split(m%/+%, $path)) {
+       foreach my $comp (split(m%/+%, $path)) {
                if ($comp eq '.') {
                        next;
                }
index 8470eac05171f7d4e767f2703db6f202110fab1c..f6c123c5800bad09a7e1990e701e6bc041ccd898 100644 (file)
@@ -62,7 +62,7 @@ sub autoselect_buildsystem {
        my $selected;
        my $selected_level = 0;
 
-       for my $inst (@_) {
+       foreach my $inst (@_) {
                # Only derived (i.e. more specific) build system can be
                # considered beyond the currently selected one.
                next if defined $selected && !$inst->isa(ref $selected);
@@ -92,7 +92,7 @@ sub load_buildsystem {
        else {
                # Try to determine build system automatically
                my @buildsystems;
-               for $system (@BUILDSYSTEMS) {
+               foreach $system (@BUILDSYSTEMS) {
                        push @buildsystems, create_buildsystem_instance($system, @_);
                }
                return autoselect_buildsystem($step, @buildsystems);
@@ -103,10 +103,10 @@ sub load_all_buildsystems {
        my $incs=shift || \@INC;
        my (%buildsystems, @buildsystems);
 
-       for my $inc (@$incs) {
+       foreach my $inc (@$incs) {
                my $path = File::Spec->catdir($inc, "Debian/Debhelper/Buildsystem");
                if (-d $path) {
-                       for my $module_path (glob "$path/*.pm") {
+                       foreach my $module_path (glob "$path/*.pm") {
                                my $name = basename($module_path);
                                $name =~ s/\.pm$//;
                                next if exists $buildsystems{$name};
@@ -116,7 +116,7 @@ sub load_all_buildsystems {
        }
 
        # Standard debhelper build systems first
-       for my $name (@BUILDSYSTEMS) {
+       foreach my $name (@BUILDSYSTEMS) {
                error("standard debhelper build system '$name' could not be found/loaded")
                    if not exists $buildsystems{$name};
                push @buildsystems, $buildsystems{$name};
@@ -124,7 +124,7 @@ sub load_all_buildsystems {
        }
 
        # The rest are 3rd party build systems
-       for my $name (keys %buildsystems) {
+       foreach my $name (keys %buildsystems) {
                my $inst = $buildsystems{$name};
                $inst->{thirdparty} = 1;
                push @buildsystems, $inst;
@@ -188,7 +188,7 @@ sub buildsystems_list {
        my $specified;
 
        # List build systems (including auto and specified status)
-       for my $inst (@buildsystems) {
+       foreach my $inst (@buildsystems) {
                if (! defined $specified && defined $opt_buildsys && $opt_buildsys eq $inst->NAME()) {
                        $specified = $inst;
                }
index c5b06f69fd546df1509da31b2fab697b1188dd48..a4e357095da2b2afe16d83df1125dd0bdc7e2b5e 100644 (file)
@@ -576,7 +576,7 @@ sub filedoublearray {
                # as if we were in the specified directory, so the
                # filenames that come out are relative to it.
                if (defined $globdir && ! compat(2)) {
-                       for (map { glob "$globdir/$_" } split) {
+                       foreach (map { glob "$globdir/$_" } split) {
                                s#^$globdir/##;
                                push @line, $_;
                        }