mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-26 06:46:13 +01:00
take epoch into account when calculating the filename
ArchLinux has the epoch in the canonname, Debian discusses doing this as well.
This commit is contained in:
parent
f20b26007e
commit
42c357336e
@ -177,7 +177,7 @@ class Pac:
|
||||
|
||||
self.mp = {}
|
||||
for i in ['binary', 'package',
|
||||
'version', 'release',
|
||||
'epoch', 'version', 'release',
|
||||
'project', 'repository',
|
||||
'preinstall', 'vminstall', 'noinstall', 'installonly', 'runscripts',
|
||||
]:
|
||||
@ -209,11 +209,11 @@ class Pac:
|
||||
self.mp['apiurl'] = apiurl
|
||||
|
||||
if pacsuffix == 'deb':
|
||||
filename = debquery.DebQuery.filename(self.mp['name'], self.mp['version'], self.mp['release'], self.mp['arch'])
|
||||
filename = debquery.DebQuery.filename(self.mp['name'], self.mp['epoch'], self.mp['version'], self.mp['release'], self.mp['arch'])
|
||||
elif pacsuffix == 'arch':
|
||||
filename = archquery.ArchQuery.filename(self.mp['name'], self.mp['version'], self.mp['release'], self.mp['arch'])
|
||||
filename = archquery.ArchQuery.filename(self.mp['name'], self.mp['epoch'], self.mp['version'], self.mp['release'], self.mp['arch'])
|
||||
else:
|
||||
filename = rpmquery.RpmQuery.filename(self.mp['name'], self.mp['version'], self.mp['release'], self.mp['arch'])
|
||||
filename = rpmquery.RpmQuery.filename(self.mp['name'], self.mp['epoch'], self.mp['version'], self.mp['release'], self.mp['arch'])
|
||||
|
||||
self.mp['filename'] = node.get('binary') or filename
|
||||
if self.mp['repopackage'] == '_repository':
|
||||
|
@ -148,7 +148,12 @@ class ArchQuery(packagequery.PackageQuery):
|
||||
return cmp(ver1, ver2)
|
||||
|
||||
@staticmethod
|
||||
def filename(name, version, release, arch):
|
||||
def filename(name, epoch, version, release, arch):
|
||||
if epoch:
|
||||
if release:
|
||||
return '%s-%s:%s-%s-%s.arch' % (name, epoch, version, release, arch)
|
||||
else:
|
||||
return '%s-%s:%s-%s.arch' % (name, epoch, version, arch)
|
||||
if release:
|
||||
return '%s-%s-%s-%s.arch' % (name, version, release, arch)
|
||||
else:
|
||||
|
@ -116,7 +116,7 @@ class DebQuery(packagequery.PackageQuery):
|
||||
return self.fields.get(num, None)
|
||||
|
||||
def canonname(self):
|
||||
return DebQuery.filename(self.name(), self.version(), self.release(), self.arch())
|
||||
return DebQuery.filename(self.name(), self.epoch(), self.version(), self.release(), self.arch())
|
||||
|
||||
@staticmethod
|
||||
def query(filename, all_tags = False, *extra_tags):
|
||||
@ -161,7 +161,7 @@ class DebQuery(packagequery.PackageQuery):
|
||||
return 0
|
||||
|
||||
@staticmethod
|
||||
def filename(name, version, release, arch):
|
||||
def filename(name, epoch, version, release, arch):
|
||||
if release:
|
||||
return '%s_%s-%s_%s.deb' % (name, version, release, arch)
|
||||
else:
|
||||
|
@ -240,7 +240,7 @@ class RpmQuery(packagequery.PackageQuery):
|
||||
arch = 'src'
|
||||
else:
|
||||
arch = self.arch()
|
||||
return RpmQuery.filename(self.name(), self.version(), self.release(), arch)
|
||||
return RpmQuery.filename(self.name(), None, self.version(), self.release(), arch)
|
||||
|
||||
@staticmethod
|
||||
def query(filename):
|
||||
@ -298,7 +298,7 @@ class RpmQuery(packagequery.PackageQuery):
|
||||
return cmp(ver1, ver2)
|
||||
|
||||
@staticmethod
|
||||
def filename(name, version, release, arch):
|
||||
def filename(name, epoch, version, release, arch):
|
||||
return '%s-%s-%s.%s.rpm' % (name, version, release, arch)
|
||||
|
||||
def unpack_string(data):
|
||||
|
Loading…
Reference in New Issue
Block a user