Home Home > GIT Browse > scripts
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-09-25 09:58:25 +0200
committerJiri Slaby <jslaby@suse.cz>2019-10-09 11:02:20 +0200
commit766976439788aceb07afe1e1ea1c086209dcb1d5 (patch)
treeabea8d264203d5ae2be0b48fb632c03daaca100b
parent76505500892f5ab494eda1553abf22e4a82faa0b (diff)
scripts/stableids: add dump_only option
This is useful for generating only SHAs. These are used for putting stable patches into sorted section.
-rwxr-xr-xscripts/stableids20
1 files changed, 18 insertions, 2 deletions
diff --git a/scripts/stableids b/scripts/stableids
index 40c402cc0c..2414377d1f 100755
--- a/scripts/stableids
+++ b/scripts/stableids
@@ -6,11 +6,12 @@ use Storable qw(store);
use Term::ANSIColor qw(colored);
if (@ARGV < 2) {
- print "Usage: $0 suse_machine stable_version\n";
+ print "Usage: $0 suse_machine|-d stable_version\n";
exit 1;
}
my $machine = shift;
+my $dump_only = $machine eq '-d';
my $stable_ver = shift;
my $old_version;
my $new_version;
@@ -45,7 +46,7 @@ my $patchpar = '/dev/shm';
my $patchdir = "patches-$new_version";
my $patchpath = "$patchpar/$patchdir";
my $idsfile = "$patchpath/ids";
-if (!mkdir $patchpath) {
+if (!$dump_only && !mkdir $patchpath) {
die "$patchpath already exists";
}
@@ -57,6 +58,8 @@ my $counter = 1;
my @to_delete;
my $sha_re = qr/[0-9a-f]{40}/;
+print "References: bnc#$bnc $new_version\n" if ($dump_only);
+
foreach my $rev (@revs) {
my ($filename, @commit_log) = $repo->command('show', '--no-patch',
'--format=%f%n%B', $rev);
@@ -90,6 +93,17 @@ foreach my $rev (@revs) {
}
}
+ if ($dump_only) {
+ print "$rev";
+ if (scalar @shas) {
+ print "=", join ' ', @shas;
+ } else {
+ print ' STABLE-ONLY patch: "', $commit_log[0], '"';
+ }
+ print "\n";
+ next;
+ }
+
# better than nothing
if (!scalar @shas) {
push @shas, $rev;
@@ -131,6 +145,8 @@ foreach my $rev (@revs) {
$counter++;
}
+exit 0 if ($dump_only);
+
store(\%ids, $idsfile) or die "cannot write $idsfile";
push @to_delete, $idsfile;