Subversion Repositories DevTools

Rev

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

Rev 4688 Rev 4969
Line 602... Line 602...
602
#
602
#
603
# Description:
603
# Description:
604
#     This subroutine is used to create the dpkg_archive in the $DPKG_ROOT
604
#     This subroutine is used to create the dpkg_archive in the $DPKG_ROOT
605
#     location 
605
#     location 
606
#
606
#
607
#     We use the global DPKG_DIR, DPKG_NAME, and DPKG_VERSION
607
#     We use the global DPKG_ROOT, DPKG_DIR, DPKG_NAME, and DPKG_VERSION
608
#     to create the required directory structure.
608
#     to create the required directory structure.
609
#
609
#
610
#     If the dpkg_archive is new (ie not a new version) it is assumed the user
610
#     If the dpkg_archive is new (ie not a new version) it is assumed the user
611
#     has access to create the top level dir for the new dpkg_archive.
611
#     has access to create the top level dir for the new dpkg_archive.
612
#
612
#
Line 648... Line 648...
648
        }
648
        }
649
    }
649
    }
650
    Information("");
650
    Information("");
651
 
651
 
652
    #
652
    #
-
 
653
    #   Create a file handle based in the Repository Root to allow
-
 
654
    #   locking while we create the package directory
-
 
655
    #   Note: Windows can't do a flock on a directory handle
-
 
656
    #         so we must create a file
-
 
657
    #
-
 
658
    my $dirLockfile = "$DPKG_ROOT/lockfile";
-
 
659
    Verbose ("Aquiring archive lock");
-
 
660
    open (ARCHIVE_LOCK, '>', $dirLockfile) || Error ("Cannot open archive root for locking: $!", $dirLockfile );
-
 
661
    flock ARCHIVE_LOCK, 2;
-
 
662
 
-
 
663
    #
653
    #   Create the top level directory
664
    #   Create the top level directory
654
    #
665
    #
655
    mkpath($DPKG_DIR, 0, 0775);
666
    mkpath($DPKG_DIR, 0, 0775);
656
 
667
 
657
    #
668
    #
-
 
669
    #   Release the lock that we have in the target file system
-
 
670
    #   Create a lock on the package version directory
-
 
671
    #   This allows others to create new package versions
-
 
672
    #
-
 
673
    Verbose ("Releasing archive lock");
-
 
674
    close ARCHIVE_LOCK;
-
 
675
    unlink $dirLockfile;
-
 
676
 
-
 
677
    my $pkgLockfile = "$DPKG_DIR/lockfile";
-
 
678
    Verbose ("Aquiring packageVersion lock");
-
 
679
    open (ARCHIVE_LOCK, '>', $pkgLockfile) || Error ("Cannot open package directory for locking: $!", $pkgLockfile );
-
 
680
    flock ARCHIVE_LOCK, 2;
-
 
681
 
-
 
682
    #
658
    #   Transfer source directory, unless this is a noBuild
683
    #   Transfer source directory, unless this is a noBuild
659
    #
684
    #
660
    if ( $SRC_ROOT ne '' )
685
    if ( $SRC_ROOT ne '' )
661
    {
686
    {
662
        # Process the files
687
        # Process the files
Line 715... Line 740...
715
    {
740
    {
716
        LogFileOp("Removing Link",$link_file);
741
        LogFileOp("Removing Link",$link_file);
717
        unlink $link_file;
742
        unlink $link_file;
718
    }
743
    }
719
 
744
 
-
 
745
    #
-
 
746
    #   Release the file lock
-
 
747
    #
-
 
748
    Verbose ("Releasing packageVersion lock");
-
 
749
    close ARCHIVE_LOCK;
-
 
750
    unlink $pkgLockfile;
720
    return 1;
751
    return 1;
721
}
752
}
722
 
753
 
723
 
754
 
724
#------------------------------------------------------------------------------
755
#------------------------------------------------------------------------------