Subversion Repositories DevTools

Rev

Rev 7311 | Rev 7319 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7311 Rev 7312
Line 1956... Line 1956...
1956
    Debug( "Name:      $name" );
1956
    Debug( "Name:      $name" );
1957
    Debug( "Version:   $version" );
1957
    Debug( "Version:   $version" );
1958
 
1958
 
1959
    DataDirective("LinkPkgArchive");            # This directive allowed here
1959
    DataDirective("LinkPkgArchive");            # This directive allowed here
1960
 
1960
 
1961
    if ( $IgnorePkgs )
1961
#   if ( $IgnorePkgs )
1962
    {
1962
#   {
1963
        Log( "LinkPkgArchive .. $name ($version) - Ignored" );
1963
#       Log( "LinkPkgArchive .. $name ($version) - Ignored" );
1964
        return;
1964
#       return;
1965
    }
1965
#   }
1966
 
1966
 
1967
    #
1967
    #
1968
    #   Ensure that we have do not have multiple definitions
1968
    #   Ensure that we have do not have multiple definitions
1969
    #
1969
    #
1970
    if ( PackageEntry::Exists( $name, $version ) )
1970
    if ( PackageEntry::Exists( $name, $version ) )
Line 2229... Line 2229...
2229
    $ifaceDir = TagFileRead($ifaceDir);
2229
    $ifaceDir = TagFileRead($ifaceDir);
2230
    $ifaceDir =~ s~\\~/~g;
2230
    $ifaceDir =~ s~\\~/~g;
2231
    $ifaceDir =~ s~GBE_SANDBOX/~$::GBE_SANDBOX/~;
2231
    $ifaceDir =~ s~GBE_SANDBOX/~$::GBE_SANDBOX/~;
2232
    my $pkgSigFile = catfile( $ifaceDir, 'Package.sig');
2232
    my $pkgSigFile = catfile( $ifaceDir, 'Package.sig');
2233
 
2233
 
-
 
2234
    # Temp: Remove when we no longer have package-versions
2234
    return unless -f $pkgSigFile; 
2235
    return unless -f $pkgSigFile; 
2235
 
2236
 
2236
    Error("Package signature not found for $name/$version", "You must 'build' the package before using it")
2237
    Error("Package signature not found for $name/$version", "You must 'build' the package before using it")
2237
        unless ( -f $pkgSigFile);
2238
        unless ( -f $pkgSigFile);
2238
    $pkgSig = TagFileRead($pkgSigFile);
2239
    $pkgSig = TagFileRead($pkgSigFile);
Line 2350... Line 2351...
2350
 
2351
 
2351
    #
2352
    #
2352
    #   Package not found
2353
    #   Package not found
2353
    #   This is an error, although it can be bypassed
2354
    #   This is an error, although it can be bypassed
2354
    #
2355
    #
2355
    #Error ("Required package not found by signature: '$name/$version'" ) unless ( $NoPackageError );
2356
    Error ("Required package not found by signature: '$name/$version'" ) unless ( $NoPackageError );
2356
    #
2357
    
2357
    #Log( "WARNING .... Package not available: '$name/$version'" );
2358
    Log( "WARNING .... Package not available: '$name/$version'" );
2358
    return;
2359
    return;
2359
}
2360
}
2360
 
2361
 
2361
#-------------------------------------------------------------------------------
2362
#-------------------------------------------------------------------------------
2362
# Function        : LinkEntry
2363
# Function        : LinkEntry
Line 2489... Line 2490...
2489
    Debug( "Name:      $name" );
2490
    Debug( "Name:      $name" );
2490
    Debug( "Version:   $version" );
2491
    Debug( "Version:   $version" );
2491
 
2492
 
2492
    DataDirective("BuildPkgArchive");           # This directive allowed here
2493
    DataDirective("BuildPkgArchive");           # This directive allowed here
2493
 
2494
 
2494
    if ( $IgnorePkgs )
2495
#   if ( $IgnorePkgs )
2495
    {
2496
#   {
2496
        Log( "BuildPkgArchive . $name ($version) - Ignored" );
2497
#       Log( "BuildPkgArchive . $name ($version) - Ignored" );
2497
        return;
2498
#       return;
2498
    }
2499
#   }
2499
    
2500
    
2500
    #
2501
    #
2501
    #   Ensure that we have do not have multiple definitions
2502
    #   Ensure that we have do not have multiple definitions
2502
    #
2503
    #
2503
    if ( PackageEntry::Exists( $name, $version ) )
2504
    if ( PackageEntry::Exists( $name, $version ) )
Line 3968... Line 3969...
3968
 
3969
 
3969
    if ($gitEnabled)
3970
    if ($gitEnabled)
