Created
March 16, 2016 23:49
-
-
Save bdha/284f25bdce07787d2c4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use File::Basename; | |
my $WORKDIR=$ENV{PWD}; | |
my $PKGDIR=$WORKDIR . "/chef"; | |
chdir $PKGDIR; | |
my $file = "pkgmap"; | |
open my $fh, '<', $file or die "Could not open '$file' $!"; | |
while (my $line = <$fh>) { | |
chomp $line; | |
next unless $line =~ / s /; | |
$line =~ s/^.*none //; | |
my ( $target, $source ) = split/=/, $line; | |
my $dirname = dirname($target); | |
my $basename = basename($target); | |
my $full_path = "$PKGDIR/reloc/$dirname"; | |
chdir $full_path; | |
symlink $source, $basename; | |
chdir $PKGDIR; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment