diff options
author | Norbert Preining <preining@logic.at> | 2008-10-09 21:57:52 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-10-09 21:57:52 +0000 |
commit | 558d0788723c8cf9857cc1513f6051a3acf08190 (patch) | |
tree | a9e0843de99de16bf940cb8b5bc47cffcbb4515f /Master | |
parent | 23a625bd639fd9222dce58770fc2e22e874ec590 (diff) |
add a script that generates parts of the nsi file, the one that
generates the Outdir and File statements from the texlive.tlpdb
git-svn-id: svn://tug.org/texlive/trunk@10901 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/tlpkg/bin/tl-create-nsis | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/Master/tlpkg/bin/tl-create-nsis b/Master/tlpkg/bin/tl-create-nsis new file mode 100755 index 00000000000..6d658e9f6b4 --- /dev/null +++ b/Master/tlpkg/bin/tl-create-nsis @@ -0,0 +1,107 @@ +#!/usr/bin/env perl +# $Id: tl-create-nsis 0 2007-10-14 20:32:44Z karl $ +# Copyright 2008 Norbert Preining +# This file is licensed under the GNU General Public License version 2 +# or any later version. +# +# Create a .nsi file for the Win32 updates + +BEGIN { + $^W = 1; + ($mydir = $0) =~ s,/[^/]*$,,; + unshift (@INC, "$mydir/.."); +} + +our $mydir; + +use strict; + +use TeXLive::TLConfig; +use TeXLive::TLUtils; +use TeXLive::TLPOBJ; +use TeXLive::TLPDB; +use Getopt::Long; +use Pod::Usage; +use File::Path; + +my $help = 0; + +TeXLive::TLUtils::process_logging_options(); + +GetOptions("help|?" => \$help) or pod2usage(1); +pod2usage(-exitstatus => 0, -verbose => 2) if $help; + +exit (&main ()); + +sub main +{ + # get the db. + chomp (my $Master = `cd $mydir/../.. && pwd`); # xx TLPDB should default + my $tlpdb = TeXLive::TLPDB->new ("root" => "$Master"); + die("Cannot find tlpdb in $Master!\n") unless defined($tlpdb); + my $bintexlive = $tlpdb->get_package("bin-texlive"); + my $bintexlivew32 = $tlpdb->get_package("bin-texlive.win32"); + my $texliveinfra = $tlpdb->get_package("texlive.infra"); + my $texliveinfraw32 = $tlpdb->get_package("texlive.infra.win32"); + my %dirtofiles; + my @allfiles; + push @allfiles, $bintexlive->all_files; + push @allfiles, $bintexlivew32->all_files if defined $bintexlivew32; + push @allfiles, $texliveinfra->all_files; + push @allfiles, $texliveinfraw32->all_files; + for my $f (@allfiles) { + if ($f !~ m!/!) { + $f = "./$f"; + } + my ($dn, $fn) = TeXLive::TLUtils::dirname_and_basename($f); + if (!defined($dirtofiles{$dn})) { + @{$dirtofiles{$dn}} = (); + } + push @{$dirtofiles{$dn}}, $fn; + } + for my $d (keys %dirtofiles) { + my $dd = $d; + $dd =~ s!/!\\!g; + print " SetOutPath \"\$INSTDIR\\$dd\"\r\n"; + for my $f (@{$dirtofiles{$d}}) { + $f =~ s!/!\\!g; + print " File ..\\..\\..\\$dd\\$f\r\n"; + } + } +} + + + +__END__ + +=head1 NAME + +tl-create-nsis - creates a .nsi file for bin-texlive and texlive.infra + +=head1 SYNOPSIS + +tl-create-nsis [OPTION]... + +=head1 OPTIONS + +Only the standard options B<-help> and B<-q>, B<-v>, and +B<-logfile>=I<file> are accepted; see the C<process_logging_options> +function in L<TeXLive::TLUtils> for details. + +=head1 DESCRIPTION + + +=head1 AUTHORS AND COPYRIGHT + +This script and its documentation were written for the TeX Live +distribution (L<http://tug.org/texlive>) and both are licensed under the +GNU General Public License Version 2 or later. + +=cut + +### Local Variables: +### perl-indent-level: 2 +### tab-width: 2 +### indent-tabs-mode: nil +### End: +# vim:set tabstop=2 expandtab: # |