nixpkgs/pkgs/misc/tex/nix/copy-includes.pl
Eelco Dolstra fe0981babd * Scan for BibTeX files included by \bibliography.
* Automatically run BibTeX when necessary (i.e., when there are
  \citations in the aux file).

svn path=/nixpkgs/trunk/; revision=3222
2005-06-20 15:20:37 +00:00

22 lines
469 B
Perl

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];
createDirs $relPath;
symlink $fullPath, $relPath or die "cannot create symlink `$relPath'";
}