Subversion Repositories DevTools

Rev

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

Rev 4003 Rev 4424
Line 62... Line 62...
62
my $DPKG_DIR;
62
my $DPKG_DIR;
63
my $DPKG_ROOT;
63
my $DPKG_ROOT;
64
my $PKG_BASE;
64
my $PKG_BASE;
65
my $e_repository = "";
65
my $e_repository = "";
66
my $bad_merge_count = 0;
66
my $bad_merge_count = 0;
-
 
67
my @bad_symlinks;
67
 
68
 
68
#
69
#
69
#   Option variables
70
#   Option variables
70
#
71
#
71
my $opt_help = 0;
72
my $opt_help = 0;
Line 549... Line 550...
549
        #
550
        #
550
        if ( -d $SRC_ROOT )
551
        if ( -d $SRC_ROOT )
551
        {
552
        {
552
            File::Find::find( \&pkgFind2, $SRC_ROOT );
553
            File::Find::find( \&pkgFind2, $SRC_ROOT );
553
 
554
 
-
 
555
            if (@bad_symlinks)
-
 
556
            {
-
 
557
                my $msg = "Bad Symlinks: " . scalar @bad_symlinks;
-
 
558
                $opt_test ? ReportError($msg, @bad_symlinks) : Warning($msg, @bad_symlinks);
-
 
559
            }
-
 
560
 
554
            if ( $bad_merge_count )
561
            if ( $bad_merge_count )
555
            {
562
            {
556
                my $msg = "Merged files that differ: $bad_merge_count";
563
                my $msg = "Merged files that differ: $bad_merge_count";
557
                $opt_md5 ? Error($msg) : Warning($msg);
564
                $opt_md5 ? ReportError($msg) : Warning($msg);
558
            }
565
            }
-
 
566
            ErrorDoExit();
559
        }
567
        }
560
        else
568
        else
561
        {
569
        {
562
            Error("Failed to find dir [$SRC_ROOT]",
570
            Error("Failed to find dir [$SRC_ROOT]",
563
                  "Check JATS config.");
571
                  "Check JATS config.");
564
        }
572
        }
565
    }
573
    }
566
 
574
 
567
    #
575
    #
568
    #   Transfer of data is complete
576
    #   Transfer of data is complete
569
    #       Deprecated format: ($touchfile0)
-
 
570
    #           Mark the archive with the build type to indicate which parts of
-
 
571
    #           a multi-machine build have been performed
-
 
572
    #       New format
-
 
573
    #           Mark the archive with the build machine to indicate which parts of
577
    #       Mark the archive with the build machine to indicate which parts of
574
    #           a multi-machine build have been performed
578
    #       a multi-machine build have been performed
575
    #
579
    #
576
    my $touchfile = $opt_generic ? "$DPKG_DIR/built.generic" : "$DPKG_DIR/built.$GBE_HOSTNAME";
580
    my $touchfile = $opt_generic ? "$DPKG_DIR/built.generic" : "$DPKG_DIR/built.$GBE_HOSTNAME";
577
    my $touchfile0 = "$DPKG_DIR/built.$GBE_MACHTYPE";
-
 
578
 
581
 
579
    #
582
    #
580
    #   Create a string to be appended to the 'built' file
583
    #   Create a string to be appended to the 'built' file
581
    #   Comma seperated list of (possibly) useful info
584
    #   Comma seperated list of (possibly) useful info
582
    #       Date-Time ( Local and GMT)
585
    #       Date-Time ( Local and GMT)
Line 585... Line 588...
585
    #
588
    #
586
    my $built_info = localtime() ."," . gmtime() . " GMT,$GBE_MACHTYPE,$GBE_HOSTNAME,$USER,$GBE_ABT";
589
    my $built_info = localtime() ."," . gmtime() . " GMT,$GBE_MACHTYPE,$GBE_HOSTNAME,$USER,$GBE_ABT";
587
    LogFileOp("Mark File",$touchfile);
590
    LogFileOp("Mark File",$touchfile);
588
    FileAppend ( $touchfile, $built_info );
591
    FileAppend ( $touchfile, $built_info );
