Subversion Repositories DevTools

Rev

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

Rev 361 Rev 4688
Line 53... Line 53...
53
my $opt_test;
53
my $opt_test;
54
 
54
 
55
#
55
#
56
#   Global Variables
56
#   Global Variables
57
#
57
#
58
my $GBE_DPKG        = $ENV{'GBE_DPKG'};                     # The Master repository
58
my $GBE_DPKG            = $ENV{'GBE_DPKG'};                     # The Master repository
59
my $GBE_DPKG_CACHE  = $ENV{'GBE_DPKG_CACHE'} || "";         # Caches
59
my $GBE_DPKG_CACHE      = $ENV{'GBE_DPKG_CACHE'} || "";         # Caches
60
my $GBE_DPKG_LOCAL  = $ENV{'GBE_DPKG_LOCAL'} || "";         # Local scratch
60
my $GBE_DPKG_LOCAL      = $ENV{'GBE_DPKG_LOCAL'} || "";         # Local scratch
61
my $GBE_DPKG_STORE  = $ENV{'GBE_DPKG_STORE'} || "";         # Global Store
61
my $GBE_DPKG_STORE      = $ENV{'GBE_DPKG_STORE'} || "";         # Global Store
-
 
62
my $GBE_DPKG_REPLICA    = $ENV{'GBE_DPKG_REPLICA'} || "";       # Site Local Replica
62
my $GBE_BIN         = $ENV{'GBE_BIN'};
63
my $GBE_BIN             = $ENV{'GBE_BIN'};
63
 
64
 
-
 
65
my $istore;
64
my $gstore;
66
my $gstore;
65
my $archive;
67
my $archive;
66
my $cache;
68
my $cache;
67
my $parchive;
69
my $parchive;
68
my $local = '';
70
my $local = '';
Line 162... Line 164...
162
}
164
}
163
$cache = pop @pkg_list unless ( $cache );
165
$cache = pop @pkg_list unless ( $cache );
164
$archive = $GBE_DPKG;
166
$archive = $GBE_DPKG;
165
$local = $GBE_DPKG_LOCAL;
167
$local = $GBE_DPKG_LOCAL;
166
$gstore = $GBE_DPKG_STORE;
168
$gstore = $GBE_DPKG_STORE;
-
 
169
$istore = $GBE_DPKG_REPLICA;
167
 
170
 
168
Error ("No dpkg_archive_cache found") unless ( $cache );
171
Error ("No dpkg_archive_cache found") unless ( $cache );
169
Error ("dpkg_archive_cache is the main archive") if ( $cache eq $archive );
172
Error ("dpkg_archive_cache is the main archive") if ( $cache eq $archive );
-
 
173
Error ("dpkg_archive_image is the main archive") if ( $istore && $istore eq $archive );
170
Error ("main archive is local archive" )         if ( $local && $local eq $archive );
174
Error ("main archive is local archive" )         if ( $local && $local eq $archive );
171
Warning  ("dpkg_archive_cache is local_archive" )   if ( $local && $local eq $cache );
175
Warning  ("dpkg_archive_cache is local_archive" )   if ( $local && $local eq $cache );
172
 
176
 
173
#
177
#
174
#   Export the list of cache entries
178
#   Export the list of cache entries
Line 216... Line 220...
216
#   need this header.
220
#   need this header.
217
if ( $opt_verbose || $#ARGV < 0 )
221
if ( $opt_verbose || $#ARGV < 0 )
218
{
222
{
219
    print  "dpkg_store        : $gstore\n" if ($gstore);
223
    print  "dpkg_store        : $gstore\n" if ($gstore);
220
    print  "dpkg_archive      : $archive\n";
224
    print  "dpkg_archive      : $archive\n";
-
 
225
    print  "dpkg_archive image: $istore\n";
221
    print  "dpkg_archive cache: $cache\n";
226
    print  "dpkg_archive cache: $cache\n";
222
    print  "dpkg_archive local: $local\n";
227
    print  "dpkg_archive local: $local\n";
223
    Verbose ("args:               @ARGV");
228
    Verbose ("args:               @ARGV");
224
}
229
}
225
 
230
 
Line 350... Line 355...
350
            }
355
            }
