Skip to content

Commit

Permalink
Add releasesuffix hack for new PTF handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Nov 20, 2014
1 parent 701e243 commit 6eb73bf
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Build.pm
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ sub read_config {
$config->{'cicntstart'} = $l[0];
} elsif ($l0 eq 'releaseprg:') {
$config->{'releaseprg'} = $l[0];
} elsif ($l0 eq 'releasesuffix:') {
$config->{'releasesuffix'} = join(' ', @l);
} elsif ($l0 eq 'changetarget:' || $l0 eq 'target:') {
$config->{'target'} = join(' ', @l);
push @macros, "%define _target_cpu ".(split('-', $config->{'target'}))[0] if $config->{'target'};
Expand Down
31 changes: 31 additions & 0 deletions substitutedeps
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,37 @@ for my $line (@$xspec) {
$line =~ s/<CI_CNT>/0/;
$line =~ s/<B_CNT>/0/;
}

if ($cf->{'releasesuffix'}) {
my $suffix = $cf->{'releasesuffix'};
if ($suffix =~ /^file:(.+)$/) {
my $file = $1;
if ($file =~ /\//s || $file =~ /^\./) {
$suffix = "error:illegal release suffix";
} else {
if (open(RP, '<', "$specdir$file")) {
$suffix = "error:no suffix in $file";
for (<RP>) {
chomp;
s/^\s+//;
s/\s+$//;
$suffix = $_ if $_ && !/^#/;
}
close RP;
} else {
$suffix = "error:$file file does not exist";
}
}
}
if ($suffix =~ /^error:(.*)$/) {
$suffix = $1;
$suffix =~ s/^\s+//;
$suffix =~ s/\s+$//;
$suffix = "Error: $suffix";
}
$line =~ s/^(Release\s*:\s*.*?)\s*$/$1$suffix/i if $suffix;
}

# this is to be compatible to legacy autobuild.
# you can specify a releaseprg in the project configuration,
# if your package contains this file it is executed and its
Expand Down

0 comments on commit 6eb73bf

Please sign in to comment.