diff --git a/check_source.pl b/check_source.pl index cde43cb6..17fb9e12 100644 --- a/check_source.pl +++ b/check_source.pl @@ -132,7 +132,7 @@ for my $test (glob("/usr/lib/obs/service/source_validators/*")) { my $odir = getcwd(); -chdir($dir) || "chdir $dir failed"; +chdir($dir) || die "chdir $dir failed"; for my $patch (glob("*.diff *.patch *.dif")) { $patches{$patch} = 'current'; } @@ -213,7 +213,7 @@ if (-d "$old") { $diff = diff "$old/$changes", "$dir/$changes"; } for my $line (split(/\n/, $diff)) { - next unless $line =~ m/^+/; + next unless $line =~ m/^\+/; $line =~ s/^\+//; for my $patch (keys %patches) { if (index($line, $patch) != -1) { @@ -238,14 +238,14 @@ if (-d "$old") { } } -my $odir = getcwd; +my $odir2 = getcwd; my $tmpdir = tempdir("obs-XXXXXXX", TMPDIR => 1, CLEANUP => 1); chdir($dir) || die 'tempdir failed'; if (system("/usr/lib/obs/service/download_files","--enforceupstream", "yes", "--enforcelocal", "yes", "--outdir", $tmpdir)) { print "Source URLs are not valid. Try \"osc service runall download_files\".\n"; $ret = 2; } -chdir($odir); +chdir($odir2); for my $rpmlint (glob("$dir/*rpmlintrc")) { open(RPMLINTRC, $rpmlint); @@ -295,7 +295,7 @@ if (-f "$dir/_service.bak") { my %files; chdir($old); prepare_package(\%files); -chdir($odir); +chdir($odir2); chdir($dir); prepare_package(\%files); exit(0); diff --git a/dist/ci/docker-compose-flaker.sh b/dist/ci/docker-compose-flaker.sh index fd014d56..a3f770f3 100755 --- a/dist/ci/docker-compose-flaker.sh +++ b/dist/ci/docker-compose-flaker.sh @@ -4,3 +4,4 @@ set -ex run_as_tester flake8 run_as_tester ./dist/ci/flake-extra +run_as_tester ./dist/ci/perl-check.sh diff --git a/dist/ci/perl-check.sh b/dist/ci/perl-check.sh new file mode 100755 index 00000000..f3b523e7 --- /dev/null +++ b/dist/ci/perl-check.sh @@ -0,0 +1,4 @@ +#! /usr/bin/sh +for i in `find . | grep 'p[lm]$'`; do + perl -I bs_copy -Wc $i || exit $?; +done