summaryrefslogtreecommitdiff
path: root/Master/tlpkg
diff options
context:
space:
mode:
authorPiotr Strzelczyk <piotr@eps.gda.pl>2010-06-25 00:59:46 +0000
committerPiotr Strzelczyk <piotr@eps.gda.pl>2010-06-25 00:59:46 +0000
commit6fccc332cf1f3e691469bbeff727d18bcd52e410 (patch)
tree727c5ac823a89679f43e4fd6da4df953adea8e08 /Master/tlpkg
parent0402f14f8d60fd3b46a00e4f81a2bbe925565b2b (diff)
continue on download errors but don't enable archive if error(s)
git-svn-id: svn://tug.org/texlive/trunk@19150 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r--Master/tlpkg/dev/download-package-repository40
1 files changed, 25 insertions, 15 deletions
diff --git a/Master/tlpkg/dev/download-package-repository b/Master/tlpkg/dev/download-package-repository
index f0970228417..ae9399a4ae0 100644
--- a/Master/tlpkg/dev/download-package-repository
+++ b/Master/tlpkg/dev/download-package-repository
@@ -50,7 +50,7 @@ if ($opt_help) {
pod2usage(-exitstatus => 0, -verbose => 2, @noperldoc);
}
-&main();
+exit(&main());
sub main {
if ( !setup_programs( "$::installerdir/$InfraLocation/installer",
@@ -70,7 +70,7 @@ sub main {
die "destination and remote repository cannot be the same: $location";
}
- info("cloning package repository from $location\n");
+ info("Cloning package repository from $location\n");
if (!-d "$::localrepo/$InfraLocation" ) {
mkdir("$::localrepo/$InfraLocation") ||
die "$0: cannot create directory $::localrepo/$InfraLocation: $!";
@@ -103,25 +103,32 @@ sub main {
$::archivedir = "__ARCHIVE__";
if (-d "$::localrepo/$Archive") {
rename("$::localrepo/$Archive", "$::archivedir") ||
- die "unable to rename $::localrepo/$Archive: $!";
+ die "unable to rename $::localrepo/$Archive to $::archivedir: $!";
}
if (!-d "$::localrepo/$::archivedir") {
mkdir("$::localrepo/$::archivedir") ||
die "$0: could not create directory $::localrepo/$::archivedir: $!";
}
- my $pkg_count = 0;
+ my $error_count = 0;
for my $pkgname ($tlpdb->list_packages) {
next if $pkgname =~ /^00texlive/;
my $tlp = $tlpdb->get_package($pkgname);
- $pkg_count += get_container("$pkgname", $tlp->containermd5() );
- get_container("$pkgname.doc", $tlp->doccontainermd5() )
+ $error_count += get_container("$pkgname", $tlp->containermd5() );
+ $error_count += get_container("$pkgname.doc", $tlp->doccontainermd5() )
if ($tlp->docfiles());
- get_container("$pkgname.source", $tlp->srccontainermd5() )
+ $error_count += get_container("$pkgname.source", $tlp->srccontainermd5() )
if ($tlp->srcfiles());
- # last if ($pkg_count > 2); # stop for testing
}
- rename("$::localrepo/$::archivedir", "$Archive") ||
- die "unable to rename $::localrepo/$::archivedir: $!";
+ if ($error_count == 0) {
+ rename("$::localrepo/$::archivedir", "$Archive") ||
+ die "unable to rename $::localrepo/$::archivedir to $Archive: $!";
+ print("Pacakge repository cloning finished successfully.\n");
+ return 0;
+ } else {
+ print("Pacakge repository cloning finished with errors.\n");
+ print("Rerunning again might fix the problems.\n");
+ return 1;
+ }
sub get_container {
my ($pkgname, $md5there) = @_;
@@ -134,13 +141,16 @@ sub main {
download_file("$remotefile", "$localfile");
# check downloaded file
my $md5here = TeXLive::TLUtils::tlmd5("$localfile");
- die "md5 sum mismatch for package $pkgname:
- database: $md5there
- dowloaded: $md5here\n" if ($md5here ne $md5there);
- return 1;
+ if ($md5here ne $md5there) {
+ warn("md5 sum mismatch for package $pkgname:
+ database: $md5there
+ dowloaded: $md5here\n");
+ return 1;
+ }
+ return 0;
}
# info("package container up to date: $pkgcontainerfile\n");
- print("OK: $pkgname\n");
+ print("skipping $pkgname\n");
return 0;
}