Subversion Repositories DevTools

Rev

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

Rev 4127 Rev 4542
Line 46... Line 46...
46
my $opt_pcount = 0;
46
my $opt_pcount = 0;
47
 
47
 
48
#
48
#
49
#   Globals
49
#   Globals
50
#
50
#
-
 
51
my $progBase;
51
my $RM_DB;
52
my $RM_DB;
52
my $now = time();
53
my $now = time();
53
my $quarantineInstance;
54
my $quarantineInstance;
54
my $logPath;
55
my $logPath;
55
my %pkgPvid;
56
my %pkgPvid;
Line 69... Line 70...
69
    'retainNoRm'    => '31',
70
    'retainNoRm'    => '31',
70
    'quarantine'    => '/export/devl/quarantine',
71
    'quarantine'    => '/export/devl/quarantine',
71
    'dpkg_archive'  => '/export/devl/dpkg_archive',
72
    'dpkg_archive'  => '/export/devl/dpkg_archive',
72
    'logBase'       => '/export/devl/dpkg_archive/.dpkg_archive/quarantinelog',
73
    'logBase'       => '/export/devl/dpkg_archive/.dpkg_archive/quarantinelog',
73
    'verbose'       => '0',
74
    'verbose'       => '0',
-
 
75
    'S3Bucket'      => 'auawsaddp001',
-
 
76
    'S3Key'         => 'Mandatory',
-
 
77
    'S3Secret'      => 'Mandatory',
74
    );
78
    );
75
 
79
 
76
# List of packages to be retained
80
# List of packages to be retained
77
# May be supplemented by xxx.cnf file
81
# May be supplemented by xxx.cnf file
78
my %retainPkgs = (
82
my %retainPkgs = (
Line 119... Line 123...
119
#   Needs to run as root so that packages can be moved no matter what the
123
#   Needs to run as root so that packages can be moved no matter what the
120
#   file permissions are
124
#   file permissions are
121
#
125
#
122
Warning( "Not running as root") if ( $> );
126
Warning( "Not running as root") if ( $> );
123
 
127
 
-
 
128
#
-
 
129
#   Determine the base of this program
-
 
130
#   Will be used to find config and local utils
-
 
131
#
-
 
132
$progBase = $0;
-
 
133
$progBase =~ s~/[^/]+$~~;
-
 
134
Verbose("ProgBase: $0: $progBase");
-
 
135
 
124
#   Read config file
136
#   Read config file
125
#   Use max of user verbosity or config verbosity
137
#   Use max of user verbosity or config verbosity
126
#
138
#
127
ReadConfig();
139
ReadConfig();
128
if ( $config{verbose} > $opt_verbose )
140
if ( $config{verbose} > $opt_verbose )
Line 916... Line 928...
916
           $tpath = $quarantineInstance.$tpath;
928
           $tpath = $quarantineInstance.$tpath;
917
        my $tdir = dirname ( $tpath );
929
        my $tdir = dirname ( $tpath );
918
 
930
 
919
        unless ( $opt_test )
931
        unless ( $opt_test )
920
        {
932
        {
-
 
933
            #
-
 
934
            #   Transfer to Amazon S3 storage first
-
 
935
            #   The transfer is done via an external program (script)
-
 
936
            #   The transfer will tar-zip the packageVersion
-
 
937
            #
-
 
938
            {
-
 
939
                my $s3msg = "";
-
 
940
                my $pv = $path;
-
 
941
 
-
 
942
                #
-
 
943
                #   Export the Secrets in EnvVars
-
 
944
                #   Use program defaults so that we don't need to specify them
-
 
945
                #   on the command line - for all to see
-
 
946
                #
-
 
947
                $ENV{AWSKEY} = $config{S3Key};
-
 
948
                $ENV{AWSSECRET} = $config{S3Secret};
-
 
949
 
-
 
950
                $rv = system ( "$progBase/savePkgToS3.sh", "--bucket=$config{S3Bucket}" ,"--path=$path" );
-
 
951
                if ( $rv )
-
 
952
                {
-
 
953
                    ReportError ("Move $path to S3");
-
 
954
                    $s3msg = ' - with S3 error';
-
 
955
                }
-
 
956
                Log (sprintf("S3Quarantined:%s%s,%4.4s,%s%s", $testMsg, $entry->{reason}, $entry->{age}, $path, $s3msg));
-
 
957
            }
-
 
958
 
-
 
959
            #
-
 
960
            #   Transfer then delete to local directory
-
 
961
            #
921
            unless (-d $tdir)
962
            unless (-d $tdir)
922
            {
963
            {
923
                eval { mkpath($tdir) };
964
                eval { mkpath($tdir) };
924
                ReportError ("Did not create quarantine target: $tdir")
965
                ReportError ("Did not create quarantine target: $tdir")
925
                    unless (-d $tdir);
966
                    unless (-d $tdir);