From c9dbdcc25fbcc54f6a8bfb74e150215bbcffd5a5 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 20 Feb 2012 23:14:11 +0000 Subject: try to implement a --keep-catalogue option, but does not work for now git-svn-id: svn://tug.org/texlive/trunk@25441 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/tl-update-tlpdb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'Master/tlpkg/bin') diff --git a/Master/tlpkg/bin/tl-update-tlpdb b/Master/tlpkg/bin/tl-update-tlpdb index d3467a3973a..fe98834223c 100755 --- a/Master/tlpkg/bin/tl-update-tlpdb +++ b/Master/tlpkg/bin/tl-update-tlpdb @@ -39,6 +39,7 @@ my $opt_tlpsrc_from_cmdline = 0; my $opt_w32warning; my $opt_tlpdb_options_from_tlpsrc = 0; my $opt_keep_revisions = 0; +my $opt_keep_catalogue = 1; TeXLive::TLUtils::process_logging_options(); GetOptions( @@ -46,6 +47,7 @@ GetOptions( "dry-run|n", => \$opt_dry_run, "fix-reverse-revisions!" => \$opt_fix_reverse_revisions, "keep-revisions" => \$opt_keep_revisions, + "keep-catalogue" => \$opt_keep_catalogue, "from-files" => \$opt_fromfiles, "master=s" => \$opt_master, "no-bin-split!" => \$opt_nobinsplit, @@ -95,6 +97,13 @@ sub main info ("$progname: No checking on increasing revisions, no old tlpdb found\n"); finish ($newtlpdb, $pkgcount); } + if (!defined($tlc) && $opt_keep_catalogue) { + # not working at the moment, the catalogue hash has to be treated + # specially + # furthermore, the docfiles specifications are also not moved!!!! + # better to do this in the create_tlpdb and also add docfile tags?!? + # move_catalogue_over($oldtlpdb, $newtlpdb); + } if ($opt_no_revision_check) { if ($opt_keep_revisions) { move_revisions_over($oldtlpdb, $newtlpdb); @@ -170,6 +179,24 @@ sub move_revisions_over } } + +sub move_catalogue_over +{ + # not working at the moment, the catalogue hash needs to be moved + # one by one! + my ($oldtlpdb, $newtlpdb) = @_; + for my $pkg ($newtlpdb->list_packages) { + my $oldtlp = $oldtlpdb->get_package($pkg); + if (defined($oldtlp)) { + my $newtlp = $newtlpdb->get_package($pkg); + $newtlp->shortdesc($oldtlp->shortdesc); + $newtlp->longdesc($oldtlp->longdesc); + $newtlp->catalogue($oldtlp->catalogue); + $newtlp->cataloguedata($oldtlp->cataloguedata); + } + } +} + sub compare_and_fix_tlpdbs { -- cgit v1.2.3