--package-format for backwards and futurewards compatibility (as in EMC) headaches.
This commit is contained in:
+17
-8
@@ -557,6 +557,7 @@ class Builder:
|
||||
metadata.package.distribution = ctx.config.values.general.distribution
|
||||
metadata.package.distributionRelease = ctx.config.values.general.distribution_release
|
||||
metadata.package.architecture = "Any"
|
||||
metadata.package.packageFormat = ctx.get_option('package_format')
|
||||
|
||||
size = 0
|
||||
if package.debug_package:
|
||||
@@ -801,14 +802,22 @@ class Builder:
|
||||
# created files.xml
|
||||
files = Files()
|
||||
files.read(ctx.const.files_xml)
|
||||
tar = archive.ArchiveTar("install.tar.lzma", "tarlzma")
|
||||
for finfo in files.list:
|
||||
orgname = arcname = join("install", finfo.path)
|
||||
if package.debug_package:
|
||||
orgname = join("debug", finfo.path)
|
||||
tar.add_to_archive(orgname, arcname.lstrip("install"))
|
||||
tar.close()
|
||||
pkg.add_to_package("install.tar.lzma")
|
||||
|
||||
if ctx.get_option('package_format') == "1.1":
|
||||
tar = archive.ArchiveTar("install.tar.lzma", "tarlzma")
|
||||
for finfo in files.list:
|
||||
orgname = arcname = join("install", finfo.path)
|
||||
if package.debug_package:
|
||||
orgname = join("debug", finfo.path)
|
||||
tar.add_to_archive(orgname, arcname.lstrip("install"))
|
||||
tar.close()
|
||||
pkg.add_to_package("install.tar.lzma")
|
||||
else:
|
||||
for finfo in files.list:
|
||||
orgname = arcname = join("install", finfo.path)
|
||||
if package.debug_package:
|
||||
orgname = join("debug", finfo.path)
|
||||
pkg.add_to_package(orgname, arcname)
|
||||
|
||||
pkg.close()
|
||||
os.chdir(c)
|
||||
|
||||
@@ -356,6 +356,8 @@ unpack, setup, build, install, package
|
||||
|
||||
steps = ('unpack', 'setup', 'build', 'install', 'package')
|
||||
|
||||
package_formats = ('1.0', '1.1')
|
||||
|
||||
def options(self):
|
||||
buildno_opts(self)
|
||||
abandoned_files_opt(self)
|
||||
@@ -377,6 +379,8 @@ unpack, setup, build, install, package
|
||||
default=False, help=_("don't create a debug package with debug files"))
|
||||
self.parser.add_option("", "--no-install", action="store_true",
|
||||
default=False, help=_("don't install build dependencies, fail if a build dependency is present"))
|
||||
self.parser.add_option("-F", "--package-format", action="store", default='1.1',
|
||||
help=_("pisi package format"))
|
||||
|
||||
def run(self):
|
||||
if not self.args:
|
||||
@@ -394,6 +398,9 @@ unpack, setup, build, install, package
|
||||
else:
|
||||
self.init()
|
||||
|
||||
if ctx.get_option('package_format') not in Build.package_formats:
|
||||
raise Error(_('package_format must be one of %s ') % pisi.util.strlist(Build.package_formats))
|
||||
|
||||
if ctx.get_option('output_dir'):
|
||||
ctx.ui.info(_('Output directory: %s') % ctx.config.options.output_dir)
|
||||
else:
|
||||
|
||||
@@ -49,6 +49,7 @@ class Package(specfile.Package):
|
||||
t_InstalledSize = [ autoxml.Long, autoxml.mandatory]
|
||||
t_PackageSize = [ autoxml.Long, autoxml.optional]
|
||||
t_PackageURI = [ autoxml.String, autoxml.optional]
|
||||
t_PackageFormat = [ autoxml.String, autoxml.optional]
|
||||
|
||||
t_Source = [ Source, autoxml.optional]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user