diff options
author | Karl Berry <karl@freefriends.org> | 2013-05-18 22:24:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-05-18 22:24:59 +0000 |
commit | de0e0e06760b6aefd3d8757c692204e76309a58d (patch) | |
tree | 9822429cf055768803d1ab1bb9901bd4ec6183c6 /Build/source | |
parent | 10524dbd61251e90a8ea78a0d3393b7169c49e95 (diff) |
ctanify (18may13)
git-svn-id: svn://tug.org/texlive/trunk@30563 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/ctanify/ctanify | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/ctanify/ctanify b/Build/source/texk/texlive/linked_scripts/ctanify/ctanify index 9084e6f85ab..32dcee305ea 100755 --- a/Build/source/texk/texlive/linked_scripts/ctanify/ctanify +++ b/Build/source/texk/texlive/linked_scripts/ctanify/ctanify @@ -19,7 +19,7 @@ use warnings; use strict; # Define some global variables. -our $VERSION = "1.2"; # ctanify version number +our $VERSION = "1.3"; # ctanify version number my $progname = basename $0; # Name of this program my $pkgname; # Base name of the package to create my $miscify = 0; # 1=replace singletons with misc; 0=don't @@ -36,12 +36,13 @@ my $pkgdir = ""; # Absolute directory of the package directory my $zipname; # Name of the TDS zip file my $tarname; # Name of the package tar file my $tdsoutdir; # Directory name where to output TDS tree -my $usagestr = "Usage: ${progname} [--help] [--version] [--pkgname=<package>] [--[no]auto] [--[no]skip] [--[no]unixify] [--tdsonly=<filespec> ...] filename[=<dirname>] ...\n"; # Associate file extensions with TDS directories. "%s" is replaced # with the package name. my %ext2tds = ("afm" => "fonts/afm/public/%s", + "README" => "doc/latex/%s", + "bat" => "scripts/%s", "bib" => "bibtex/bib/%s", "bst" => "bibtex/bst/%s", "cls" => "tex/latex/%s", @@ -55,7 +56,8 @@ my %ext2tds = "pfb" => "fonts/type1/public/%s", "pfm" => "fonts/type1/public/%s", "ps" => "doc/latex/%s", - "README" => "doc/latex/%s", + "py" => "scripts/%s", + "sh" => "scripts/%s", "sty" => "tex/latex/%s", "tfm" => "fonts/tfm/public/%s", "txt" => "doc/latex/%s", @@ -220,11 +222,27 @@ if ($skipdroppings) { foreach my $fname (@manifest) { next if defined $file2tds{$fname}; my $fext = ($fname =~ m|([^./]+)$| && $1); - if (!defined $ext2tds{$fext}) { - warn "${progname}: Not including $fname in the TDS tree (unknown extension)\n"; - next; + if (defined $ext2tds{$fext}) { + # Most files -- determine the directory based on the file extension. + $file2tds{$fname} = sprintf $ext2tds{$fext}, $pkgname; + } + elsif ($fext =~ /^(\d+)[a-z]*$/i) { + # Man page (e.g., "ls.1" or "File::Temp.3pm"). + $file2tds{$fname} = "doc/man/man$1"; + } + else { + # Read the file to determine if it's a Unix script (starts with "#!"). + open(SCRIPT, "<", $fname) || die "${progname}: Failed to open $fname ($!)\n"; + my $shebang; + read(SCRIPT, $shebang, 2) || die "${progname}: Failed to read $fname ($!)\n"; + close SCRIPT; + if ($shebang eq "#!") { + $file2tds{$fname} = "scripts/$pkgname"; + } + else { + warn "${progname}: Not including $fname in the TDS tree (unknown extension)\n"; + } } - $file2tds{$fname} = sprintf $ext2tds{$fext}, $pkgname; } # Create a working directory and populate it with TDS files. @@ -616,8 +634,8 @@ tarball. In short, before running B<ctanify> you should manually process any F<.ins> files and otherwise generate any files that should be sent to CTAN. -B<ctanify> has been tested only on Linux. It may work on S<MacOS X>. -It probably does not work on Windows. Volunteers willing to help port +B<ctanify> has been tested only on Linux. It may work on S<OS X>. It +probably does not work on Windows. Volunteers willing to help port B<ctanify> to other platforms are extremely welcome. |