Subversion Repositories DevTools

Rev

Rev 5404 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5404 Rev 6320
Line 29... Line 29...
29
 
29
 
30
require 5.008_002;
30
require 5.008_002;
31
use strict;
31
use strict;
32
use warnings;
32
use warnings;
33
use Sys::Hostname;
33
use Sys::Hostname;
-
 
34
use Digest::MD5;
34
 
35
 
35
my $dpkg = "$ENV{HOME}/dpkg_archive";
36
my $dpkg = "$ENV{HOME}/dpkg_archive";
36
my $CountDeleted = 0;
37
my $CountDeleted = 0;
37
my $CountMissing = 0;
38
my $CountMissing = 0;
38
my $CountDamaged = 0;
39
my $CountDamaged = 0;
Line 102... Line 103...
102
        $CountDamaged++ if (! -f "$vdir/descpkg");
103
        $CountDamaged++ if (! -f "$vdir/descpkg");
103
    }
104
    }
104
}
105
}
105
 
106
 
106
#
107
#
-
 
108
#   Data about blats internal files
-
 
109
#   
-
 
110
insertBlatFiles();
-
 
111
 
-
 
112
#
107
#   Output summary data as MetaData
113
#   Output summary data as MetaData
108
#
114
#
109
printMetaData('Total',$CountTotal);
115
printMetaData('Total',$CountTotal);
110
printMetaData('Delete',$CountDeleted);
116
printMetaData('Delete',$CountDeleted);
111
printMetaData('Missing',$CountMissing);
117
printMetaData('Missing',$CountMissing);
Line 145... Line 151...
145
{
151
{
146
    my ($name,$value) = @_;
152
    my ($name,$value) = @_;
147
    print('Metadata ', quoteData($name, $value, 1), "\n");
153
    print('Metadata ', quoteData($name, $value, 1), "\n");
148
}
154
}
149
 
155
 
-
 
156
#-------------------------------------------------------------------------------
-
 
157
# Function        : insertBlatFiles 
-
 
158
#
-
 
159
# Description     : Insert data about the BLAT files
-
 
160
#
-
 
161
# Inputs          : None. 
-
 
162
#
-
 
163
# Returns         : Nothing
-
 
164
#
-
 
165
sub insertBlatFiles
-
 
166
{
-
 
167
    my $blatDir = "$ENV{HOME}/bin";
-
 
168
    if (opendir(DIR, $blatDir ) ) {
-
 
169
        my @vlist = readdir(DIR);
-
 
170
        closedir DIR;
-
 
171
 
-
 
172
        foreach my $vname ( sort @vlist )
-
 
173
        {
-
 
174
            next if ( $vname eq '.' );
-
 
175
            next if ( $vname eq '..' );
-
 
176
            next unless ( -f "$blatDir/$vname" );
-
 
177
            my $md5 = "FileReadError";
-
 
178
 
-
 
179
            if (open FILE, "$blatDir/$vname") {
-
 
180
                $md5 = Digest::MD5->new->addfile (*FILE)->hexdigest;
-
 
181
                close (FILE);
-
 
182
            }
-
 
183
            print   'BlatBin ',
-
 
184
                    quoteData('MD5', $md5, 1),
-
 
185
                    quoteData('file', $vname, 1 ),
-
 
186
                    "\n";
-
 
187
        }
-
 
188
    }
-
 
189
}
150
 
190
 
151
#-------------------------------------------------------------------------------
191
#-------------------------------------------------------------------------------
152
# Function        : insertDiskMetaData  
192
# Function        : insertDiskMetaData  
153
#
193
#
154
# Description     : Generates Disk Metadata entries in the output stream
194
# Description     : Generates Disk Metadata entries in the output stream