summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-update-nsis
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-11-09 17:42:02 +0000
committerKarl Berry <karl@freefriends.org>2019-11-09 17:42:02 +0000
commit24bb9e4fa5f638d0e535c4cdd8a87ea482b11490 (patch)
treec9a56adc5e720e310f37075914d9221c29a8f772 /Master/tlpkg/bin/tl-update-nsis
parent4885bb094e49e56658e15217cf9e143b0f6d14b3 (diff)
TLUtils.pm (setup_programs): only use Data::Dumper if vv, not just v;
indent debug output lines. (copy): ddebug of every copy is too much; but ddebug dereferencing. TLPDB.pm (not_virtual_install_package): show container files instead of meaningless array ref hex, and only if ddebug. tl-try-install: placeholder for install-tl options. tl-try-makeself: doc. tl-update-nsis: remove tlpobj/ dir if we created it. tl-update-tlcritical: new option --no-containers. tltestnet: new convenience script for testing versioned containers. git-svn-id: svn://tug.org/texlive/trunk@52706 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/tl-update-nsis')
-rwxr-xr-xMaster/tlpkg/bin/tl-update-nsis56
1 files changed, 34 insertions, 22 deletions
diff --git a/Master/tlpkg/bin/tl-update-nsis b/Master/tlpkg/bin/tl-update-nsis
index 5f05ad7de97..7b41c32d9be 100755
--- a/Master/tlpkg/bin/tl-update-nsis
+++ b/Master/tlpkg/bin/tl-update-nsis
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
# $Id$
-# Copyright 2008, 2009, 2010 Norbert Preining
+# Copyright 2008-2019 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
#
@@ -34,44 +34,52 @@ pod2usage(-exitstatus => 0, -verbose => 2) if $opt_help;
exit (&main ());
-sub main
-{
- # get the db.
- chomp (my $Master = `cd $mydir/../.. && pwd`);
- my $tlpdb = TeXLive::TLPDB->new ("root" => $Master);
+sub main {
+ chomp(my $Master = `cd $mydir/../.. && pwd`);
+ my $tlpdb = TeXLive::TLPDB->new("root" => $Master);
die("Cannot find tlpdb in $Master\n") unless defined($tlpdb);
+
my $texliveinfra = $tlpdb->get_package("texlive.infra");
my $texliveinfraw32 = $tlpdb->get_package("texlive.infra.win32");
+ #
my @allfiles = ();
- push @allfiles, $texliveinfra->all_files;
- push @allfiles, $texliveinfraw32->all_files if defined $texliveinfraw32;
+ push(@allfiles, $texliveinfra->all_files);
+ push(@allfiles, $texliveinfraw32->all_files) if defined $texliveinfraw32;
- # create the tlpobj files
+ # create the tlpobj files, but if we have to create the tlpobj/ dir,
+ # don't leave it around after.
my $tlpobjdir = "$InfraLocation/tlpobj";
- my $removetlpobjdir = 0;
- if (! -d "$Master/$tlpobjdir") {
- &TeXLive::TLUtils::mkdirhier("$Master/$tlpobjdir");
- $removetlpobjdir = 1;
+ my $abs_tlpobjdir = "$Master/$tlpobjdir";
+ my $rm_abs_tlpobjdir = 0;
+ if (! -d $abs_tlpobjdir) {
+ &TeXLive::TLUtils::mkdirhier($abs_tlpobjdir);
+ $rm_abs_tlpobjdir = 1;
}
- my $rev = 0; # we want the highest rev all these packages.
+ my $rev = 0; # get the highest rev of all our packages
for my $p ($texliveinfra, $texliveinfraw32) {
if (defined $p) {
if ($p->revision > $rev) {
$rev = $p->revision;
}
- open(TMP,">$Master/$tlpobjdir/$p->{'name'}.tlpobj") or die "Cannot create $Master/$tlpobjdir/$p->{'name'}.tlpobj";
+ open(TMP,">$abs_tlpobjdir/$p->{'name'}.tlpobj")
+ || die "open($abs_tlpobjdir/$p->{'name'}.tlpobj) failed: $!";
$p->writeout(\*TMP);
close(TMP);
- push @allfiles, "$tlpobjdir/$p->{'name'}.tlpobj";
+ push(@allfiles, "$tlpobjdir/$p->{'name'}.tlpobj");
}
}
+ # remove the tlpobj/ dir if we created it.
+ if ($rm_abs_tlpobjdir) {
+ TeXLive::TLUtils::rmtree($abs_tlpobjdir);
+ }
+
my %dirtofiles;
for my $f (@allfiles) {
if ($f !~ m!/!) {
$f = "./$f";
}
- my ($dn, $fn) = TeXLive::TLUtils::dirname_and_basename($f);
+ my ($dn,$fn) = TeXLive::TLUtils::dirname_and_basename($f);
if (!defined($dirtofiles{$dn})) {
@{$dirtofiles{$dn}} = ();
}
@@ -163,11 +171,15 @@ function in L<TeXLive::TLUtils> for details.
=head1 DESCRIPTION
-Creates a C<.nsi> file that can be used with NSIS to create an update
-executable for Windows, to work around Windows' inability to overwrite
-open files, and for disaster recovery. It contains the tlmgr-related
-infrastructure files. L<http://tug.org/texlive/tlmgr.html> explains
-more.
+Writes, to standard output, a C<.nsi> file that can be used with NSIS to
+create an update executable for Windows, to work around Windows'
+inability to overwrite open files, and for disaster recovery. It
+contains the tlmgr-related infrastructure files.
+L<http://tug.org/texlive/tlmgr.html> explains more.
+
+This is invoked by the C<tl-update-tlcritical> script, along with the
+sibling C<tl-makeself-from-tlnet> which creates a similar disaster
+recovery executable for Unix.
=head1 AUTHORS AND COPYRIGHT