summaryrefslogtreecommitdiff
path: root/Master/tlpkg/libexec/place
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-03-20 18:33:50 +0000
committerKarl Berry <karl@freefriends.org>2011-03-20 18:33:50 +0000
commit83f853b5069bf9abe30cbbfa23e39c267f2ec57e (patch)
tree15cfa1522a64d8e862ea8ba90bd91fd8b893c2b0 /Master/tlpkg/libexec/place
parentda20bc65e955ee5695f0aca3fc6aff4a528a7fcd (diff)
biber darwin/cygwin updates
git-svn-id: svn://tug.org/texlive/trunk@21769 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/libexec/place')
-rwxr-xr-xMaster/tlpkg/libexec/place63
1 files changed, 44 insertions, 19 deletions
diff --git a/Master/tlpkg/libexec/place b/Master/tlpkg/libexec/place
index 6da0194d942..8c932529a9e 100755
--- a/Master/tlpkg/libexec/place
+++ b/Master/tlpkg/libexec/place
@@ -33,7 +33,8 @@ print "place: chicken mode = $chicken\n";
die "usage: $0 PKGNAME\n" unless @ARGV == 1;
$package = $ARGV[0];
-my $is_new_package = 0;
+# $::opt_verbosity = 3; # debug tlpdb reading
+
%dirs = (); # dirs we make changes in
$TMP = $ENV{"TMPDIR"} || "/tmp";
$tmpfile = "$TMP/$>.tlplace"; # use effective uid in temp file names
@@ -65,22 +66,10 @@ else { die "$cooked_master: no top level texmf or texmf-dist"; }
die "top-level README in $Root, that can't be right" if <*/README>;
-# initialize TLPDB.
-my $tlpdb = new TeXLive::TLPDB ("root" => $M);
-# create TLTREE from stuff in cooked
-my $tltree = TeXLive::TLTREE->new ("svnroot" => $cooked_master);
-$tltree->init_from_files;
-
-# get existing package from TLPDB.
-my %Old;
-my $tlpold = $tlpdb->get_package ($package);
-if (defined($tlpold)) {
- foreach ($tlpold->all_files) {
- $Old{$_} = 1;
- }
-} else {
- $is_new_package = 1;
-}
+# get all files in the existing package, if there is one.
+# In the unusual case when we have both Master and Build, we'll assume
+# we also want all the platform-specific files under bin/; else not.
+our %Old = &find_old_files ($package, $DEST eq $TOP ? "with-arch" : "");
# create new tlpsrc.
my $tlpsrc = TeXLive::TLPSRC;
@@ -103,6 +92,9 @@ if (! -r $tlpsrcfile) {
}
# make the new tlpobj.
+# create TLTREE from stuff in cooked.
+my $tltree = TeXLive::TLTREE->new ("svnroot" => $cooked_master);
+$tltree->init_from_files;
my $tlpnew = $tlpsrc->make_tlpobj($tltree, $M);
@@ -158,7 +150,7 @@ for my $file (sort keys %New) {
&add_file ("$M/$file") if ! $Old{$file};
}
-if ($is_new_package) {
+if (keys %Old == 0) { # new package
&add_file ("$M/tlpkg/tlpsrc/$package.tlpsrc");
}
@@ -194,6 +186,39 @@ exit (0);
+# return hash whose keys are all the files in PACKAGE from the main
+# tlpdb. If second arg is "with-arch", include platform-specific
+# files. If PACKAGE is not defined, return undef or the empty list.
+#
+sub find_old_files {
+ my ($package,$control) = @_;
+ my %ret;
+
+ # initialize TLPDB.
+ my $tlpdb = new TeXLive::TLPDB ("root" => $M);
+
+ my $tlpold = $tlpdb->get_package ($package);
+ if (defined($tlpold)) {
+ my @oldpkgs;
+ if ($control eq "with-arch") {
+ # also retrieve the platform-specific files, which are dependencies.
+ @oldpkgs = $tlpdb->expand_dependencies ("-only-arch", $tlpdb,($package));
+ } else {
+ @oldpkgs = ($package);
+ }
+ for my $oldpkgname (@oldpkgs) {
+ my $oldp = $tlpdb->get_package ($oldpkgname);
+ for my $f ($oldp->all_files) {
+ $ret{$f} = 1;
+ }
+ }
+ }
+
+ return %ret;
+}
+
+
+
# add a file to the repository. for svn, we also have to add the
# containing dir, and the parent of that dir, if they are new.
#
@@ -259,7 +284,7 @@ sub compare_disk_vs_tlpobj {
#
sub show_tlp_diffs {
my ($tlpnew, %Old) = @_;
- if (!defined ($tlpold)) {
+ if (keys %Old == 0) {
print "place: $package not present in $M/$InfraLocation/$DatabaseName\n\n";
} else {
print "new vs. present $package (present is indented)\n";