Skip to content

Commit

Permalink
Merge pull request #1404 from coolo/fix_sle_stagings
Browse files Browse the repository at this point in the history
pkglistgen: Treat stagings differently
  • Loading branch information
coolo committed Mar 9, 2018
2 parents 7484722 + fdef876 commit fe4edd6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkglistgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,7 @@ def update_and_solve_target(self, apiurl, target_project, target_config, main_re
self.copy_directory_contents(group_dir, product_dir,
['supportstatus.txt', 'groups.yml', 'package-groups.changes'])
self.change_extension(product_dir, '.spec.in', '.spec')
self.change_extension(product_dir, '.product.in', '.product')

self.options.input_dir = group_dir
self.options.output_dir = product_dir
Expand Down Expand Up @@ -1223,6 +1224,8 @@ def update_and_solve_target(self, apiurl, target_project, target_config, main_re

delete_kiwis = target_config.get('pkglistgen-delete-kiwis-{}'.format(opts.scope), '').split(' ')
self.unlink_list(product_dir, delete_kiwis)
if opts.scope == 'staging':
self.strip_medium_from_staging(product_dir)

spec_files = glob.glob(os.path.join(product_dir, '*.spec'))
if skip_release:
Expand Down Expand Up @@ -1297,6 +1300,16 @@ def solv_cache_update(self, apiurl, cache_dir_solv, target_project, family_last,

return prior

# staging projects don't need source and debug medium - and the glibc source
# rpm conflicts between standard and bootstrap_copy repository causing the
# product builder to fail
def strip_medium_from_staging(self, path):
medium = re.compile('name="(DEBUG|SOURCE)MEDIUM"')
for name in glob.glob(os.path.join(path, '*.kiwi')):
lines = open(name).readlines()
lines = [l for l in lines if not medium.search(l)]
open(name, 'w').writelines(lines)

def move_list(self, file_list, destination):
for name in file_list:
os.rename(name, os.path.join(destination, os.path.basename(name)))
Expand Down Expand Up @@ -1335,7 +1348,7 @@ def change_extension(self, path, original, final):

def multibuild_from_glob(self, destination, pathname):
root = ET.Element('multibuild')
for name in glob.glob(os.path.join(destination, pathname)):
for name in sorted(glob.glob(os.path.join(destination, pathname))):
package = ET.SubElement(root, 'package')
package.text = os.path.splitext(os.path.basename(name))[0]

Expand Down

0 comments on commit fe4edd6

Please sign in to comment.