From c023b6883445ff95480ad6cc926cbeee27626ea6 Mon Sep 17 00:00:00 2001 From: Till Maas Date: Wed, 10 Feb 2010 13:25:16 +0100 Subject: [PATCH] fix indentation by using 8 blanks for each tab By accident in commit 90e292e971c13ea2ac3d963730c8694dd60e406a four blanks instead of eight blanks were used for each tab. This fixes it. --- smock/smock.pl | 174 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/smock/smock.pl b/smock/smock.pl index fd5f17a..2e8a2a4 100755 --- a/smock/smock.pl +++ b/smock/smock.pl @@ -157,8 +157,8 @@ sub get_lines open PIPE, "$_[0] |" or die "$_[0]: $!"; my @lines; foreach () { - chomp; - push @lines, $_; + chomp; + push @lines, $_; } close PIPE; return @lines; @@ -180,11 +180,11 @@ foreach my $srpm (@srpms) { #print " buildrequires = ", join (",", @buildrequires), "\n"; $srpms{$name} = { - name => $name, - version => $version, - release => $release, - buildrequires => \@buildrequires, - filename => $srpm + name => $name, + version => $version, + release => $release, + buildrequires => \@buildrequires, + filename => $srpm } } @@ -196,21 +196,21 @@ sub is_member_of my $item = shift; foreach (@_) { - return 1 if $item eq $_; + return 1 if $item eq $_; } 0; } sub dependency_in { - my $dep = shift; # eg. dbus-devel + my $dep = shift; # eg. dbus-devel while ($dep) { - return $dep if is_member_of ($dep, @_); - my $newdep = $dep; - $newdep =~ s/-\w+$//; # eg. dbus-devel -> dbus - last if $newdep eq $dep; - $dep = $newdep; + return $dep if is_member_of ($dep, @_); + my $newdep = $dep; + $newdep =~ s/-\w+$//; # eg. dbus-devel -> dbus + last if $newdep eq $dep; + $dep = $newdep; } 0; } @@ -218,7 +218,7 @@ sub dependency_in foreach my $name (keys %srpms) { my @buildrequires = @{$srpms{$name}->{buildrequires}}; @buildrequires = - grep { $_ = dependency_in ($_, keys %srpms) } @buildrequires; + grep { $_ = dependency_in ($_, keys %srpms) } @buildrequires; $srpms{$name}{buildrequires} = \@buildrequires; } @@ -233,14 +233,14 @@ sub tsort my ($fh, $filename) = tempfile (); foreach my $name (@names) { - my @buildrequires = @{$srpms{$name}->{buildrequires}}; - foreach (@buildrequires) { - print $fh "$_ $name\n" - } - # Add a self->self dependency. This ensures that any - # packages which don't have or appear as a dependency of - # any other package still get built. - print $fh "$name $name\n" + my @buildrequires = @{$srpms{$name}->{buildrequires}}; + foreach (@buildrequires) { + print $fh "$_ $name\n" + } + # Add a self->self dependency. This ensures that any + # packages which don't have or appear as a dependency of + # any other package still get built. + print $fh "$name $name\n" } close $fh; @@ -261,24 +261,24 @@ if ($chain) { print 'make chain-build CHAIN="'; foreach $name (@buildorder) { - my @br = @{$srpms{$name}->{buildrequires}}; - - # If a BR occurs within the current group, then start the next group. - my $occurs = 0; - foreach (@br) { - if (exists $group{$_}) { - $occurs = 1; - last; + my @br = @{$srpms{$name}->{buildrequires}}; + + # If a BR occurs within the current group, then start the next group. + my $occurs = 0; + foreach (@br) { + if (exists $group{$_}) { + $occurs = 1; + last; + } } - } - if ($occurs) { - %group = (); - print ": "; - } + if ($occurs) { + %group = (); + print ": "; + } - $group{$name} = 1; - print "$name "; + $group{$name} = 1; + print "$name "; } print "\"\n"; @@ -289,7 +289,7 @@ if ($chain) { if ($dryrun) { foreach (@buildorder) { - print "$_\n"; + print "$_\n"; } exit 0 @@ -302,7 +302,7 @@ sub my_mkdir local $_ = $_[0]; if (! -d $_) { - mkdir ($_, 0755) or die "mkdir $_: $!" + mkdir ($_, 0755) or die "mkdir $_: $!" } } @@ -315,19 +315,19 @@ sub createrepo my_mkdir "$localrepo/$distro/src"; my_mkdir "$localrepo/$distro/src/SRPMS"; system ("cd $localrepo/$distro/src && rm -rf repodata && createrepo -q .") == 0 - or die "createrepo failed: $?\n"; + or die "createrepo failed: $?\n"; my_mkdir "$localrepo/$distro/$arch"; my_mkdir "$localrepo/$distro/$arch/RPMS"; my_mkdir "$localrepo/$distro/$arch/logs"; system ("cd $localrepo/$distro/$arch && rm -rf repodata && createrepo -q --exclude 'logs/*rpm' .") == 0 - or die "createrepo failed: $?\n"; + or die "createrepo failed: $?\n"; } if (! -d "$localrepo/scratch") { mkdir "$localrepo/scratch" - or die "mkdir $localrepo/scratch: $!\nIf you haven't set up a local repository yet, you must read the README file.\n"; + or die "mkdir $localrepo/scratch: $!\nIf you haven't set up a local repository yet, you must read the README file.\n"; } system "rm -rf $localrepo/scratch/*"; @@ -338,51 +338,51 @@ my @errors = (); # around the caching bug in mock/yum. foreach my $arch (@arches) { foreach my $distro (@distros) { - foreach my $name (@buildorder) { - my $version = $srpms{$name}->{version}; - my $release = $srpms{$name}->{release}; - my $srpm_filename = $srpms{$name}->{filename}; - - $release =~ s/\.fc?\d+$//; # "1.fc9" -> "1" - - # Does the built (binary) package exist already? - my $pattern = "$localrepo/$distro/$arch/RPMS/$name-$version-$release.*.rpm"; - #print "pattern = $pattern\n"; - my @binaries = glob $pattern; - - if (@binaries == 0) - { - # Rebuild the package. - print "*** building $name-$version-$release $arch $distro ***\n"; - - createrepo ($arch, $distro); - - my $scratchdir = "$localrepo/scratch/$name-$distro-$arch"; - mkdir $scratchdir; - - if (system ("mock -r $distro-$arch$suffix --resultdir $scratchdir $srpm_filename") == 0) { - # Build was a success so move the final RPMs into the - # mock repo for next time. - system ("mv $scratchdir/*.src.rpm $localrepo/$distro/src/SRPMS") == 0 or die "mv"; - system ("mv $scratchdir/*.rpm $localrepo/$distro/$arch/RPMS") == 0 or die "mv"; - my_mkdir "$localrepo/$distro/$arch/logs/$name-$version-$release"; - system ("mv $scratchdir/*.log $localrepo/$distro/$arch/logs/$name-$version-$release/") == 0 or die "mv"; - system "rm -rf $scratchdir"; - - createrepo ($arch, $distro); - + foreach my $name (@buildorder) { + my $version = $srpms{$name}->{version}; + my $release = $srpms{$name}->{release}; + my $srpm_filename = $srpms{$name}->{filename}; + + $release =~ s/\.fc?\d+$//; # "1.fc9" -> "1" + + # Does the built (binary) package exist already? + my $pattern = "$localrepo/$distro/$arch/RPMS/$name-$version-$release.*.rpm"; + #print "pattern = $pattern\n"; + my @binaries = glob $pattern; + + if (@binaries == 0) + { + # Rebuild the package. + print "*** building $name-$version-$release $arch $distro ***\n"; + + createrepo ($arch, $distro); + + my $scratchdir = "$localrepo/scratch/$name-$distro-$arch"; + mkdir $scratchdir; + + if (system ("mock -r $distro-$arch$suffix --resultdir $scratchdir $srpm_filename") == 0) { + # Build was a success so move the final RPMs into the + # mock repo for next time. + system ("mv $scratchdir/*.src.rpm $localrepo/$distro/src/SRPMS") == 0 or die "mv"; + system ("mv $scratchdir/*.rpm $localrepo/$distro/$arch/RPMS") == 0 or die "mv"; + my_mkdir "$localrepo/$distro/$arch/logs/$name-$version-$release"; + system ("mv $scratchdir/*.log $localrepo/$distro/$arch/logs/$name-$version-$release/") == 0 or die "mv"; + system "rm -rf $scratchdir"; + + createrepo ($arch, $distro); + + } + else { + push @errors, "$name-$distro-$arch$suffix"; + print STDERR "Build failed, return code $?\nLeaving the logs in $scratchdir\n"; + exit 1 unless $keepgoing; + } + } + else + { + print "skipping $name-$version-$release $arch $distro\n"; + } } - else { - push @errors, "$name-$distro-$arch$suffix"; - print STDERR "Build failed, return code $?\nLeaving the logs in $scratchdir\n"; - exit 1 unless $keepgoing; - } - } - else - { - print "skipping $name-$version-$release $arch $distro\n"; - } - } } } -- 1.8.3.1