Skip to content
Snippets Groups Projects
Commit e669b7eb authored by Michael Schroeder's avatar Michael Schroeder
Browse files

Use only the email on SLES builds

Compatibility...
parent 225e10f5
No related branches found
No related tags found
No related merge requests found
......@@ -161,6 +161,13 @@ recipe_create_changelog() {
*.dsc) CFFORMAT=debian ;;
*) CFFORMAT=rpm ;;
esac
# add --emailonly option for sles builds
if test "$CFFORMAT" = rpm ; then
case `queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" eval '%{?is_opensuse}/%{?!fullname_in_changelog:%{?suse_version}}'` in
*[1-9]*/*) ;;
*/*[1-9]*) CFFORMAT="$CFFORMAT --emailonly" ;;
esac
fi
echo "running changelog2spec --target $CFFORMAT --file $1"
if ! $BUILD_DIR/changelog2spec --target $CFFORMAT --file "$1" > $BUILD_ROOT/.build-changelog ; then
rm -f $BUILD_ROOT/.build-changelog
......
......@@ -40,6 +40,7 @@ my $ok;
my $zone;
my $test;
my $fulltimestamps;
my $emailonly;
my $printtype;
my $input = '';
my $target = 'rpm';
......@@ -70,6 +71,11 @@ while (@ARGV) {
$target = shift @ARGV;
next;
}
if ($ARGV[0] eq '--emailonly') {
$emailonly = 1;
shift @ARGV;
next;
}
last;
}
......@@ -118,6 +124,7 @@ sub parse_suse {
$dt = lc($dt);
$who =~ s/^\s+//;
$who =~ s/^-\s*//;
$who = $1 if $emailonly && $who =~ /\<(.*)\>/;
$dt =~ /([0-9][0-9][0-9][0-9])/;
$dline = $_;
my $year = $1;
......
......@@ -27,6 +27,14 @@ BEGIN {
use strict;
use Build;
use Build::Rpm;
sub evalmacros {
my ($config, $str) = @_;
my @xspec;
Build::Rpm::parse({%$config, 'save_expanded' => 1} , [ "$str" ], \@xspec);
return @xspec && ref($xspec[0]) ? $xspec[0]->[1] : '';
}
my ($dist, $archs, $configdir, $type, $argument);
......@@ -81,6 +89,10 @@ if ($type eq 'buildflags') {
die("Specify which substitute to query\n") unless $argument;
my @res = @{$cf->{'substitute'}->{$argument} || []};
print join(' ', @res)."\n" if @res;
} elsif ($type eq 'eval') {
die("Specify what to eval\n") unless defined $argument;
my $result = evalmacros($cf, $argument);
print "$result\n";
} else {
die("unsupported query type: $type\n");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment