Update of /cvsroot/fink/experimental/todai/ecc/main/finkinfo/base
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21696

Added Files:
        bbfink.info bbfink.patch 
Log Message:
New package: bbfink.

--- NEW FILE: bbfink.patch ---
diff -Naur fink-0.24.12.orig/README.bbfink fink-0.24.12/README.bbfink
--- fink-0.24.12.orig/README.bbfink     Thu Jan  1 00:00:00 1970
+++ fink-0.24.12/README.bbfink  Wed Mar  8 18:06:45 2006
@@ -0,0 +1,18 @@
+The bbfink package is slightly modified version of Fink package manager.
+This is intended to help you to run a pakcage build server.
+
+Changes from original fink:
+
+* Add X-Buildbox-License field into .deb's control.
+
+* "bbfink scanpackages" generates Packages databases which do not contain
+  Restrictive nor Commercial packages.
+
+* "bbfink scanpackages" does not breaks Packages.gz for a long time but
+  once saves each package databases as Packages.gz.tmp and then renames
+  it to Packages.gz.
+
+* When bbfink failed to lock a file because of NFS, bbfink silently
+  ignores the error.
+
+* Don't forget -y option when fink is re-executed in selfupdating.
diff -Naur fink-0.24.12.orig/VERSION fink-0.24.12/VERSION
--- fink-0.24.12.orig/VERSION   Tue Feb 21 20:44:49 2006
+++ fink-0.24.12/VERSION        Wed Mar  8 17:27:11 2006
@@ -1 +1 @@
-0.24.12
+0.24.12.cvs20060308
diff -Naur fink-0.24.12.orig/bbfink-build.sh fink-0.24.12/bbfink-build.sh
--- fink-0.24.12.orig/bbfink-build.sh   Thu Jan  1 00:00:00 1970
+++ fink-0.24.12/bbfink-build.sh        Wed Mar  8 17:59:06 2006
@@ -0,0 +1,96 @@
+#! /bin/sh
+# vim: set sw=4 sts=4 ts=8 et:
+
+set -e
+
+usage() {
+    cat << EOF
+Usage: ./bbfink-build.sh [-nqdh] [var=value] ... build <prefix>
+       ./bbfink-build.sh [-nqdh] [var=value] ... install <prefix>
+       ./bbfink-build.sh [-nqdh] [var=value] ... clean
+EOF
+}
+
+badarg() {
+    usage >&2
+    exit 2
+}
+
+go() {
+    $show "$@"
+    $run "$@"
+}
+
+go_sed() {
+    src=$1 dst=$2; shift; shift
+    $show sed "$@" \< "$src" \> "$dst"
+    $run sed "$@" < "$src" > "$dst"
+}
+
+mode_build() {
+    version=`cat VERSION`
+
+    go_sed fink.in fink "s|@BASEPATH@|$prefix|g"
+    go_sed perlmod/Fink/FinkVersion.pm.in perlmod/Fink/FinkVersion.pm 
"s|@VERSION@|$version|g;s|@BASEPATH@|$prefix|g"
+    go_sed lockwait.in dpkg-lockwait "s|@PREFIX@|$prefix|g;s|@PROG@|dpkg|g"
+    go_sed lockwait.in apt-get-lockwait 
"s|@PREFIX@|$prefix|g;s|@PROG@|apt-get|g"
+}
+
+mode_install() {
+    umask 022
+    instdir=$DESTDIR$prefix
+    finkinst=$instdir/lib/buildbox/perl5/Fink
+
+    go mkdir -m 755 -p "$instdir/lib/buildbox/bin"
+    go $INSTALL -m 755 fink dpkg-lockwait apt-get-lockwait skip-restrictive 
"$instdir/lib/buildbox/bin"
+    go mkdir -m 755 -p "$instdir/bin"
+    go rm -f "$instdir/bin/bbfink"
+    go ln -s ../lib/buildbox/bin/fink "$instdir/bin/bbfink"
+    go mkdir -m 755 -p "$instdir/share/doc/bbfink"
+    go $INSTALL -m 644 AUTHORS COPYING README.bbfink 
"$instdir/share/doc/bbfink"
+
+    go mkdir -m 755 -p "$finkinst"
+    go $INSTALL -m 644 perlmod/Fink/*.pm "$finkinst"
+    for dir in Text Notify; do
+        go mkdir -m 755 -p "$finkinst/$dir"
+        go $INSTALL -m 644 perlmod/Fink/$dir/*.pm "$finkinst/$dir"
+    done
+}
+
+mode_clean() {
+    go rm -f fink perlmod/Fink/FinkVersion.pm dpkg-lockwait apt-get-lockwait
+}
+
+# Variables which can be overridden
+show=echo
+run=
+: ${DESTDIR=''}
+: ${INSTALL='install -c'}
+
+while test $# -gt 0; do
+    arg=$1; shift
+    case $arg in
+        [A-Za-z0-9_]*=*)
+        var=`expr "$arg" : '\\([^=]*\\)='`
+        val=`echo "$arg" | sed "s/^[^=]*=//;s/'/'\\\\\\\\''/g"`
+        eval "$var='$val'"
+        ;;
+        -n|--dry-run) run=: ;;
+        -q|--quiet) show=: ;;
+        -d|--debug) set -x;;
+        -h|-help|--help) usage; exit 0;;
+        *) mode=$arg; break;;
+    esac
+done
+case $mode in
+    help) usage; exit 0;;
+    build|install)
+    case $1 in
+        /*) prefix=$1;;
+        *) badarg;;
+    esac
+    eval "mode_$mode"
+    ;;
+    clean) eval "mode_$mode";;
+    *) badarg;;
+esac
diff -Naur fink-0.24.12.orig/fink.in fink-0.24.12/fink.in
--- fink-0.24.12.orig/fink.in   Tue Jan  3 20:14:47 2006
+++ fink-0.24.12/fink.in        Wed Mar  8 18:10:24 2006
@@ -24,7 +24,7 @@
 require 5.006;  # perl 5.6.0 or newer required
 use strict;
 
-use lib "@BASEPATH@/lib/perl5";
+use lib "@BASEPATH@/lib/buildbox/perl5";
 my $basepath = '@BASEPATH@';
 
 ### parse options passed on the command line
@@ -69,6 +69,7 @@
   require Fink::FinkVersion;
   print "Package manager version: ".Fink::FinkVersion::fink_version()."\n";
   print "Distribution version: 
".Fink::FinkVersion::distribution_version()."\n";
+  print "This is bbfink, a modified package manager.\n";
   print <<"EOF";
 
 Copyright (c) 2001 Christoph Pfisterer
@@ -156,6 +157,7 @@
 
 # set PATH so we find dpkg and *-config scripts
 $ENV{PATH} = 
"$basepath/sbin:$basepath/bin:/usr/sbin:/sbin:/usr/X11R6/bin:".$ENV{PATH};
+$ENV{PATH} = 
"$basepath/lib/buildbox/sbin:$basepath/lib/buildbox/bin:".$ENV{PATH};
 
 # get rid of CDPATH
 delete $ENV{CDPATH};
diff -Naur fink-0.24.12.orig/lockwait.in fink-0.24.12/lockwait.in
--- fink-0.24.12.orig/lockwait.in       Thu Nov 10 02:51:17 2005
+++ fink-0.24.12/lockwait.in    Wed Mar  8 17:27:11 2006
@@ -30,7 +30,9 @@
        #       short   l_whence;   /* type of l_start */
        #   };
        my $struct_flock = pack("lllliss", (0, 0), (0, 0), 0, F_WRLCK, 
SEEK_SET);
-       unless (fcntl(LOCK, F_SETLK, $struct_flock)) {
+       my $lock_ok = fcntl(LOCK, F_SETLK, $struct_flock);
+       # XXX: Do nothing if flock is not supported on the filesystem.
+       unless ($lock_ok || $! == EOPNOTSUPP || $! == ENOLCK) {
                die "lockwait: Can't get lock: $!" unless $! == EAGAIN || $! == 
EACCES;
                
                my $msg = $timeout ? "up to $timeout seconds " : "";
@@ -50,7 +52,8 @@
                }
                print STDERR "done.\n";
        }
-       print STDERR "Got the lock\n" if $debug;
+       print STDERR "Got the lock\n" if $debug && $lock_ok;
+       print STDERR "No lock is available on this filesystem\n" if $debug && 
!$lock_ok;
        
        print STDERR "Clear close-on-exec, so exec'ed process gets the lock\n"
                if $debug;
diff -Naur fink-0.24.12.orig/perlmod/Fink/ChangeLog 
fink-0.24.12/perlmod/Fink/ChangeLog
--- fink-0.24.12.orig/perlmod/Fink/ChangeLog    Mon Feb 20 22:20:08 2006
+++ fink-0.24.12/perlmod/Fink/ChangeLog Wed Mar  8 17:27:11 2006
@@ -1,3 +1,25 @@
+2006-03-06  Daniel Macks  <[EMAIL PROTECTED]>
+
+       * Validation.pm: Fix *SetPATH handler
+
+2006-03-06  Daniel Macks  <[EMAIL PROTECTED]>
+
+       * SelfUpdate.pm: Check for dev-tools using VirtPackage directly
+       instead of using the full Package/PkgVersion database API.
+
+2006-03-03  Daniel Macks  <[EMAIL PROTECTED]>
+
+       * Validation.pm: Add missing function import
+
+
+2006-02-23  Benjamin Reed  <[EMAIL PROTECTED]>
+
+       * VirtPackage.pm: Use the gcc build number for the revision if
+       possible; also make sure tests are using /usr/bin/gcc rather than
+       some random gcc in the path (should speed things up a little if
+       ccache or distcc are hanging around)
+       (backport)
+
 2006-02-20  Dave Morrison  <[EMAIL PROTECTED]>
 
        * Configure.pm:  Add a list of existing binary distributions to the
@@ -26,6 +48,13 @@
 
        * Package.pm, Validation.pm: Consider .info Architecture field
        case-insensitively.
+
+2006-01-25  Benjamin Reed  <[EMAIL PROTECTED]>
+
+       * VirtPackage.pm: added a check to gcc to determine if the gcc
+       binary being interrogated is capable of targetting the host on
+       which it is being run.
+       (backport)
 
 2006-01-24  Daniel Macks  <[EMAIL PROTECTED]>
 
diff -Naur fink-0.24.12.orig/perlmod/Fink/Engine.pm 
fink-0.24.12/perlmod/Fink/Engine.pm
--- fink-0.24.12.orig/perlmod/Fink/Engine.pm    Fri Jan 13 03:25:00 2006
+++ fink-0.24.12/perlmod/Fink/Engine.pm Wed Mar  8 18:23:29 2006
@@ -275,7 +275,7 @@
 
        $method = $config->param_default("RootMethod", "sudo");
 
-       $cmd = "$basepath/bin/fink";
+       $cmd = "$basepath/lib/buildbox/bin/fink";
 
        foreach $arg (@_) {
                if ($arg =~ /^[A-Za-z0-9_.+-]+$/) {
@@ -630,11 +630,13 @@
                                die "can't create directory $treedir\n";
                }
 
-               $cmd = "dpkg-scanpackages $treedir override | gzip 
>$treedir/Packages.gz";
+               $cmd = "dpkg-scanpackages $treedir override | skip-restrictive 
| gzip >$treedir/Packages.gz.tmp";
                if (&execute($cmd)) {
-                       unlink("$treedir/Packages.gz");
+                       unlink("$treedir/Packages.gz.tmp");
                        die "package scan failed in $treedir\n";
                }
+               unlink("$treedir/Packages.gz.tmp");
+               rename("$treedir/Packages.gz.tmp", "$treedir/Packages.gz");
 
                open(RELEASE,">$treedir/Release") or die "can't write Release 
file: $!\n";
                print RELEASE <<EOF;
diff -Naur fink-0.24.12.orig/perlmod/Fink/Package.pm 
fink-0.24.12/perlmod/Fink/Package.pm
--- fink-0.24.12.orig/perlmod/Fink/Package.pm   Wed Feb  8 03:23:09 2006
+++ fink-0.24.12/perlmod/Fink/Package.pm        Wed Mar  8 17:27:11 2006
@@ -31,6 +31,8 @@
 use Fink::PkgVersion;
 use Fink::FinkVersion;
 use File::Find;
+use POSIX qw(:errno_h);
+use Fcntl qw(:flock);
 
 use strict;
 use warnings;
@@ -479,7 +481,8 @@
                        
                        # If the index is not outdated, we can use it, and thus 
save a lot of time
                        if (not $db_outdated) {
-                               $packages = Storable::lock_retrieve($dbfile);
+                               # No need to lock in reading
+                               $packages = Storable::retrieve($dbfile);
                        }
                }
        }