3970
    {
3971
    {
3971
        #
3972
        #
3972
        #   Include the sha1 of all 'git' tree items that form the complete source image
3973
        #   Include the sha1 of all 'git' tree items that form the complete source image
-
 
3974
        #   Warn user if not all components are version controlled
3973
        #
3975
        #
3974
        my @relDirList = map { my $relName = $_; $relName =~ s~^$::GBE_SANDBOX/~~; $relName  } ToolsetFiles::GetSubTrees(); 
3976
        my @relDirList = map { my $relName = $_; $relName =~ s~^$::GBE_SANDBOX/~~; $relName  } ToolsetFiles::GetSubTrees(); 
3975
        my @cmdList = map { 'HEAD:' . $_  } @relDirList;
3977
        my @cmdList = map { 'HEAD:' . $_  } @relDirList;
3976
Debug0(" GIT DIR: @relDirList" );
-
 
3977
Debug0(" GIT CMD: " . "git rev-parse @cmdList" );
3978
        Debug3(" GIT CMD: " . "git rev-parse", @cmdList );
3978
        my $index = 0;
-
 
3979
 
3979
 
-
 
3980
        #
-
 
3981
        #   Callback function to process the output of the Git parse
-
 
3982
        #   Expect one line for each HEAD: item
-
 
3983
        #
-
 
3984
        my $index = 0;
-
 
3985
        my @notControlled;
3980
        my $callback = sub {
3986
        my $callback = sub {
3981
            my ($cdata, $line) = @_;
3987
            my ($cdata, $line) = @_;
3982
            $line =~ s~\s+$~~;
3988
            $line =~ s~\s+$~~;
3983
Debug0(" GIT OUT: " . $line  );
3989
            Debug3(" GIT OUT: " . $line  );
-
 
3990
            if ($line =~ m~^HEAD:(.*)~) {
-
 
3991
                push @notControlled, $1;
-
 
3992
            }
3984
            $BuildSignatureSha1->add($line);
3993
            $BuildSignatureSha1->add($line);
3985
            push @sigList, "PKGSRC: $relDirList[$index++]: $line: " . $BuildSignatureSha1->clone->hexdigest;
3994
            push @sigList, "PKGSRC: $relDirList[$index++]: $line: " . $BuildSignatureSha1->clone->hexdigest;
3986
            return 0;
3995
            return 0;
3987
        };
3996
        };
3988
 
3997
 
3989
        GitCmd('rev-parse', @cmdList, { process => $callback } );
3998
        my $rv = GitCmd('rev-parse', @cmdList, { process => $callback } );
-
 
3999
        Debug2("GitCmd Result: $rv");
3990
        $BUILDSIGNATURE =  $BuildSignatureSha1->hexdigest;
4000
        $BUILDSIGNATURE =  $BuildSignatureSha1->hexdigest;
-
 
4001
 
-
 
4002
        if (@notControlled) {
-
 
4003
            Warning('The folling paths are not version controlled:', @notControlled);
-
 
4004
        }
3991
    }
4005
    }
3992
    else
4006
    else
3993
    {
4007
    {
3994
        $BUILDSIGNATURE = 'MSG: Sandbox is not git enabled';
4008
        $BUILDSIGNATURE = 'MSG: Sandbox is not git enabled';
3995
    }
4009
    }
Line 3999... Line 4013...
3999
    FileCreate( $signatureFile, $BUILDSIGNATURE );
4013
    FileCreate( $signatureFile, $BUILDSIGNATURE );
4000
    FileCreate( $sigDebugFile, @sigList );
4014
    FileCreate( $sigDebugFile, @sigList );
4001
Debug0("sigDebugFile: $sigDebugFile");
4015
Debug0("sigDebugFile: $sigDebugFile");
4002
 
4016
 
4003
    #
4017
    #
-
 
4018
    #   See if the package exists in one of the package stores
-
 
4019
    #   Look in each package archive directory
-
 
4020
    #   
-
 
4021
    foreach my $dpkg ( $::GBE_DPKG_SBOX,
-
 
4022
                       $::GBE_DPKG_LOCAL,
-
 
4023
                       $::GBE_DPKG_CACHE,
-
 
4024
                       $::GBE_DPKG_REPLICA,
-
 
4025
                       $::GBE_DPKG,
-
 
4026
                       $::GBE_DPLY,
-
 
4027
                       $::GBE_DPKG_STORE )
-
 
4028
    {
-
 
4029
        my $pkgDir = catdir( $dpkg, $BUILDNAME_PACKAGE . $BUILDNAME_SUFFIX, $BUILDSIGNATURE);
-
 
4030
        if (-d $pkgDir ) {
-
 
4031
            Message("PreBuild: $pkgDir");
-
 
4032
            last;
-
 
4033
        }
-
 
4034
    }
-
 
4035
 
-
 
4036
    #
4004
    #   Create the descpkg file - to include the signature
4037
    #   Create the descpkg file - to include the signature
4005
    #
4038
    #
4006
    BuildDescpkg('Internal');
4039
    BuildDescpkg('Internal');
4007
}
4040
}
4008
 
4041
 
4009
#-------------------------------------------------------------------------------
4042
#-------------------------------------------------------------------------------
4010
# Function        : GitCmd
4043
# Function        : GitCmd
4011
#
4044
#
4012
# Description     : Run a Git Command and capture/process the output
4045
# Description     : Run a Git Command and capture/process the output
4013
#
4046
#
4014
#                   Based on JatsSvnCore:GitCmd
4047
#                   Based on JatsSvnCore:SvnCmd
4015
#
4048
#
4016
# Inputs          : Command
4049
# Inputs          : Command
4017
#                   Command arguments
4050
#                   Command arguments
4018
#                   Last argument may be a hash of options.
4051
#                   Last argument may be a hash of options.
4019
#                       nosavedata  - Don't save the data
4052
#                       nosavedata  - Don't save the data
Line 4095... Line 4128...
4095
    #   Monitor the output from the utility
4128
    #   Monitor the output from the utility
4096
    #   Have used stdmux to multiplex stdout and stderr
4129
    #   Have used stdmux to multiplex stdout and stderr
4097
    #
4130
    #
4098
    #   Note: IO::Select doesn't work on Windows :(
4131
    #   Note: IO::Select doesn't work on Windows :(
4099
    #   Note: Open3 will cause blocking unless both streams are read
4132
    #   Note: Open3 will cause blocking unless both streams are read
4100
    #         Can read both streams becsue IO::Select doesn't work
4133
    #         Can't read both streams because IO::Select doesn't work
4101
    #
4134
    #
4102
    #   Observation:
4135
    #   Observation:
4103
    #       svn puts errors to STDERR
4136
    #       svn puts errors to STDERR
4104
    #       svn puts status to STDOUT
4137
    #       svn puts status to STDOUT
4105
    #
4138
    #