589
 
592
 
590
    # Maintain the old format until the build daemon has been updated
-
 
591
    #
-
 
592
    LogFileOp("Mark File",$touchfile0);
-
 
593
    FileAppend ( $touchfile0, $built_info );
-
 
594
    
-
 
595
    #
593
    #
596
    #   If there is a .lnk file in the archive then remove it now that the
594
    #   If there is a .lnk file in the archive then remove it now that the
597
    #   archive has been transferred. The .lnk files are created in 'local'
595
    #   archive has been transferred. The .lnk files are created in 'local'
598
    #   archives in order to simplify multi-package builds
596
    #   archives in order to simplify multi-package builds
599
    #
597
    #
Line 674... Line 672...
674
                #   Use: Unix libraries are created as two files:
672
                #   Use: Unix libraries are created as two files:
675
                #        lib.xxxx.so -> libxxxx.so.vv.vv.vv
673
                #        lib.xxxx.so -> libxxxx.so.vv.vv.vv
676
                #
674
                #
677
                if ( -l $item )
675
                if ( -l $item )
678
                {
676
                {
-
 
677
                    if (-f $item)
-
 
678
                    {
679
                    LogFileOp("Copying Link", $target);
679
                        LogFileOp("Copying Link", $target);
680
                    my $link = readlink $item;
680
                        my $link = readlink $item;
681
                    Verbose( "Link: $item, $link");
681
                        Verbose( "Link: $item, $link");
682
                    symlink ($link, $target );
682
                        symlink ($link, $target );
683
                    unless ( $link && -l $target )
683
                        unless ( $link && -l $target )
-
 
684
                        {
-
 
685
                            Error("Failed to copy link [$item] to [$target]: $!");
-
 
686
                        }
-
 
687
                    }
-
 
688
                    else
684
                    {
689
                    {
-
 
690
                        # Don't copy broken Symlinks
-
 
691
                        # Perhaps this should be an error - but is will break escrow builds
-
 
692
                        #
685
                        Error("Failed to copy link [$item] to [$target]: $!");
693
                        LogFileOp("Broken SymLink", $target);
-
 
694
                        push @bad_symlinks, substr ( $item, 1+length ($SRC_ROOT) );
686
                    }
695
                    }
687
                }
696
                }
688
                elsif (File::Copy::copy($item, $target))
697
                elsif (File::Copy::copy($item, $target))
689
                {
698
                {
690
                    LogFileOp("Copying File",$target);
699
                    LogFileOp("Copying File",$target);
Line 831... Line 840...
831
    #   There shouldn't be any files in the root directory
840
    #   There shouldn't be any files in the root directory
832
    #   other than the descpkg and incpkg.
841
    #   other than the descpkg and incpkg.
833
    #
842
    #
834
    Warning ("Unexpected files in package root:", @test_root_file)
843
    Warning ("Unexpected files in package root:", @test_root_file)
835
        if ( @test_root_file  );
844
        if ( @test_root_file  );
-
 
845
 
-
 
846
    Error ("Bad symbolic links found:", @bad_symlinks)
-
 
847
            if ( @bad_symlinks );
-
 
848
 
836
}
849
}
837
 
850
 
838
sub pkgFind3
851
sub pkgFind3
839
{
852
{
840
 
853
 
Line 858... Line 871...
858
            unless ((  $_ eq 'descpkg' ) || ( $_ eq 'incpkg' ))
871
            unless ((  $_ eq 'descpkg' ) || ( $_ eq 'incpkg' ))
859
            {
872
            {
860
                push @test_root_file, $_;
873
                push @test_root_file, $_;
861
            }
874
            }
862
        }
875
        }
-
 
876
        if (-l $_ && ! -f $_)
-
 
877
        {
-
 
878
            push @bad_symlinks, substr ( $File::Find::name, 1+length ($SRC_ROOT) );
-
 
879
        }
863
    }
880
    }
864
}
881
}
865
 
882
 
866
# ---------------------------------------------------------
883
# ---------------------------------------------------------
867
# ---------------------------------------------------------
884
# ---------------------------------------------------------