* get directory from pkg_debug_dir() for generated debug packages.

This complements commits 7381, 7384, 7386, 7388 and fixes #2643.
This commit is contained in:
Faik Uygur
2006-05-02 12:18:30 +00:00
parent a0942bd890
commit 7c2774f50c
2 changed files with 21 additions and 5 deletions
+17 -5
View File
@@ -511,7 +511,7 @@ class Builder:
def generate_debug_package_object(self): def generate_debug_package_object(self):
debug_files = [] debug_files = []
for root, dirs, files in os.walk(self.pkg_install_dir()): for root, dirs, files in os.walk(self.pkg_debug_dir()):
for f in files: for f in files:
if f.endswith(ctx.const.debug_file_suffix): if f.endswith(ctx.const.debug_file_suffix):
debug_files.append(util.join_path(root, f)) debug_files.append(util.join_path(root, f))
@@ -520,13 +520,14 @@ class Builder:
return None return None
static_package_obj = pisi.specfile.Package() static_package_obj = pisi.specfile.Package()
static_package_obj.debug_package = True
static_package_obj.name = self.spec.source.name + ctx.const.debug_name_suffix static_package_obj.name = self.spec.source.name + ctx.const.debug_name_suffix
# FIXME: find a better way to deal with the summary and description constants. # FIXME: find a better way to deal with the summary and description constants.
static_package_obj.summary['en'] = u'Debug files for %s' % (self.spec.source.name) static_package_obj.summary['en'] = u'Debug files for %s' % (self.spec.source.name)
static_package_obj.description['en'] = u'Debug files for %s' % (self.spec.source.name) static_package_obj.description['en'] = u'Debug files for %s' % (self.spec.source.name)
static_package_obj.partOf = 'library:debug' static_package_obj.partOf = 'library:debug'
for f in debug_files: for f in debug_files:
static_package_obj.files.append(pisi.specfile.Path(path = f[len(self.pkg_install_dir()):], fileType = "debug")) static_package_obj.files.append(pisi.specfile.Path(path = f[len(self.pkg_debug_dir()):], fileType = "debug"))
# append all generated packages to dependencies # append all generated packages to dependencies
for p in self.spec.packages: for p in self.spec.packages:
@@ -557,7 +558,11 @@ class Builder:
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"
size, d = 0, self.pkg_install_dir() size = 0
if package.debug_package:
d = self.pkg_debug_dir()
else:
d = self.pkg_install_dir()
for path in package.files: for path in package.files:
for p in glob.glob(util.join_path(d, path.path)): for p in glob.glob(util.join_path(d, path.path)):
@@ -586,7 +591,11 @@ class Builder:
"""Generates files.xml using the path definitions in specfile and """Generates files.xml using the path definitions in specfile and
the files produced by the build system.""" the files produced by the build system."""
files = Files() files = Files()
install_dir = self.pkg_install_dir()
if package.debug_package:
install_dir = self.pkg_debug_dir()
else:
install_dir = self.pkg_install_dir()
# FIXME: We need to expand globs before trying to calculate hashes # FIXME: We need to expand globs before trying to calculate hashes
# Not on the fly like now. # Not on the fly like now.
@@ -796,7 +805,10 @@ class Builder:
files = Files() files = Files()
files.read(ctx.const.files_xml) files.read(ctx.const.files_xml)
for finfo in files.list: for finfo in files.list:
pkg.add_to_package(join("install", finfo.path)) 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)
+4
View File
@@ -181,6 +181,10 @@ class Package:
t_AdditionalFiles = [ [AdditionalFile], autoxml.optional] t_AdditionalFiles = [ [AdditionalFile], autoxml.optional]
t_History = [ [Update], autoxml.optional] t_History = [ [Update], autoxml.optional]
# FIXME: needed in build process, to distinguish dynamically generated debug packages.
# find a better way to do this.
debug_package = False
def runtimeDependencies(self): def runtimeDependencies(self):
deps = self.packageDependencies deps = self.packageDependencies
deps += [ ctx.componentdb.get_component[x].packages for x in self.componentDependencies ] deps += [ ctx.componentdb.get_component[x].packages for x in self.componentDependencies ]