@@ -597,7 +600,8 @@
                                sleep $wait;
                                if (! -f $lockfile) {
                                        print STDERR " done.\n";
-                                       $packages = 
Storable::lock_retrieve($dbfile);
+                                       # No need to lock in reading
+                                       $packages = Storable::retrieve($dbfile);
                                        $db_outdated = 0;
                                        return;
                                }
@@ -628,7 +632,14 @@
                        mkdir($dbdir, 0755) || die "Error: Could not create 
directory $dbdir: $!\n";
                }
 
-               Storable::lock_store ($packages, "$dbfile.tmp");
+                open(TMP_FILE, ">>$dbfile.tmp") || die "Error: Could not write 
temporary file $dbfile.tmp: $!\n";
+               my $lock_ok = flock(TMP_FILE, LOCK_EX);
+               # XXX: Do nothing if flock is not supported on the filesystem.
+               die "Error: Could not lock temporary file $dbfile.tmp: $!\n"
+                   unless ($lock_ok || $! == EOPNOTSUPP || $! == ENOLCK);
+               my $store_ok = Storable::store ($packages, "$dbfile.tmp");
+               close(TMP_FILE);
+               die "Error: Could not write temporary file $dbfile.tmp: $!\n" 
unless $store_ok;
                rename "$dbfile.tmp", $dbfile or die "Error: could not activate 
