|
|
|
@ -34,6 +34,10 @@ if ($info->{"package-release"} ne $today) {
|
|
|
|
|
print STDERR "openpkg-dev-release: ERROR: package release not matching current date\n"; |
|
|
|
|
exit(1); |
|
|
|
|
} |
|
|
|
|
if ($info->{"package-name"} eq "") { |
|
|
|
|
print STDERR "openpkg-dev-release: ERROR: package name not set\n"; |
|
|
|
|
exit(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# commit changeset to Monotone repository |
|
|
|
|
print STDOUT "\033[31m++ commiting changeset to OpenPKG VCS repository\033[0m\n"; |
|
|
|
@ -48,13 +52,19 @@ if (! -f $info->{"spec-dir"} . "/" . $info->{"package-name"} . ".spec") {
|
|
|
|
|
print STDOUT "-- local: " . $info->{"spec-dir"} . "\n"; |
|
|
|
|
my $cmd = "cd " . $info->{"spec-dir"} . " && "; |
|
|
|
|
$info->{"commit-message"} =~ s/'/\\'/sg; |
|
|
|
|
$cmd .= "mtn commit -m '" . $info->{"commit-message"} . "' . && mtn push"; |
|
|
|
|
$cmd .= "mtn commit -m '" . $info->{"commit-message"} . "' ."; |
|
|
|
|
print STDOUT "\$ $cmd\n"; |
|
|
|
|
my $rc = system($cmd); |
|
|
|
|
if ($rc != 0) { |
|
|
|
|
print STDERR "openpkg-dev-release: ERROR: failed to commit to VCS repository\n"; |
|
|
|
|
exit(1); |
|
|
|
|
my $rc; |
|
|
|
|
for (my $i = 0; i < 10; $i++) { |
|
|
|
|
$rc = system($cmd); |
|
|
|
|
last if ($rc == 0); |
|
|
|
|
print STDERR "openpkg-dev-release: WARNING: failed to commit to VCS repository (retrying in 2 seconds)\n"; |
|
|
|
|
sleep(2); |
|
|
|
|
} |
|
|
|
|
#if ($rc != 0) { |
|
|
|
|
# print STDERR "openpkg-dev-release: ERROR: failed to commit to VCS repository\n"; |
|
|
|
|
# exit(1); |
|
|
|
|
#} |
|
|
|
|
|
|
|
|
|
# upload file to download.openpkg.org |
|
|
|
|
print STDOUT "\033[31m++ uploading source RPM package to OpenPKG download repository\033[0m\n"; |
|
|
|
|