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