temporary file $dbfile.tmp: $!\n";
                print STDERR "done.\n";
        };
diff -Naur fink-0.24.12.orig/perlmod/Fink/PkgVersion.pm 
fink-0.24.12/perlmod/Fink/PkgVersion.pm
--- fink-0.24.12.orig/perlmod/Fink/PkgVersion.pm        Mon Feb 20 17:29:28 2006
+++ fink-0.24.12/perlmod/Fink/PkgVersion.pm     Wed Mar  8 18:15:05 2006
@@ -2602,6 +2602,9 @@
        if ($self->param_boolean("Essential")) {
                $control .= "Essential: yes\n";
        }
+       if ($self->has_param("license")) {
+               $control .= "X-Buildbox-License: " . $self->param("license") . 
"\n";
+       }
 
        eval {
                require File::Find;
diff -Naur fink-0.24.12.orig/perlmod/Fink/SelfUpdate.pm 
fink-0.24.12/perlmod/Fink/SelfUpdate.pm
--- fink-0.24.12.orig/perlmod/Fink/SelfUpdate.pm        Tue Jan 24 16:44:46 2006
+++ fink-0.24.12/perlmod/Fink/SelfUpdate.pm     Wed Mar  8 18:05:43 2006
@@ -201,9 +201,7 @@
        my $method = shift;
 
        if ($method eq 'cvs' || $method eq 'rsync') {
-               Fink::Package->require_packages();
-               my $po = Fink::PkgVersion->match_package('dev-tools');
-               defined $po && $po->is_installed()
+               Fink::VirtPackage->query_package("dev-tools")
                        or die "selfupdate method '$method' requires the 
package 'dev-tools'\n";
        }
 }
