mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-27 07:06:13 +01:00
- fixed #590611 ("'osc build' uses incorrect filename for debian debs")
This commit is contained in:
parent
56e728fc44
commit
af273d0bdb
@ -12,6 +12,7 @@ from tempfile import NamedTemporaryFile
|
|||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
from osc.fetch import *
|
from osc.fetch import *
|
||||||
from osc.core import get_buildinfo, store_read_apiurl, store_read_project, store_read_package, meta_exists, quote_plus, get_buildconfig, is_package_dir
|
from osc.core import get_buildinfo, store_read_apiurl, store_read_project, store_read_package, meta_exists, quote_plus, get_buildconfig, is_package_dir
|
||||||
|
from osc.util import rpmquery, debquery
|
||||||
import osc.conf
|
import osc.conf
|
||||||
import oscerr
|
import oscerr
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -165,10 +166,10 @@ class Pac:
|
|||||||
|
|
||||||
self.mp['apiurl'] = apiurl
|
self.mp['apiurl'] = apiurl
|
||||||
|
|
||||||
if self.mp['release']:
|
if pacsuffix == 'deb':
|
||||||
self.filename = '%(name)s-%(version)s-%(release)s.%(arch)s.%(pacsuffix)s' % self.mp
|
self.filename = debquery.DebQuery.filename(self.mp['name'], self.mp['version'], self.mp['release'], self.mp['arch'])
|
||||||
else:
|
else:
|
||||||
self.filename = '%(name)s-%(version)s.%(arch)s.%(pacsuffix)s' % self.mp
|
self.filename = rpmquery.RpmQuery.filename(self.mp['name'], self.mp['version'], self.mp['release'], self.mp['arch'])
|
||||||
|
|
||||||
self.mp['filename'] = self.filename
|
self.mp['filename'] = self.filename
|
||||||
if self.mp['repopackage'] == '_repository':
|
if self.mp['repopackage'] == '_repository':
|
||||||
|
@ -120,10 +120,7 @@ class Fetcher:
|
|||||||
arch = "nosrc"
|
arch = "nosrc"
|
||||||
else:
|
else:
|
||||||
arch = "src"
|
arch = "src"
|
||||||
if pkgq.release():
|
canonname = pkgq.canonname()
|
||||||
canonname = '%s-%s-%s.%s.%s' % (pkgq.name(), pkgq.version(), pkgq.release(), arch, pkgq.filename_suffix)
|
|
||||||
else:
|
|
||||||
canonname = '%s-%s.%s.%s' % (pkgq.name(), pkgq.version(), arch, pkgq.filename_suffix)
|
|
||||||
fullfilename = os.path.join(destdir, canonname)
|
fullfilename = os.path.join(destdir, canonname)
|
||||||
if pac_obj is not None:
|
if pac_obj is not None:
|
||||||
pac_obj.filename = canonname
|
pac_obj.filename = canonname
|
||||||
|
@ -107,6 +107,9 @@ class DebQuery(packagequery.PackageQuery):
|
|||||||
def gettag(self, num):
|
def gettag(self, num):
|
||||||
return self.fields.get(num, None)
|
return self.fields.get(num, None)
|
||||||
|
|
||||||
|
def canonname(self):
|
||||||
|
return DebQuery.filename(self.name(), self.version(), self.release(), self.arch())
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def query(filename, all_tags = False, *extra_tags):
|
def query(filename, all_tags = False, *extra_tags):
|
||||||
f = open(filename, 'rb')
|
f = open(filename, 'rb')
|
||||||
@ -149,6 +152,13 @@ class DebQuery(packagequery.PackageQuery):
|
|||||||
return -1
|
return -1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def filename(name, version, release, arch):
|
||||||
|
if release:
|
||||||
|
return '%s_%s-%s_%s.deb' % (name, version, release, arch)
|
||||||
|
else:
|
||||||
|
return '%s_%s_%s.deb' % (name, version, arch)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import sys
|
import sys
|
||||||
try:
|
try:
|
||||||
|
@ -79,6 +79,9 @@ class PackageQuery:
|
|||||||
def vercmp(self, pkgquery):
|
def vercmp(self, pkgquery):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def canonname(self):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def query(filename, all_tags = False, extra_rpmtags = (), extra_debtags = ()):
|
def query(filename, all_tags = False, extra_rpmtags = (), extra_debtags = ()):
|
||||||
f = open(filename, 'rb')
|
f = open(filename, 'rb')
|
||||||
|
@ -220,6 +220,9 @@ class RpmQuery(packagequery.PackageQuery):
|
|||||||
def gettag(self, num):
|
def gettag(self, num):
|
||||||
return self.header.gettag(num)
|
return self.header.gettag(num)
|
||||||
|
|
||||||
|
def canonname(self):
|
||||||
|
return RpmQuery.filename(self.name(), self.version(), self.release(), self.arch())
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def query(filename):
|
def query(filename):
|
||||||
f = open(filename, 'rb')
|
f = open(filename, 'rb')
|
||||||
@ -275,6 +278,10 @@ class RpmQuery(packagequery.PackageQuery):
|
|||||||
return -1
|
return -1
|
||||||
return cmp(ver1, ver2)
|
return cmp(ver1, ver2)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def filename(name, version, release, arch):
|
||||||
|
return '%s-%s-%s.%s.rpm' % (name, version, release, arch)
|
||||||
|
|
||||||
def unpack_string(data):
|
def unpack_string(data):
|
||||||
"""unpack a '\\0' terminated string from data"""
|
"""unpack a '\\0' terminated string from data"""
|
||||||
val = ''
|
val = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user