Skip to content

Commit

Permalink
[backend] add hack that allows to symlink preinstall image infos
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Jul 2, 2012
1 parent dd594a2 commit ddde44e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/backend/bs_repserver
Expand Up @@ -1127,6 +1127,15 @@ sub getpreinstallimageinfos {
my $imagescnt = 0;
for my $prpa (@$prpas) {
next unless -e "$reporoot/$prpa/:preinstallimages";
if (-l _) {
# small hack: allow symlink to another prpa's file
my $l = readlink("$reporoot/$prpa/:preinstallimages") || '';
my @l = split('/', "$prpa////$l", -1);
$l[-4] = $l[0] if $l[-4] eq '' || $l[-4] eq '..';
$l[-3] = $l[1] if $l[-3] eq '' || $l[-3] eq '..';
$l[-2] = $l[2] if $l[-2] eq '' || $l[-2] eq '..';
$prpa = "$l[-4]/$l[-3]/$l[-2]";
}
my $images = BSUtil::retrieve("$reporoot/$prpa/:preinstallimages", 1);
next unless $images;
$imagescnt += @$images;
Expand Down

0 comments on commit ddde44e

Please sign in to comment.