Skip to content

Commit

Permalink
[backend] support "repotag" extension so that we can configure specia…
Browse files Browse the repository at this point in the history
…l tags
  • Loading branch information
mlschroe committed Jul 17, 2015
1 parent 1921ebc commit 9f3f4c3
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/backend/bs_publish
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/perl -w
#
# Copyright (c) 2006, 2007 Michael Schroeder, Novell Inc.
#
Expand Down Expand Up @@ -351,8 +350,7 @@ sub createrepo_rpmmd {
my ($extrep, $projid, $repoid, $data, $options) = @_;

my %options = map {$_ => 1} @{$options || []};
my $obsname = $BSConfig::obsname || 'build.opensuse.org';
my $repotag = "obsrepository://$obsname/$projid/$repoid";
my @repotags = @{$data->{'repotags'} || []};
my $prp_ext = "$projid/$repoid";
$prp_ext =~ s/:/:\//g;
print " running createrepo\n";
Expand All @@ -370,7 +368,7 @@ sub createrepo_rpmmd {
# --update requires a newer createrepo version, tested with version 0.4.10
my @createrepoargs;
push @createrepoargs, '--changelog-limit', '20';
push @createrepoargs, '--repo', $repotag;
push @createrepoargs, map { ('--repo', $_ ) } @repotags;
push @createrepoargs, '--content', 'debug' if $data->{'dbgsplit'};
my @legacyargs;
if ($options{'legacy'}) {
Expand Down Expand Up @@ -520,10 +518,7 @@ sub deleterepo_rpmmd {
sub createrepo_hdlist2 {
my ($extrep, $projid, $repoid, $data, $options) = @_;

my $obsname = $BSConfig::obsname || 'build.opensuse.org';
my $repotag = "obsrepository://$obsname/$projid/$repoid";
print " running hdlist2\n";

# create generic rpm-md meta data
for my $arch (ls($extrep)) {
next if $arch =~ /^\./;
Expand All @@ -533,7 +528,6 @@ sub createrepo_hdlist2 {
print(" genhdlist2 failed: $?\n");
}
}

# signing is done only via rpm packages to my information
}

Expand Down Expand Up @@ -1936,6 +1930,16 @@ sub publish {
my $xrepoid = $repoid;
$xrepoid .= $dbgsplit if $dbgsplit;

my @repotags = @{$repotype{'repotag'} || []};
# de-escape (mostly done for ':'
s/%([a-fA-F0-9]{2})/chr(hex($1))/ge for @repotags;
if (grep {$_ eq '-obsrepository'} @repotags) {
@repotags = grep {$_ ne '-obsrepository'} @repotags;
} else {
my $obsname = $BSConfig::obsname || 'build.opensuse.org';
push @repotags, "obsrepository://$obsname/$projid/$repoid";
}

my $data = {
'subdir' => $subdir,
'signargs' => $signargs,
Expand All @@ -1947,6 +1951,7 @@ sub publish {
'patterns' => $patterns,
'dbgsplit' => $dbgsplit,
'packtrack' => $packtrack,
'repotags' => \@repotags,
};

if ($repotype{'rpm-md'}) {
Expand Down

0 comments on commit 9f3f4c3

Please sign in to comment.