@@ -551,7 +549,11 @@
        
                # re-execute ourselves before we update the rest
                print "Re-executing fink to use the new version...\n";
-               exec "$basepath/bin/fink selfupdate-finish";
+               my $finkcmd = "$basepath/lib/buildbox/bin/fink";
+               if (Fink::Config::get_option("dontask")) {
+                       $finkcmd .= " -y";
+               }
+               exec "$finkcmd selfupdate-finish";
        
                # the exec doesn't return, but just in case...
                die "re-executing fink failed, run 'fink selfupdate-finish' 
manually\n";
diff -Naur fink-0.24.12.orig/perlmod/Fink/Validation.pm 
fink-0.24.12/perlmod/Fink/Validation.pm
--- fink-0.24.12.orig/perlmod/Fink/Validation.pm        Wed Feb  8 03:23:09 2006
+++ fink-0.24.12/perlmod/Fink/Validation.pm     Wed Mar  8 17:27:11 2006
@@ -23,7 +23,7 @@
 
 package Fink::Validation;
 
-use Fink::Services qw(&read_properties &read_properties_var &expand_percent 
&get_arch);
+use Fink::Services qw(&read_properties &read_properties_var &expand_percent 
&get_arch &pkglist2lol);
 use Fink::Config qw($config);
 
 use strict;
