aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdano Arendartchuk <bogdano@mandriva.org>2007-05-08 19:00:31 +0000
committerBogdano Arendartchuk <bogdano@mandriva.org>2007-05-08 19:00:31 +0000
commiteecca989feb2fd9ca8edff1a26c2f8ac6e7c54f4 (patch)
tree8e9b47fc08914506e5047aab367c90263d72becb
parent1e082d77b7d44682d6a41c5cf53cc0b132fb5765 (diff)
downloadmgarepo-eecca989feb2fd9ca8edff1a26c2f8ac6e7c54f4.tar
mgarepo-eecca989feb2fd9ca8edff1a26c2f8ac6e7c54f4.tar.gz
mgarepo-eecca989feb2fd9ca8edff1a26c2f8ac6e7c54f4.tar.bz2
mgarepo-eecca989feb2fd9ca8edff1a26c2f8ac6e7c54f4.tar.xz
mgarepo-eecca989feb2fd9ca8edff1a26c2f8ac6e7c54f4.zip
Show epoch of the release in changelog, even when it has not been
markreleased yet.
-rw-r--r--RepSys/log.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/RepSys/log.py b/RepSys/log.py
index 785214e..138918f 100644
--- a/RepSys/log.py
+++ b/RepSys/log.py
@@ -65,7 +65,7 @@ def getrelease(pkgdirurl, rev=None, macros=[]):
if found:
specpath = found[0]
options = rpm_macros_defs(macros)
- command = (("rpm -q --qf '%%{VERSION}-%%{RELEASE}\n' "
+ command = (("rpm -q --qf '%%{EPOCH}:%%{VERSION}-%%{RELEASE}\n' "
"--specfile %s %s 2>/dev/null") %
(specpath, options))
status, output = execcmd(command)
@@ -73,11 +73,17 @@ def getrelease(pkgdirurl, rev=None, macros=[]):
raise Error, "Error in command %s: %s" % (command, output)
releases = output.split()
try:
- version, release = releases[0].split("-", 1)
+ epoch, vr = releases[0].split(":", 1)
+ version, release = vr.split("-", 1)
except ValueError:
raise Error, "Invalid command output: %s: %s" % \
(command, output)
- return version, release
+ #XXX check if this is the right way:
+ if epoch == "(none)":
+ ev = version
+ else:
+ ev = epoch + ":" + version
+ return ev, release
finally:
if os.path.isdir(tmpdir):
shutil.rmtree(tmpdir)
41 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
package partition_table::dos;

use diagnostics;
use strict;
use vars qw(@ISA);

@ISA = qw(partition_table::raw);

use common;
use partition_table::raw;
use partition_table;
use fs::type;
use c;

my @fields = qw(active start_head start_sec start_cyl pt_type end_head end_sec end_cyl start size);
my $format = "C8 V2";
my $magic = "\x55\xAA";
my $nb_primary = 4;

my $offset = $common::SECTORSIZE - length($magic) - $nb_primary * common::psizeof($format);

sub use_pt_type { 1 }
sub hasExtended { 1 }

sub geometry_to_string {
    my ($geom) = @_;
    "$geom->{cylinders}/$geom->{heads}/$geom->{sectors}";
}

sub last_usable_sector { 
    my ($hd) = @_;
    #- do not use totalsectors, see docs/Partition-ends-after-end-of-disk.txt for more