OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /e/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-re Date: 22-Jul-2003 14:40:16 Branch: HEAD Handle: 2003072213401600 Modified files: openpkg-re speclint.pl Log: add one more check which makes sure that the source are existing and correctly located Summary: Revision Changes Path 1.43 +28 -1 openpkg-re/speclint.pl ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-re/speclint.pl ============================================================================ $ cvs diff -u -r1.42 -r1.43 speclint.pl --- openpkg-re/speclint.pl 21 Jul 2003 15:03:55 -0000 1.42 +++ openpkg-re/speclint.pl 22 Jul 2003 12:40:16 -0000 1.43 @@ -1089,7 +1089,7 @@ ## CHECKING ## - # check refernce counts + # check reference counts foreach my $src (%{$S}) { my $s = $S->{$src}; my $str_hdr = ($s->{-type} eq 'source' ? 'Source' : 'Patch' ) . $s->{-num}; @@ -1114,6 +1114,33 @@ " (expected at least one definition via \"$str_hdr\")"); } } + } + } + + # check for existing of sources on filesystem + my $name = $file; + $name =~ s|.*/([^/]+)$|$1|s; + $name =~ s|\.spec$||s; + my $cvsdir = `$rpm --define 'name $name' --eval '%{_specdir}'`; + $cvsdir =~ s|\n$||s; + $cvsdir =~ s|/+$||s; + my $dstdir = `$rpm --define 'name $name' --eval '%{_sourcedir}'`; + $dstdir =~ s|\n$||s; + $dstdir =~ s|/+$||s; + foreach my $src (%{$S}) { + my $s = $S->{$src}; + next if (not $s->{-refhdr}); + if ($s->{-url} eq '' and not -f $cvsdir."/".$s->{-file} and not -f $dstdir."/".$s->{-file}) { + &lint_error($file, undef, undef, "source \"$s->{-file}\" neither found in CVS nor DST locations (you have to provide it)"); + } + elsif ($s->{-url} eq '' and not -f $cvsdir."/".$s->{-file} and -f $dstdir."/".$s->{-file}) { + &lint_error($file, undef, undef, "source \"$s->{-file}\" not found in CVS, but in DST (expected it in CVS or want URL)"); + } + elsif ($s->{-url} ne '' and not -f $cvsdir."/".$s->{-file} and not -f $dstdir."/".$s->{-file}) { + &lint_error($file, undef, undef, "source \"$s->{-file}\" neither found in CVS nor DST locations (you have to download it)"); + } + elsif ($s->{-url} ne '' and -f $cvsdir."/".$s->{-file} and not -f $dstdir."/".$s->{-file}) { + &lint_error($file, undef, undef, "source \"$s->{-file}\" not found in DST, but in CVS (expected it in DST or want URL)"); } } } @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List [EMAIL PROTECTED]