@@ -46,7 +46,7 @@
                cc cflags cpp cppflags cxx cxxflags dyld_library_path
                ld_prebind ld_prebind_allow_overlap ld_force_no_prebind
                ld_seg_addr_table ld ldflags library_path libs
-               macosx_deployment_target make mflags makeflags setpath
+               macosx_deployment_target make mflags makeflags path
        );
 
 # Required fields.
diff -Naur fink-0.24.12.orig/perlmod/Fink/VirtPackage.pm 
fink-0.24.12/perlmod/Fink/VirtPackage.pm
--- fink-0.24.12.orig/perlmod/Fink/VirtPackage.pm       Thu Feb  9 17:52:24 2006
+++ fink-0.24.12/perlmod/Fink/VirtPackage.pm    Wed Mar  8 17:27:11 2006
@@ -40,7 +40,7 @@
 
 package Fink::VirtPackage;
 
-our $VERSION = ( qw$Revision: 1.68.2.15 $ )[-1];
+our $VERSION = ( qw$Revision: 1.68.2.17 $ )[-1];
 
 # Programmers' note: Please be *very* careful if you alter this file.
 # It is used by dpkg via popen(), so (among other things) that means
@@ -623,13 +623,15 @@
        print STDERR "- checking for various GCC versions:\n" if 
