about summary refs log tree commit diff
path: root/pkgs/misc/tex/nix/copy-includes.pl
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/misc/tex/nix/copy-includes.pl')
-rw-r--r--pkgs/misc/tex/nix/copy-includes.pl23
1 files changed, 23 insertions, 0 deletions
diff --git a/pkgs/misc/tex/nix/copy-includes.pl b/pkgs/misc/tex/nix/copy-includes.pl
new file mode 100644
index 000000000000..57ae2d4a33d2
--- /dev/null
+++ b/pkgs/misc/tex/nix/copy-includes.pl
@@ -0,0 +1,23 @@
+use strict;
+use File::Basename;
+
+sub createDirs;
+sub createDirs {
+    my $path = shift;
+    return unless $path =~ /^(.*)\/([^\/]*)$/;
+    print "$1 BLA $2\n";
+    return if -d $1;
+    createDirs $1;
+    mkdir $1 or die "cannot create directory `$1'";
+}
+
+for (my $n = 0; $n < @ARGV; $n += 2) {
+    my $fullPath = $ARGV[$n];
+    my $relPath = $ARGV[$n + 1];
+
+    print "$fullPath <- $relPath\n";
+
+    createDirs $relPath;
+        
+    symlink $fullPath, $relPath or die "cannot create symlink `$relPath'";
+}