summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-10-09 23:54:07 +0000
committerKarl Berry <karl@freefriends.org>2009-10-09 23:54:07 +0000
commitca8489e673f0d30306ce2c7a8539722a6347a477 (patch)
treef37f0bca77b38522fd25db4a1e17a846428b010e /Master/tlpkg/bin
parent5c7dfba430b9679529d39eda08aabd4920437a1d (diff)
(install_tl_name): use this for the subdir name
that we zip/tar, including the current date. git-svn-id: svn://tug.org/texlive/trunk@15732 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin')
-rwxr-xr-xMaster/tlpkg/bin/tl-update-install-pkg54
1 files changed, 32 insertions, 22 deletions
diff --git a/Master/tlpkg/bin/tl-update-install-pkg b/Master/tlpkg/bin/tl-update-install-pkg
index c5e2484c24b..7b356028629 100755
--- a/Master/tlpkg/bin/tl-update-install-pkg
+++ b/Master/tlpkg/bin/tl-update-install-pkg
@@ -17,8 +17,8 @@ BEGIN {
} else {
$::installerdir = '../..';
}
- chdir($installerdir) || die "$0: chdir($installerdir) failed: $!";
- chomp ($installerdir=`pwd`);
+ chdir ($installerdir) || die "$0: chdir($installerdir) failed: $!";
+ chomp ($installerdir = `pwd`);
unshift (@INC, "$::installerdir/tlpkg");
#
$ENV{"PATH"} = "/usr/local/gnu/bin:$ENV{PATH}"; # for sha256sum
@@ -47,7 +47,7 @@ An existing directory must be specified as the output location.
Options:
-h, --help Print this message and exit.
- -t, --texlivedocs Include the pdf and html versions of the texlive guide
+ -t, --texlivedocs Include the pdf and html versions of the texlive guide.
-o, --outputdir Target directory. Must exist and be writable.
-v, --verbose Extra messages.
EOF
@@ -62,15 +62,21 @@ GetOptions(
"outputdir|o=s",
"texlivedocs|t",
"verbose|v",
- "help|h") or usage;
+ "help|h") or usage();
usage if $opt_help;
die "$0: extra argument(s) @ARGV; try --help if you need it.\n" if @ARGV;
# determine directories.
-my $sys_tmp = get_system_tmpdir or die "no system TMPDIR found";
+my $sys_tmp = get_system_tmpdir() || die ("no system TMPDIR found");
+
+# top directory we will generate the install pkgs in.
my $tmpdir = "$sys_tmp/install-tl-$$";
-my $inst_tmp = "$sys_tmp/install-tl-$$/install-tl";
+
+# subdirectory we will copy the files to.
+chomp (my $YYYYMMDD = `date +%Y%m%d`);
+my $install_tl_name = "install-tl-$YYYYMMDD";
+my $inst_tmp = "$tmpdir/$install_tl_name";
die "$0: output directory must be specified; try --help if you need it.\n"
if ! $opt_outputdir;
@@ -128,16 +134,14 @@ die "$0: no texlive-msg-translations in ${installerdir}'s texlive.tlpdb"
my @unix = ();
push @unix, $tlp->runfiles;
-push @unix, grep(!/^texmf\//, $tlpinfra->runfiles);
-push @unix, $tlp->docfiles;
-
-# add translations
-push @unix, $tlptrans->runfiles;
+push @unix, grep (!/^texmf\//, $tlpinfra->runfiles);
+push @unix, $tlp->docfiles; # doc
+push @unix, $tlptrans->runfiles; # translations
-# add the texlive-XX docs in pdf and html format if the option is given.
+# add the texlive-LL docs in pdf and html format if the option is given.
#
if ($opt_texlivedocs) {
- for my $p (qw(texlive-en texlive-de texlive-fr texlive-cz
+ for my $p (qw(texlive-en texlive-de texlive-fr texlive-it texlive-cz
texlive-pl texlive-ru texlive-zh-cn)) {
my $tlpdocs = $tlpdb->get_package($p);
if (!defined $tlpdocs) {
@@ -147,11 +151,13 @@ if ($opt_texlivedocs) {
push (@unix, $tlpdocs->docfiles);
}
}
+
my %tlpbin = %{$tlp->binfiles};
for my $a (keys %tlpbin) {
next if ($a =~ m/win32/);
push (@unix, @{$tlpbin{$a}});
}
+
my @win32 = ();
push (@win32, @unix);
if (defined $tlpbin{"win32"}) {
@@ -172,7 +178,7 @@ cleanup ();
-# copy files from the repository to tmpdir.
+# copy files from the repository to $inst_tmp.
#
sub copy_files
{
@@ -198,15 +204,15 @@ sub make_zip
chdir ($tmpdir) || die "chdir($tmpdir) failed: $!";
if ($type eq 'zip') {
- system ('zip', '-rq', 'install-tl.zip', 'install-tl');
+ system ('zip', '-rq', 'install-tl.zip', $install_tl_name);
} else {
- system ('tar', '-czf', 'install-tl-unx.tar.gz', 'install-tl');
+ system ('tar', '-czf', 'install-tl-unx.tar.gz', $install_tl_name);
}
chdir ($installerdir) || die "chdir($installerdir) failed: $!";
}
-# copy generated files to outputdir,
+# copy generated zip+tgz to outputdir,
#
sub install_files
{
@@ -233,12 +239,16 @@ sub install_files
mkdir ($junkdir);
xsystem ("cd $junkdir && unzip -q $outputdir/install-tl.zip");
- # move what we want (corresponds to the mv into savedir) and erase the rest.
- -d "tlpkg" || mkdir ("tlpkg", 0777)
+ # move what we want and erase the rest.
+ -d "tlpkg"
+ || mkdir ("tlpkg", 0777)
|| die "mkdir(tlpkg) failed in $outputdir: $!";
- xsystem ("mv $junkdir/install-tl/install-tl* .");
- xsystem ("rm -rf tlpkg/TeXLive tlpkg/installer tlpkg/tlperl tlpkg/translations");
- xsystem ("mv $junkdir/install-tl/tlpkg/* tlpkg/");
+ xsystem ("mv $junkdir/$install_tl_name/install-tl* .");
+
+ # These tlpkg/ subdirs exist when installing via tl-update-tlnet (?),
+ # though not when testing this script standalone.
+ xsystem ("cd tlpkg && rm -rf TeXLive installer tlperl translations");
+ xsystem ("mv $junkdir/$install_tl_name/tlpkg/* tlpkg/");
xsystem ("rm -rf $junkdir");
}