351
        }
356
        }
352
 
357
 
353
        #
358
        #
354
        #   Locate package.
359
        #   Locate package.
355
        #   It may be in GBE_DPKG or GBE_DPKG_STORE
360
        #   It may be in GBE_DPKG_REPLICA, GBE_DPKG or GBE_DPKG_STORE
356
        #
361
        #
357
        $parchive = "$archive/$_";
362
        my $pkg_found;
358
        unless ( -d $parchive )
363
        foreach my $store ( $istore, $archive, $gstore)
359
        {
364
        {
360
            $parchive = "$gstore/$_";
365
            $parchive = "$store/$_";
361
            unless ( $gstore && -d $parchive )
366
            if ( -d $parchive )
362
            {
367
            {
363
                Warning ("Package not in archive: $_")
-
 
364
                    unless ( $opt_quiet );
368
                $pkg_found = 1;
365
                next;
369
                last;
366
            }
370
            }
367
        }
371
        }
-
 
372
        
-
 
373
        unless ($pkg_found )
-
 
374
        {
-
 
375
            Warning ("Package not in archive: $_")
-
 
376
                unless ( $opt_quiet );
-
 
377
            next;
-
 
378
        }
368
 
379
 
369
        ########################################################################
380
        ########################################################################
370
        #   We have a package to process
381
        #   We have a package to process
371
        #
382
        #
372
 
383
 
Line 745... Line 756...
745
 
756
 
746
This program simplifies the operation of maintaining a local copy of
757
This program simplifies the operation of maintaining a local copy of
747
used packages from the maintaining dpkg_archive store. The cache should be
758
used packages from the maintaining dpkg_archive store. The cache should be
748
stored on your local disk for speed.
759
stored on your local disk for speed.
749
 
760
 
750
The local cache and the master cache are both determined from the environment
-
 
751
variable GBE_DPKG.
-
 
752
 
-
 
753
=head2 Location of the cache
761
=head2 Location of the cache
754
 
762
 
755
The local cache is located by examining the paths specified in GBE_DPKG. The
763
The local cache is specified with the EnvVar GBE_DPKG_CACHE
756
local cache is taken to be the last directory with the keys string B<_cache> in it.
-
 
757
 
764
 
758
The local cache cannot be the same as the main cache.
765
=head2 Location of the maintaining archive
759
 
766
 
760
The suggested named for the cache is: F<dpkg_archive_cache>
767
The required pacjage version can be found in three archives. These are:
761
 
768
 
762
=head2 Location of the maintaining archive
769
=over 4
763
 
770
 
-
 
771
=item *
-
 
772
 
764
The main cache is located by examining the paths specified in GBE_DPKG. The
773
GBE_DPKG_REPLICA. A local image of the main dpkg_archive. This is used when dpkg_archive is synced locally and is expected to be faster than GBE_DPKG
-
 
774
 
-
 
775
=item *
-
 
776
 
-
 
777
GBE_DPKG. The main dpkg_archive
-
 
778
 
-
 
779
=item *
-
 
780
 
765
main cache is taken to be the last directory with list.
781
GBE_DPKG_STORE. A global package archive. The search repository of last choice.
-
 
782
 
-
 
783
=back
766
 
784
 
767
=head2 Interaction with local_dpkg_archive
785
=head2 Interaction with local_dpkg_archive
768
 
786
 
769
If a package is located in the users local_dpkg_archive and we are doing a
787
If a package is located in the users local_dpkg_archive and we are doing a
770
simple cache update then the package will be deleted from the cache. This is
788
simple cache update then the package will be deleted from the cache. This is