summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2013-04-26 06:51:26 +0000
committerNorbert Preining <preining@logic.at>2013-04-26 06:51:26 +0000
commitd3ce5c8c88190b0d451332f9d094caf4ef7bff9d (patch)
tree4934566245a8a6c251199196593d89d534e49338 /Master/texmf-dist
parentc475b214bb07237c8979e381bc37934113e9fa65 (diff)
add ctan version to machine readable output
git-svn-id: svn://tug.org/texlive/trunk@30121 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl34
1 files changed, 28 insertions, 6 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index c64f0a30850..b21aa3f4496 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -2291,7 +2291,7 @@ sub machine_line {
$ret = 1;
shift;
}
- my ($pkg, $flag, $lrev, $rrev, $size, $runtime, $esttot, $tag) = @_;
+ my ($pkg, $flag, $lrev, $rrev, $size, $runtime, $esttot, $tag, $lcv, $rcv) = @_;
$lrev ||= "-";
$rrev ||= "-";
$flag ||= "?";
@@ -2299,7 +2299,9 @@ sub machine_line {
$runtime ||= "-";
$esttot ||= "-";
$tag ||= "-";
- my $str = join("\t", $pkg, $flag, $lrev, $rrev, $size, $runtime, $esttot, $tag);
+ $lcv ||= "-";
+ $rcv ||= "-";
+ my $str = join("\t", $pkg, $flag, $lrev, $rrev, $size, $runtime, $esttot, $tag, $lcv, $rcv);
$str .= "\n";
return($str) if $ret;
print $str;
@@ -2550,7 +2552,8 @@ sub action_update {
if ($::machinereadable) {
# TODO should we add a revision number
push @addlines,
- machine_line("-ret", $pkg, $FLAG_FORCIBLE_REMOVED, "-", "-", "-");
+ # $pkg, $flag, $lrev, $rrev, $size, $runtime, $esttot, $tag, $lcv, $rcv
+ machine_line("-ret", $pkg, $FLAG_FORCIBLE_REMOVED);
} else {
info("skipping forcibly removed package $pkg\n");
}
@@ -2580,6 +2583,7 @@ sub action_update {
next;
}
my $rev = $tlp->revision;
+ my $lctanvers = $tlp->cataloguedata->{'version'};
my $mediatlp;
my $maxtag;
if ($remotetlpdb->is_virtual) {
@@ -2592,19 +2596,24 @@ sub action_update {
debug("$pkg cannot be found in $location\n");
next;
}
+ my $rctanvers = $mediatlp->cataloguedata->{'version'};
my $mediarev = $mediatlp->revision;
my $mediarevstr = $mediarev;
my @addargs = ();
if ($remotetlpdb->is_virtual) {
push @addargs, $maxtag;
$mediarevstr .= "\@$maxtag";
+ } else {
+ push @addargs, undef;
}
+ push @addargs, $lctanvers, $rctanvers;
if ($rev < $mediarev) {
$updated{$pkg} = 0; # will be changed to one on successful update
} elsif ($rev > $mediarev) {
if ($::machinereadable) {
+ # $pkg, $flag, $lrev, $rrev, $size, $runtime, $esttot, $tag, $lcv, $rcv
push @addlines,
- machine_line("-ret", $pkg, $FLAG_REVERSED_UPDATE, $rev, $mediarev, "-", @addargs);
+ machine_line("-ret", $pkg, $FLAG_REVERSED_UPDATE, $rev, $mediarev, "-", "-", "-", @addargs);
} else {
if ($opts{"list"}) {
# not issueing anything if we keep a package
@@ -2738,9 +2747,11 @@ sub action_update {
next;
}
my $rev = $pkg->revision;
+ my $lctanvers = $pkg->cataloguedata->{'version'};
if ($opts{"list"}) {
if ($::machinereadable) {
- machine_line($p, $FLAG_REMOVE, $rev, "-", "-", "-");
+ # $pkg, $flag, $lrev, $rrev, $size, $runtime, $esttot, $tag, $lcv, $rcv
+ machine_line($p, $FLAG_REMOVE, $rev, "-", "-", "-", "-", "-", $lctanvers);
} else {
upd_info($p, -1, $rev, "<absent>", "autorm");
}
@@ -2752,7 +2763,8 @@ sub action_update {
# we have to check in addition that
# - $opts{"dry-run"} is not set
if ($::machinereadable) {
- machine_line($p, $FLAG_REMOVE, $rev, "-", "-", "-");
+ # $pkg, $flag, $lrev, $rrev, $size, $runtime, $esttot, $tag, $lcv, $rcv
+ machine_line($p, $FLAG_REMOVE, $rev, "-", "-", "-", "-", "-", $lctanvers);
} else {
info("[" . sprintf ('%*2$s', $currnr, $totalnrdigits) .
"/$totalnr] auto-remove: $p ... ");
@@ -2865,6 +2877,7 @@ sub action_update {
my $unwind_package;
my $remove_unwind_container = 0;
my $rev = $tlp->revision;
+ my $lctanvers = $tlp->cataloguedata->{'version'};
my $mediatlp;
my $maxtag;
if ($remotetlpdb->is_virtual) {
@@ -2877,16 +2890,21 @@ sub action_update {
debug("$pkg cannot be found in $location\n");
next;
}
+ my $rctanvers = $mediatlp->cataloguedata->{'version'};
my $mediarev = $mediatlp->revision;
my $mediarevstr = $mediarev;
my @addargs = ();
if ($remotetlpdb->is_virtual) {
push @addargs, $maxtag;
$mediarevstr .= "\@$maxtag";
+ } else {
+ push @addargs, undef;
}
+ push @addargs, $lctanvers, $rctanvers;
$nrupdated++;
if ($opts{"list"}) {
if ($::machinereadable) {
+ # $pkg, $flag, $lrev, $rrev, $size, $runtime, $esttot, $tag, $lcv, $rcv
machine_line($pkg, $FLAG_UPDATE, $rev, $mediarev, $sizes{$pkg}, "-", "-", @addargs);
} else {
my $kb = int($sizes{$pkg} / 1024) + 1;
@@ -3420,6 +3438,7 @@ sub action_install {
my $flag = $FLAG_INSTALL;
my $re = "";
my $tlp = $remotetlpdb->get_package($pkg);
+ my $rctanvers = $tlp->cataloguedata->{'version'};
if (!defined($tlp)) {
info("Unknown package $pkg\n");
next;
@@ -3428,7 +3447,9 @@ sub action_install {
info("Package $pkg is not relocatable, cannot install it in user mode!\n");
next;
}
+ my $lctanvers;
if (defined($localtlpdb->get_package($pkg))) {
+ my $lctanvers = $localtlpdb->get_package($pkg)->cataloguedata->{'version'};
if ($opts{"reinstall"}) {
$re = "re";
$flag = $FLAG_REINSTALL;
@@ -3452,6 +3473,7 @@ sub action_install {
$tagstr = " \@" . $maxtag;
}
}
+ push @addargs, $lctanvers, $rctanvers;
if ($::machinereadable) {
machine_line($pkg, $flag, "-", $revs{$pkg}, $sizes{$pkg}, $estrem, $esttot, @addargs);
} else {