diff options
-rw-r--r-- | Master/tlpkg/archive/download-package-repository | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Master/tlpkg/archive/download-package-repository b/Master/tlpkg/archive/download-package-repository index f2a9b057f35..5a400957d40 100644 --- a/Master/tlpkg/archive/download-package-repository +++ b/Master/tlpkg/archive/download-package-repository @@ -71,19 +71,21 @@ sub main { } info("Cloning package repository from $location\n"); + $::archivedir = "__ARCHIVE__"; - if (-d "$::localrepo/$Archive") { - rename("$::localrepo/$Archive", "$::localrepo/$::archivedir") || - die "unable to rename $::localrepo/$Archive to $::archivedir: $!"; + if (-d "$::localrepo/$::archivedir") { + rename("$::localrepo/$::archivedir", "$::localrepo/$Archive") || + die "unable to rename $::localrepo/$::archivedir to $Archive: $!"; } - if (!-d "$::localrepo/$::archivedir") { - mkdir("$::localrepo/$::archivedir") || - die "$0: could not create directory $::localrepo/$::archivedir: $!"; + if (!-d "$::localrepo/$Archive") { + mkdir("$::localrepo/$Archive") || + die "$0: could not create directory $::localrepo/$Archive: $!"; } if (!-d "$::localrepo/$InfraLocation" ) { mkdir("$::localrepo/$InfraLocation") || die "$0: cannot create directory $::localrepo/$InfraLocation: $!"; } + my $tlpdbfile = "$InfraLocation/$DatabaseName"; my $tlpdbpacked = "$tlpdbfile.$DefaultContainerFormat"; my $md5there; @@ -109,6 +111,11 @@ sub main { die "unusable repository database at $location\n"; } + if (-d "$::localrepo/$Archive") { + rename("$::localrepo/$Archive", "$::localrepo/$::archivedir") || + die "unable to rename $::localrepo/$Archive to $::archivedir: $!"; + } + my $error_count = 0; for my $pkgname ($tlpdb->list_packages) { next if $pkgname =~ /^00texlive/; |