Update of /cvsroot/fink/scripts/bindist In directory sc8-pr-cvs1:/tmp/cvs-serv9481
Modified Files: Tag: remis-bindist licensecheck Log Message: Handles info files as well as package name, modification to output format to make it usable as exclude file for rsync Index: licensecheck =================================================================== RCS file: /cvsroot/fink/scripts/bindist/licensecheck,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- licensecheck 2 May 2003 20:40:40 -0000 1.2 +++ licensecheck 21 Dec 2003 23:54:12 -0000 1.2.2.1 @@ -4,6 +4,7 @@ require 5.006; # perl 5.6.0 or newer required use strict; +use Fink::Services; use Fink::Package; use Fink::PkgVersion; use Fink::Config qw($config $basepath); @@ -19,7 +20,11 @@ Fink::Package->require_packages(); -my ($pname, $package, $license); +# Get the release number +my ($release); +chomp($release=`cat $ENV{BDDATA}/current`); + +my ($pkg, $pname, $fullpkg, $license, $type); my %allowed_license_values = map {$_, 1} ( @@ -32,28 +37,46 @@ ); -open(EXCLUDES, ">excludes") or die "can't write excludes\n"; -open(EXCLUDESLOG, ">excludes.log") or die "can't write excludes.log\n"; +open(EXCLUDES, ">>$ENV{BDDATA}/excludes-${release}") or die "can't write excludes-${release}\n"; +open(EXCLUDESLOG, ">>$ENV{BDDATA}/excludes-${release}.log") or die "can't write excludes-${release}.log\n"; -foreach $pname (@ARGV) { -#$pname = shift; -#$package = Fink::Package->package_by_name($pname); -$package = Fink::PkgVersion->match_package($pname); -#print "$package\n"; -if (not $license = $package->param("License")) { - if ($package->{_type} eq "bundle") { - $license = "Bundle"; - } else { - $license = "No license"; +foreach $pkg (@ARGV) { + + if ($pkg =~ /\.info$/) { # We're parsing an info file for license information + my $phash = &Fink::Services::read_properties($pkg); + $pname = $phash->{package}; + $type = $phash->{type}; + $license = $phash->{license}; + chomp($fullpkg = `basename $pkg .info`); + + } else { # We just got the package name, thus ask Fink about it + my $package = Fink::PkgVersion->match_package($pkg); + $pname = $package->{_name}; + $type = $package->{_type}; + $license = $package->param("License"); + $fullpkg = $pname."-".$package->{_fullversion}; } -} -print "$pname: $license\n"; -if (not $allowed_license_values{$license}) { - print EXCLUDESLOG "$pname: $license\n"; - print EXCLUDES "$pname\n"; -} + if (not $license) { + if ($type eq "bundle") { + $license = "Bundle"; + } else { + $license = "No license"; + } + } + print "$pname: $license"; + if (not $allowed_license_values{$license}) { + if ( -r "$ENV{BDDATA}/includes-${release}" && + `grep -c ${pname} "$ENV{BDDATA}/includes-${release}"`>0) { + print " (overridden)"; + } else { + print EXCLUDESLOG "$pname: $license\n"; + print EXCLUDES "$fullpkg.*\n"; + print " (forbidden)"; + } + } + print "\n"; } -close(EXCLUDES) or die "can't write excludes\n"; -close(EXCLUDESLOG) or die "can't write excludes.log\n"; +close(EXCLUDES) or die "can't write excludes-${release}\n"; +close(EXCLUDESLOG) or die "can't write excludes-${release}.log\n"; ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Fink-commits mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/fink-commits