From eaad857c2b3b3232880bf6a432f1c4de56d1ac75 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 18 Jun 2009 00:49:49 +0000 Subject: attempt to do .exe addition within tlpkg/installer too git-svn-id: svn://tug.org/texlive/trunk@13800 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLTREE.pm | 22 +++++++++++++--------- Master/tlpkg/bin/check-wrapper-consistency | 1 + Master/tlpkg/bin/tl-update-bindir | 5 ++++- Master/tlpkg/doc/coding-style.txt | 22 +++++++++++++--------- Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc | 1 + 5 files changed, 32 insertions(+), 19 deletions(-) (limited to 'Master') diff --git a/Master/tlpkg/TeXLive/TLTREE.pm b/Master/tlpkg/TeXLive/TLTREE.pm index 95c882dfdb6..ccb67ae6a5f 100644 --- a/Master/tlpkg/TeXLive/TLTREE.pm +++ b/Master/tlpkg/TeXLive/TLTREE.pm @@ -230,10 +230,12 @@ sub _get_matching_files { # * -> .* # ? -> . # + -> \+ -sub _get_files_matching_glob_pattern { +sub _get_files_matching_glob_pattern +{ my $self = shift; my ($type,$globline) = @_; my @returnfiles; + my $dirpart = TeXLive::TLUtils::dirname($globline); my $basepart = TeXLive::TLUtils::basename($globline); $basepart =~ s/\./\\./g; @@ -241,8 +243,9 @@ sub _get_files_matching_glob_pattern { $basepart =~ s/\?/./g; $basepart =~ s/\+/\\+/g; return unless (defined($self->{'_filesofdir'}{$dirpart})); + my @candfiles = @{$self->{'_filesofdir'}{$dirpart}}; - foreach my $f (@candfiles) { + for my $f (@candfiles) { ddebug("matching $f in $dirpart via glob $globline\n"); if ($f =~ /^$basepart$/) { ddebug("hit: globline=$globline, $dirpart/$f\n"); @@ -253,15 +256,16 @@ sub _get_files_matching_glob_pattern { } } } - if (($dirpart =~ m@^bin/win32@) || ($dirpart =~ m@^bin/i386-cygwin@)) { - # for arch=win32 under bin we want to automatch more extensions. + + if ($dirpart =~ m,^bin/(win32|i386-cygwin), + || $dirpart =~ m,tlpkg/installer,) { + # for windows-iwsh we want to automatch more extensions. foreach my $f (@candfiles) { my $w32_binext; - if ($dirpart =~ m@^bin/win32@) { - $w32_binext = "bat|cmd|exe|dll|texlua"; + if ($dirpart =~ m,^bin/i386-cygwin,) { + $w32_binext = "exe"; # cygwin has .exe but nothing else } else { - # cygwin part, they have .exe, but nothing else - $w32_binext = "exe"; + $w32_binext = "bat|cmd|exe|dll|texlua"; } ddebug("matching $f in $dirpart via glob $globline.($w32_binext)\n"); if ($f =~ /^$basepart\.($w32_binext)$/) { @@ -274,7 +278,7 @@ sub _get_files_matching_glob_pattern { } } } - return(@returnfiles); + return @returnfiles; } sub _get_files_matching_regexp_pattern { diff --git a/Master/tlpkg/bin/check-wrapper-consistency b/Master/tlpkg/bin/check-wrapper-consistency index 452c8622da0..318e69956cd 100755 --- a/Master/tlpkg/bin/check-wrapper-consistency +++ b/Master/tlpkg/bin/check-wrapper-consistency @@ -96,6 +96,7 @@ sub check_w32 for my $k (sort keys %uw) { my $target = $uw{$k}; next if $target =~ /context/; # does things its own way + next if $target =~ /man/; # no symlink next if $target =~ /ps4pdf/; # has its own .bat next if $target =~ /simpdftex/; # shell script next if $target =~ /tex4ht/; # tex4ht has its own .bat's diff --git a/Master/tlpkg/bin/tl-update-bindir b/Master/tlpkg/bin/tl-update-bindir index 2fc7dc7854a..230f4afaeed 100755 --- a/Master/tlpkg/bin/tl-update-bindir +++ b/Master/tlpkg/bin/tl-update-bindir @@ -128,7 +128,7 @@ for tlname in $tlnames; do $download http://members2.jcom.home.ne.jp/wt1357ak/tl2009w32-02.zip;; x86_64-linux) default_bin_loc=$download_loc - $download http://www.bibles.org.uk/x86_64/x86_64-linux-gnu.tar.gz;; + $download ftp://ftpth.mppmu.mpg.de/pub/peb/TLtests/Build-x86_64-linux.tar.bz2;; esac fi @@ -162,6 +162,9 @@ for tlname in $tlnames; do fi # may need to cd into a subdirectory, depending on how the tar was made. + if test `ls $srcdir` = bin; then + srcdir=$srcdir/bin + fi if test `ls $srcdir | wc -l` = 1; then srcdir=$srcdir/* fi diff --git a/Master/tlpkg/doc/coding-style.txt b/Master/tlpkg/doc/coding-style.txt index 0cf1a022b87..6a98ecc77a8 100644 --- a/Master/tlpkg/doc/coding-style.txt +++ b/Master/tlpkg/doc/coding-style.txt @@ -23,6 +23,13 @@ This avoids the temptation to put an ever-growing amount of code at the top level. It is better to have the top-level code inside a subroutine. +* The Perl "unless" keyword is cute but mind-bending. Use "if !" instead. + + +* Use "/" as the delimiter of first choice for regular expressions. When +the regex includes a /, use ",". When it includes both "/" and ",", use "!". + + * In the absence of prototypes, try to order routines in a given file top-down rather than bottom-up. So main would come first. @@ -32,9 +39,6 @@ Put a space between arguments of function calls. Karl puts a space before the ( of function calls but no one else does :). -* The Perl "unless" keyword is cute but mind-bending. Use "if !" instead. - - * Handle subroutine arguments like this: sub foo @@ -43,14 +47,14 @@ sub foo ... } -Always use this, vs. shift, even when there is only one argument. It -takes up only one line, which is good. And if the number of arguments -to the function changes, text changes are minimized. +Use this in preference to `shift' even when there is only one argument. +It takes up only one line, which is good. And if the number of +arguments to the function changes, text changes are minimized. * It looks strange to write hash keys as if they were keywords (although it is certainly common Perl practice to do so). Instead, write them as -strings +strings: my $foo = $h->{"key"}; for a reminder that these are not keywords or subroutine names. @@ -69,7 +73,7 @@ not Perl keywords. * Similarly, Perl lets you omit parentheses around function calls and/or primitives in many situations. As a rule, don't do this. It is far clearer to use parens when there's a function call. Exceptions for -these primitives: exists, defined, print (and relatives). +these primitives: exists, defined, print and its relatives. * The above is essentially the recommendation of the GNU coding standards @@ -78,7 +82,7 @@ standards' recommendation of putting braces on lines by themselves, thus eating up precious vertical space. Do not do that. -* Exporting symbols and keeping namespaces clean. +* Exporting symbols and keeping namespaces clean: In general, the only things which should be in @EXPORT are those which are needed nearly universally, such as debug and log. Barewords diff --git a/Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc b/Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc index e3c526fddba..895452e7106 100644 --- a/Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc +++ b/Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc @@ -41,6 +41,7 @@ universal-darwin,win32 tlpkg/installer/wget/wget.${ARCH} # extensions, so annoyingly list explicit exe's: # (getting inconsistent results with cygwin?) binpattern f/win32 tlpkg/installer/wget/wget.exe +binpattern f/win32 tlpkg/installer/xz/xz.exe binpattern f/win32 tlpkg/installer/xz/xzdec.exe binpattern f/i386-cygwin tlpkg/installer/xz/xzdec.i386-cygwin.exe binpattern f/i386-cygwin tlpkg/installer/xz/xz.i386-cygwin.exe -- cgit v1.2.3