($options{debug});
        if (opendir(DIR, "/usr/bin")) {
                for my $gcc (grep(/^gcc/, readdir(DIR))) {
-                       if (open(GCC, $gcc . ' --version 2>&1 |')) {
+                       next if (-l "/usr/bin/$gcc");
+                       if (open(GCC, '/usr/bin/' . $gcc . ' --version 
2>/dev/null |')) {
                                my $version = <GCC>;
                                close(GCC);
                                if( ! defined $version ) {
                                        next;
                                }
                                chomp($version);
+                               my ($build) = $version =~ /build (\d+)/i;
                                if ($version =~ /^([\d\.]+)$/ or $version =~ 
/^.*? \(GCC\) ([\d\.\-]+)/) {
                                        $version = $1;
                                        $version =~ s/[\.\-]*$//;
@@ -642,9 +644,19 @@
                                                print STDERR "  - skipping 
$pkgname, there's a real package\n" if ($options{debug});
                                                next;
                                        }
-                                       
-                                       $hash = &gen_gcc_hash($pkgname, 
$version, 0,
-                                               STATUS_PRESENT);
+
+                                       if (open(GCC, '/usr/bin/' . $gcc . ' 
-### -x c /dev/null 2>&1 |')) {
+                                               while (<GCC>) {
+                                                       if 
(/^\s*\"([^\"]+\/cc1)\"/) {
+                                                               if (not -x $1) {
+                                                                       print 
STDERR "  - $gcc is looking for $1 to build on this arch, but it's not there\n" 
if ($options{debug});
+                                                               }
+                                                               last;
+                                                       }
+                                               }
+                                               close(GCC);
+                                       }
+                                       $hash = &gen_gcc_hash($pkgname, 
$version, $build, 0, STATUS_PRESENT);
                                        $self->{$hash->{package}} = $hash;
                                        print STDERR "  - found $version\n" if 
($options{debug});
                                } else {
@@ -667,7 +679,7 @@
                );
                foreach my $key (sort keys %expected_gcc) {
                        if (not exists $self->{$key} && not 
Fink::Status->query_package($key)) {
-                               $hash = &gen_gcc_hash($key, 
$expected_gcc{$key}, 0, STATUS_ABSENT);
+                               $hash = &gen_gcc_hash($key, 
$expected_gcc{$key}, 0, 0, STATUS_ABSENT);
                                $self->{$hash->{package}} = $hash;
                                print STDERR "  - missing 
$expected_gcc{$key}\n" if ($options{debug});
                        }
@@ -1441,7 +1453,7 @@
        }
 }
 
-=item &gen_gcc_hash(I<$package>, I<$version>, I<$is_64bit>, I<$dpkg_status>)
+=item &gen_gcc_hash(I<$package>, I<$version>, I<$build>, I<$is_64bit>, 
I<$dpkg_status>)
 
 Return a ref to a hash representing a gcc* package pdb structure. The
 passed values are will not be altered.
@@ -1451,17 +1463,20 @@
 sub gen_gcc_hash {
        my $package = shift;
        my $version = shift;
+       my $build   = shift;
        my $is_64bit = shift;
        my $status = shift;
        $is_64bit = $is_64bit ? ' 64-bit' : '';
 
+       my $revision = $build;
+       unless (defined $revision and $revision =~ /^\d+$/) {
+               $revision = 0;
+               $revision = 1 if ($status eq STATUS_PRESENT);
+       }
+
        my $return = {
                package          => $package,
-               version          => $version
-                            . ($status eq STATUS_PRESENT
-                                ? '-1'
-                                : '-0'
-                                                         ),
+               version          => $version . '-' . $revision,
                description      => "[virtual package representing the$is_64bit 
gcc $version compiler]",
                homepage         => 
'http://fink.sourceforge.net/faq/comp-general.php#gcc2',
                builddependsonly => 'true',
diff -Naur fink-0.24.12.orig/skip-restrictive fink-0.24.12/skip-restrictive
--- fink-0.24.12.orig/skip-restrictive  Thu Jan  1 00:00:00 1970
+++ fink-0.24.12/skip-restrictive       Wed Mar  8 17:27:11 2006
@@ -0,0 +1,36 @@
+#! /usr/bin/awk -f
+# vim: set sw=4 sts=4 ts=8 et:
+
+# This script reads a Packages database and skips each package whose
+# license is Restrictive or Commercial.
+
+BEGIN {
+    restrictive = 0;
+    FS = "";
+}
+
+/^[^ ]/ {
+    l = tolower($0);
+    if (l ~ /^x-buildbox-license:[ \t]*(restrictive|commercial)[ \t]*$/)
+        restrictive = 1;
+    text = text $0 "\n";
+    next;
+}
+
+/^ / {
+    text = text $0 "\n";
+    next;
+}
+
+/^$/ {
+    if (!restrictive)
+        printf "%s\n", text;
+    text = "";
+    restrictive = 0;
+    next;
+}
+
+END {
+    if (text != "" && !restrictive)
+        printf "%s\n", text;
+}

--- NEW FILE: bbfink.info ---
Package: bbfink
Version: 0.24.12.cvs20060308
Revision: 1
Depends: base-files, fink (>= 0.24.12), fink (<< 0.24.99)
Source: mirror:custom:fink/fink-0.24.12.tar.gz
Source-MD5: 02455b2a6a46af9321038dd26045a620

Patch: %n.patch
CompileScript: sh bbfink-build.sh build %p
InstallScript: sh bbfink-build.sh DESTDIR=%d install %p

Description: Modified package manager for build servers
DescDetail: <<
The bbfink package is slightly modified version of Fink package manager.
This is intended to help you to run a pakcage build server.
Namely, bbfink adds X-Buildbox-License field into .deb's control.
<<
License: GPL
Maintainer: Todai Fink Team <[EMAIL PROTECTED]>

CustomMirror: <<
 Primary: http://west.dl.sourceforge.net/sourceforge/
 nam-US: http://us.dl.sourceforge.net/sourceforge/
 eur: http://eu.dl.sourceforge.net/sourceforge/
<<



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to