from daklib.packagelist import PackageList
import daklib.announce
+import daklib.utils
# Globals
Options = None
return get_mapped_component(component_name, session=session)
def is_debug_binary(db_binary):
- return db_binary.proxy['Section'] == "debug"
+ return daklib.utils.is_in_debug_section(db_binary.proxy)
def has_debug_binaries(upload):
return any((is_debug_binary(x) for x in upload.binaries))
db_binaries = []
for binary in self.changes.binaries:
copy_to_suite = suite
- if binary.is_debug() and suite.debug_suite is not None:
+ if utils.is_in_debug_section(binary.control) and suite.debug_suite is not None:
copy_to_suite = suite.debug_suite
component = binary_component_func(binary)
@type: dict-like
"""
- def is_debug(self):
- return self.section == "debug"
-
@classmethod
def from_file(cls, directory, filename):
hashed_file = HashedFile.from_file(directory, filename)
raise InvalidBinaryException('{0}: Does not match re_file_binary'.format(self.hashed_file.filename))
return match.group('type')
- @property
- def section(self):
- """section name
- @type: str
- """
- return self.control['Section'].split('/', 1)[-1]
-
@property
def component(self):
"""component name
bu.append((source_name, source_version))
return bu
+
+################################################################################
+
+def is_in_debug_section(control):
+ """binary package is a debug package
+
+ @type control: dict-like
+ @param control: control file of binary package
+
+ @rtype Boolean
+ @return: True if the binary package is a debug package
+ """
+ section = control['Section'].split('/', 1)[-1]
+ return section == "debug"