Skip to content

Instantly share code, notes, and snippets.

@bdha
Created March 16, 2016 23:49
Show Gist options
  • Save bdha/284f25bdce07787d2c4a to your computer and use it in GitHub Desktop.
Save bdha/284f25bdce07787d2c4a to your computer and use it in GitHub Desktop.
#!/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