author | dermotm |
Tue, 22 Jul 2003 12:39:50 +0000 | |
changeset 709 | 42ba809d7b77 |
permissions | -rwxr-xr-x |
709
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
1 |
#!/usr/bin/perl -w |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
2 |
# |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
3 |
# uprev-spec - increments by 1 the value of the Release field in spec files |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
4 |
# |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
5 |
# Dermot McCluskey 22-July-2003 Initial Version |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
6 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
7 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
8 |
use strict; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
9 |
use warnings; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
10 |
use Getopt::Long qw(:config gnu_getopt no_auto_abbrev); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
11 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
12 |
my $exit_val = 0; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
13 |
my $verbose = 1; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
14 |
my $build = ""; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
15 |
my @spec_files = (); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
16 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
17 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
18 |
&main (); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
19 |
exit $exit_val; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
20 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
21 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
22 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
23 |
sub print_msg ($) |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
24 |
{ |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
25 |
($verbose) && print shift; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
26 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
27 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
28 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
29 |
sub set_quiet |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
30 |
{ |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
31 |
$verbose = 0; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
32 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
33 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
34 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
35 |
sub process_args ($) |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
36 |
{ |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
37 |
push @spec_files, shift; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
38 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
39 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
40 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
41 |
sub process_options |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
42 |
{ |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
43 |
Getopt::Long::Configure ("bundling"); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
44 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
45 |
GetOptions ('q|quiet' => \&set_quiet, |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
46 |
'h|help' => \&usage, |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
47 |
'build=n' => \$build, |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
48 |
'<>' => \&process_args); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
49 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
50 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
51 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
52 |
sub usage (;$) |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
53 |
{ |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
54 |
print << "EOF"; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
55 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
56 |
uprev-spec - increments by 1 the value of the Release field in spec files |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
57 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
58 |
Usage: uprev-spec [options] specs... |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
59 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
60 |
options: |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
61 |
-q|--quiet: Silent operation. |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
62 |
-h|--help: Print this help message. |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
63 |
--build=n: If specified, Release will be incremented to at least n |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
64 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
65 |
specs... |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
66 |
path(s) to spec file(s) |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
67 |
EOF |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
68 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
69 |
exit 0; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
70 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
71 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
72 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
73 |
sub up_rev ($) |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
74 |
{ |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
75 |
my $spec_file = shift; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
76 |
my $spec_file_base = $spec_file; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
77 |
my $temp_file; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
78 |
my $found = 0; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
79 |
my $out; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
80 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
81 |
# if spec_file contains a leading dir, then split it out |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
82 |
if ($spec_file =~ /.+\/(.+)/) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
83 |
$spec_file_base = $1; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
84 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
85 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
86 |
$temp_file = "/tmp/$spec_file_base.tmp"; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
87 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
88 |
&print_msg (sprintf ("%-31s ", $spec_file_base)); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
89 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
90 |
if (! -e $spec_file) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
91 |
&print_msg ("ERROR: no such spec file: $spec_file\n"); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
92 |
return 0; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
93 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
94 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
95 |
if (! -w $spec_file) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
96 |
&print_msg ("ERROR: unable to write to spec file: $spec_file\n"); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
97 |
return 0; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
98 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
99 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
100 |
if (-e $temp_file) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
101 |
if (unlink ($temp_file) != 1) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
102 |
&print_msg ("ERROR: Cannot delete old temp file $temp_file: $!\n"); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
103 |
return 0; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
104 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
105 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
106 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
107 |
if (! open (SPECFILE, $spec_file)) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
108 |
&print_msg ("ERROR: Cannot read $spec_file: $!\n"); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
109 |
return 0; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
110 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
111 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
112 |
if (! open (TEMPFILE, ">$temp_file")) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
113 |
&print_msg ("ERROR: Cannot create $temp_file: $!\n"); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
114 |
return 0; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
115 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
116 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
117 |
while (<SPECFILE>) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
118 |
/^(release\s*:\s*)(\S*)(\s*)$/i && do { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
119 |
my $label = $1; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
120 |
my $rel = $2; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
121 |
my $tail = $3; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
122 |
my $lead = ""; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
123 |
my $newrel; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
124 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
125 |
$found = 1; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
126 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
127 |
# if Release value does not consist entirely of digits, |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
128 |
# then check for leading chars ending with digits |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
129 |
if ($rel !~ /^\d+$/) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
130 |
if ($rel =~ /^(.*\D+)(\d+)$/) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
131 |
$lead = $1; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
132 |
$rel = $2; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
133 |
} else { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
134 |
&print_msg ("ERROR: non-numeric Release: $rel\n"); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
135 |
close (SPECFILE); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
136 |
close (TEMPFILE); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
137 |
return 0; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
138 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
139 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
140 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
141 |
&print_msg (sprintf ("%7s ", "$lead$rel")); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
142 |
$newrel = $rel + 1; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
143 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
144 |
if (length ($build) && ($newrel < $build)) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
145 |
$newrel = $build; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
146 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
147 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
148 |
&print_msg (sprintf ("%7s ", "$lead$newrel")); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
149 |
print TEMPFILE "$label$lead$newrel$tail"; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
150 |
next; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
151 |
}; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
152 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
153 |
# print all other lines unmodified |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
154 |
print TEMPFILE $_; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
155 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
156 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
157 |
close (TEMPFILE); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
158 |
close (SPECFILE); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
159 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
160 |
if (! $found) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
161 |
&print_msg ("ERROR: no Release value in spec file\n"); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
162 |
return 0; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
163 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
164 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
165 |
$out = `cp $temp_file $spec_file`; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
166 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
167 |
if ($?) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
168 |
&print_msg ("ERROR: \"cp $temp_file $spec_file\": $out"); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
169 |
return 0; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
170 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
171 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
172 |
unlink ($temp_file); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
173 |
&print_msg ("OK\n"); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
174 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
175 |
return 1; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
176 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
177 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
178 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
179 |
sub main |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
180 |
{ |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
181 |
&process_options (); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
182 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
183 |
if (! @spec_files) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
184 |
&print_msg ("Nothing to do.\n"); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
185 |
return; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
186 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
187 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
188 |
&print_msg ("Spec file Release New Rel Status\n"); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
189 |
&print_msg ("=============================== ======= ======= =======\n"); |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
190 |
|
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
191 |
foreach (@spec_files) { |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
192 |
&up_rev ($_) || $exit_val++; |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
193 |
} |
42ba809d7b77
build helper script to increment the Release numbers in .spec files
dermotm
parents:
diff
changeset
|
194 |
} |