Skip to content

Commit

Permalink
create symlinks for data files so that removed data files are not pic…
Browse files Browse the repository at this point in the history
…kedup from release src
  • Loading branch information
smuzaffar committed Sep 14, 2018
1 parent 1fc59d2 commit 612fa04
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions git-cms-checkdeps
Expand Up @@ -269,15 +269,20 @@ sub poisonIncludes() {
use File::Basename qw(dirname);
my $poison="${topdir}/${poisondir}";
if (-d $poison){rmtree($poison);}
my $poisondata = "$poison/.data";
mkpath($poisondata);
if (scalar(@$deletedFiles)>0) {print ">> Creating dummy files under $poison directory.\n";}
foreach my $file (@$deletedFiles) {
my $f="${poison}/${file}";
my $dir=dirname($f);
if (!-d $dir){mkpath($dir);}
my $ref;
if(!open($ref,">${f}")){die "ERROR: Can not open file for writing: $f\n";}
print $ref "#error THIS FILE HAS BEEN REMOVED FROM THE PACKAGE.\n";
close($ref);
if ($file=~/\/data\//o){symlink("$poisondata","$f");}
else{
my $ref;
if(!open($ref,">${f}")){die "ERROR: Can not open file for writing: $f\n";}
print $ref "#error THIS FILE HAS BEEN REMOVED FROM THE PACKAGE.\n";
close($ref);
}
print " $file\n";
}
}

0 comments on commit 612fa04

Please sign in to comment.