summaryrefslogtreecommitdiff
path: root/Build/cdbuild/place
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-05-03 22:25:11 +0000
committerKarl Berry <karl@freefriends.org>2006-05-03 22:25:11 +0000
commit1dc1536d63d9f4ede7fc5d3fff08eea3954abe15 (patch)
tree071b158b6f36b820013e91c313ca670139627414 /Build/cdbuild/place
parent146f21b4ffc63ab7f71a770c903eecacdcb96f80 (diff)
first cut at svn instead of p4
git-svn-id: svn://tug.org/texlive/trunk@1566 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/cdbuild/place')
-rwxr-xr-xBuild/cdbuild/place143
1 files changed, 80 insertions, 63 deletions
diff --git a/Build/cdbuild/place b/Build/cdbuild/place
index 3b937ab55e3..ce088b0e451 100755
--- a/Build/cdbuild/place
+++ b/Build/cdbuild/place
@@ -1,43 +1,37 @@
#!/usr/bin/env perl
-# Sebastian Rahtz: $Date: 2004/06/06 $
-# Process a tree in the texlive "cooked" directory and put
-# in the main texmf trees
-#
-# License: PUBLIC DOMAIN
-#
+# $Id$
+# License: public domain. Originally written by Sebastian Rahtz.
+#
+# Process a tree in the Build/cdbuild/cooked directory (probably created
+# by ctan2tds.pl) and integrate into the main texmf trees.
+#
+# Basic usage: place PKG
+# to process Build/cdbuild/cooked/PKG.
+#
use English;
use File::Basename;
use File::Find;
use Cwd;
-$Date=`date +%Y/%m/%d`;
-$Who=`whoami`;
-chop($Date);
-chop($Who);
+
$newpackage=0;
-$PM="//depot/Master";
@zapped=();
+
$package=$ARGV[0];
-$startdir=getcwd();
-$Inidir = getcwd();
-chdir(dirname($0));
-chdir "../../Master";
+xchdir (dirname($0) . "/cooked");
+$mydir = getcwd();
+-d "$mydir/$package" || die "$0: No such package in $mydir: $package\n";
+
+xchdir ("../../../Master");
$M = getcwd();
-$M =~ s/\/Archive//;
-chdir("$Inidir/$package");
+xchdir ("$mydir/$package");
if (-d "texmf-dist") {$Root="texmf-dist"; }
elsif (-d "texmf-doc") {$Root="texmf-doc"; }
elsif (-d "texmf") {$Root="texmf"; }
-if (!-d "$Inidir/$package") {
- die "No package to install: $package\n"; }
-
-print "$M, $Inidir, $Root\n";
-
# get list of existing files
-chdir($M) || die ("directory $M does not exist");
if (-f "$M/texmf/lists/$package") {
open(LIST,"$M/texmf/lists/$package");
while (<LIST>) {
@@ -46,69 +40,70 @@ if (-f "$M/texmf/lists/$package") {
if (/^[A-z]/) { $Old{$_}=1; }
}
close(LIST);
- system "p4 edit $PM/texmf/lists/$package";
}
else
{
$newpackage=1;
}
-if (-f "$M/$Root/tpm/$package.tpm") {
- system "p4 edit $PM/$Root/tpm/$package.tpm";
-}
-else {
- system "p4 add $M/$Root/tpm/$package.tpm";
+
+if (! -f "$M/$Root/tpm/$package.tpm") {
+ &my_system ("svn add $M/$Root/tpm/$package.tpm");
}
-chdir("$Inidir/$package");
+xchdir("$mydir/$package");
find(\&files,".");
foreach $file (keys %Old) {
print "* $file: [" . $New{$file} . "]\n";
- if ($New{$file}) {
- system "p4 edit $PM/$file";
- }
- else {
- system "p4 delete $PM/$file";
+ if (! $New{$file}) {
+ &my_system ("svn remove $PM/$file");
}
}
+
# copy files
-$Job="tar cf - . | (cd $M ; tar xf - )";
-system($Job);
+$Job="tar cf - . | (cd $M && tar xf - )";
+&my_system ($Job);
foreach $file (keys %New) {
- if ($Old{$file}) { } else { system "p4 add $M/$file"; }
+ if (! $Old{$file}) {
+ &my_system ("svn add $M/$file");
+ }
}
-if ($newpackage)
- {
- system "p4 add $M/texmf/lists/$package";
- system "p4 add $M/$Root/tpm/$package.tpm";
- }
-else
-{
- system "p4 edit $PM/texmf/lists/$package";
- system "p4 edit $PM/$Root/tpm/$package.tpm";
+if ($newpackage) {
+ &my_system ("svn add $M/texmf/lists/$package");
+ &my_system ("svn add $M/$Root/tpm/$package.tpm");
}
-chdir("$Inidir");
-system("mv $package $package.done");
-if ($Root eq 'texmf-doc') { $Type='Documentation'; }
-else { $Type='Package'; }
+xchdir($mydir);
+&my_system("mv $package $package.done");
-$SETUP="$M/Tools/tpm-factory.pl --master=$M --tpm_dir=$M/$Root/tpm --ftp_dir=/var/tmp ";
-if (-f "$M/$Root/tpm/$package.tpm") {
- system "perl $SETUP --clean --arch=all --patterns=auto --name=$Type/$package";
+if ($Root eq 'texmf-doc') {
+ $Type='Documentation';
+} elsif ($Root eq 'texmf-dist') {
+ $Type='Package';
+} else {
+ die "cannot handle Root=$Root";
}
-else
-{
- system "perl $SETUP --new --arch=all --patterns=auto --name=$Type/$package";
- system "perl $SETUP --clean --arch=all --patterns=auto --name=$Type/$package";
+
+$SETUP = "$M/Build/tools/tpm-factory.pl --master=$M --tpm_dir=$M/$Root/tpm"
+ . " --ftp_dir=/var/tmp --arch=all --patterns=auto"
+ . " --name=$Type/$package";
+if (! -f "$M/$Root/tpm/$package.tpm") {
+ &my_system ("perl $SETUP --new");
}
+&my_system ("perl $SETUP --clean");
+
+&my_system ("xsltproc --stringparam ROOT $M"
+ . " $M/Tools/tpm2list.xsl $M/$Root/tpm/$package.tpm");
- system "xsltproc --stringparam ROOT $M $M/Tools/tpm2list.xsl $M/$Root/tpm/$package.tpm";
+exit (0);
+
+
#--------------------------------------
-sub dirs {
+sub dirs
+{
local @filenames;
if (-d) {
@filenames=&buildfilelist($File::Find::name,
@@ -116,7 +111,8 @@ sub dirs {
if (!@filenames) { rmdir $File::Find::name;}
}}
-sub buildfilelist {
+sub buildfilelist
+{
local($me,$name) = @_;
my @files;
opendir(DIR,$me) || cleanup ("cannot open directory $me");
@@ -125,11 +121,32 @@ sub buildfilelist {
return @files;
}
-sub files {
- if (-f) {
+sub files
+{
+ if (-f) {
$Shortname=$_;
$This=$File::Find::name;
$This =~ s/^\.\///;
$New{$This}=1;
}
}
+
+sub xchdir
+{
+ my ($dir) = @_;
+ chdir ($dir) || die "chdir($dir) failed: $!";
+ print "place: chdir($dir)\n";
+}
+
+sub my_system
+{
+ my ($cmd) = @_;
+
+ print "place: SYSTEM $cmd\n";
+
+ my $chicken = 1;
+ unless ($chicken) {
+ my $ret = system ($cmd);
+ print "... failed, status=$ret\n" if $ret != 0;
+ }
+}