summaryrefslogtreecommitdiff
path: root/Build/cdbuild/share2bin
diff options
context:
space:
mode:
Diffstat (limited to 'Build/cdbuild/share2bin')
-rw-r--r--Build/cdbuild/share2bin60
1 files changed, 60 insertions, 0 deletions
diff --git a/Build/cdbuild/share2bin b/Build/cdbuild/share2bin
new file mode 100644
index 00000000000..9d35f4bf3f5
--- /dev/null
+++ b/Build/cdbuild/share2bin
@@ -0,0 +1,60 @@
+#!/usr/local/bin/perl
+chdir ("/texlive/bin");
+&builddirlist;
+ for (@dirnames) {
+ print "Remove links from $_ directory\n";
+ chdir($_);
+ &buildlinklist;
+ for (@linknames) {
+ print " Delete link $_\n";
+ unlink $_;
+ }
+ chdir("..");
+}
+chdir ("share");
+&buildfilelist;
+&buildlinklist;
+for (@filenames) {
+ print "FILE $_\n";
+ $File=$_;
+ for (@dirnames) {
+ print " cp -f $File ../$_/$File\n";
+ if (/.*ultrix.*/)
+ {
+ system "sed 's/bin\\/sh/bin\\/sh5/' < $File > ../$_/$File";
+ }
+ else
+ {
+ system("cp -f $File ../$_/$File");
+ }
+ }
+}
+for (@linknames) {
+ print "LINK $_\n";
+ $File=$_;
+ $real = readlink($File);
+ for (@dirnames) {
+ print " process link of $File to $_: ln -s $real $File\n";
+ system("cd ../$_; rm $File; ln -s $real $File");
+ }
+ }
+
+;
+# rebuild list of files
+sub buildfilelist {
+ opendir(DIR,'.') || die ("ERROR: cannot open directory");
+ @filenames =grep(!/^\.\.?$/,grep(!/share2bin/,grep(!-l,readdir(DIR))));
+ closedir(DIR);
+}
+# rebuild list of files
+sub buildlinklist {
+ opendir(DIR,'.') || die ("ERROR: cannot open directory");
+ @linknames =grep(-l,readdir(DIR));
+ closedir(DIR);
+}
+# rebuild list of directories
+sub builddirlist {
+ opendir(DIR,'.') || die ("ERROR: cannot open directory");
+ @dirnames =grep(/.*-/,grep(!/amiga/,grep(!/^\.\.?$/,grep(-d,readdir(DIR)))));
+ closedir(DIR);
+}