From 3f75132c8d6aecacf7e0b5d5b39da49e4954e0cf Mon Sep 17 00:00:00 2001 From: Packit Service Date: Feb 04 2021 16:12:20 +0000 Subject: Prepare for a new update Reverting patches so we can apply the latest update and changes can be seen in the spec file and sources. --- diff --git a/boom.spec b/boom.spec index 8adb368..a5797ed 100644 --- a/boom.spec +++ b/boom.spec @@ -2,7 +2,7 @@ %global sphinx_docs 1 Name: boom -Version: 1.2 +Version: 1.1 Release: 1%{?dist} Summary: %{summary} diff --git a/boom/__init__.py b/boom/__init__.py index 34f2d14..fa17610 100644 --- a/boom/__init__.py +++ b/boom/__init__.py @@ -35,6 +35,6 @@ from __future__ import print_function from ._boom import * from ._boom import __all__ -__version__ = "1.2" +__version__ = "1.1" # vim: set et ts=4 sw=4 : diff --git a/boom/command.py b/boom/command.py index c164b33..dc9abae 100644 --- a/boom/command.py +++ b/boom/command.py @@ -482,72 +482,24 @@ def _do_print_type(report_fields, selected, output_fields=None, return br.report_output() -def _merge_add_del_opts(bp, add_opts, del_opts): +def _merge_add_del_opts(orig_opts, opts): """Merge a set of existing bootparams option alterations with a set of command-line provided values to produce a single set of options to add or remove from a cloned or edited ``BootEntry``. + :param orig_opts: A list of original option modifications + :param opts: A space-separated string containing a list of + command line option modifications + :returns: A single list containing the merged options + """ + # Merge new and cloned kernel options + all_opts = set() + if opts: + all_opts.update(opts.split()) + if orig_opts: + all_opts.update(orig_opts) - The sets are merged giving precedence to alterations on the - current command line: i.e. if an option is present in both - ``bp.del_opts`` and ``add_opts`` (or vice versa) then the - option taken from the current command line will be effective. - - :param bp: A ``BootParams`` object with the original ``add_opts`` - and ``del_opts`` values. - :param add_opts: A space-separated string containing a list of - additional options taken from the current - command line. - :param del_opts: A space-separated string containing a list of - options to delete taken from the current - command line. - :returns: A tuple ``(effective_add_opts, effective_del_opts)`` - giving the final effective values as a list of - strings, one per option word. - """ - def _merge_opts(orig_opts, opts, r_opts): - # Merge new and cloned kernel options - all_opts = set() - if opts: - all_opts.update(opts) - if orig_opts: - all_opts.update(orig_opts) - all_opts = list(all_opts) - return [o for o in all_opts if o not in r_opts] - - _log_debug_cmd("Add opts: %s" % add_opts) - _log_debug_cmd("Del opts: %s" % del_opts) - _log_debug_cmd("Original add_opts: %s" % bp.add_opts) - _log_debug_cmd("Original del_opts: %s" % bp.del_opts) - - r_del_opts = [] - r_add_opts = [] - - add_opts = add_opts.split() if add_opts else [] - del_opts = del_opts.split() if del_opts else [] - - for add_opt in list(add_opts): - # Do not allow conflicting command line add/del opts - if add_opt in del_opts: - raise ValueError("Conflicting --add-opts %s and --del-opts %s" % - (add_opt, add_opt)) - - if add_opt in bp.del_opts: - r_del_opts.append(add_opt) - add_opts.remove(add_opt) - - for del_opt in list(del_opts): - if del_opt in bp.add_opts: - r_add_opts.append(del_opt) - del_opts.remove(del_opt) - - add_opts = _merge_opts(bp.add_opts, add_opts, r_add_opts) - del_opts = _merge_opts(bp.del_opts, del_opts, r_del_opts) - - _log_debug_cmd("Effective add options: %s" % add_opts) - _log_debug_cmd("Effective del options: %s" % del_opts) - - return (add_opts, del_opts) + return list(all_opts) # @@ -807,7 +759,10 @@ def clone_entry(selection=None, title=None, version=None, machine_id=None, else be.bp.btrfs_subvol_id) profile = profile if profile else be._osp - (add_opts, del_opts) = _merge_add_del_opts(be.bp, add_opts, del_opts) + add_opts = _merge_add_del_opts(be.bp.add_opts, add_opts) + del_opts = _merge_add_del_opts(be.bp.del_opts, del_opts) + _log_debug_cmd("Effective add options: %s" % add_opts) + _log_debug_cmd("Effective del options: %s" % del_opts) bp = BootParams(version, root_device, lvm_root_lv=lvm_root_lv, btrfs_subvol_path=btrfs_subvol_path, @@ -909,7 +864,10 @@ def edit_entry(selection=None, title=None, version=None, machine_id=None, machine_id = machine_id or be.machine_id version = version or be.version - (add_opts, del_opts) = _merge_add_del_opts(be.bp, add_opts, del_opts) + add_opts = _merge_add_del_opts(be.bp.add_opts, add_opts) + del_opts = _merge_add_del_opts(be.bp.del_opts, del_opts) + _log_debug_cmd("Effective add options: %s" % add_opts) + _log_debug_cmd("Effective del options: %s" % del_opts) be._osp = profile or be._osp be.title = title or be.title @@ -927,11 +885,6 @@ def edit_entry(selection=None, title=None, version=None, machine_id=None, be.initrd = _cache_image(be.initrd, images == I_BACKUP) be.linux = _cache_image(be.linux, images == I_BACKUP) - # Is the entry now identical to an existing entry? - if len(find_entries(Selection(boot_id=be.boot_id))) > 1: - raise ValueError("Entry already exists (boot_id=%s)." % - be.disp_boot_id) - be.update_entry(expand=expand) __write_legacy() @@ -2261,9 +2214,6 @@ def _edit_cmd(cmd_args, select, opts, identifier): profile = _find_profile(cmd_args, version, machine_id, "edit") - add_opts = cmd_args.add_opts - del_opts = cmd_args.del_opts - arch = cmd_args.architecture try: @@ -2272,7 +2222,6 @@ def _edit_cmd(cmd_args, select, opts, identifier): lvm_root_lv=lvm_root_lv, btrfs_subvol_path=btrfs_subvol_path, btrfs_subvol_id=btrfs_subvol_id, profile=profile, - add_opts=add_opts, del_opts=del_opts, architecture=arch, expand=cmd_args.expand_variables) except ValueError as e: print(e) diff --git a/doc/conf.py b/doc/conf.py index 043655b..cccdcfa 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -64,9 +64,9 @@ author = u'Bryn M. Reeves' # built documents. # # The short X.Y version. -version = u'1.2' +version = u'1.1' # The full version, including alpha/beta/rc tags. -release = u'1.2' +release = u'1.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/etc/default/boom b/etc/default/boom old mode 100644 new mode 100755 index 451cb37..cd5f772 --- a/etc/default/boom +++ b/etc/default/boom @@ -1,3 +1,3 @@ -BOOM_USE_SUBMENU="no" +BOOM_USE_SUBMENU="yes" BOOM_SUBMENU_NAME="Snapshots" -BOOM_ENABLE_GRUB="no" +BOOM_ENABLE_GRUB="yes" diff --git a/man/man8/boom.8 b/man/man8/boom.8 index 9eee048..7b862e7 100644 --- a/man/man8/boom.8 +++ b/man/man8/boom.8 @@ -1168,8 +1168,8 @@ describing the properties of the configured host profiles. The list of fields to display is given with \fB--options\fP as a comma separated list of field names. To obtain a list of available fields run -\&'\fBboom host list -o help\fP'. If the list of fields begins with the -\&'\fB+\fP' character the specified fields are appended to the default +'\fBboom host list -o help\fP'. If the list of fields begins with the +'\fB+\fP' character the specified fields are appended to the default field list. Otherwise the given list of fields replaces the default set of report fields. diff --git a/tests/bootloader_configs/boom_off/etc/default/boom b/tests/bootloader_configs/boom_off/etc/default/boom old mode 100644 new mode 100755 diff --git a/tests/bootloader_configs/boom_on/etc/default/boom b/tests/bootloader_configs/boom_on/etc/default/boom old mode 100644 new mode 100755 diff --git a/tests/bootloader_configs/no_grub_d/etc/default/boom b/tests/bootloader_configs/no_grub_d/etc/default/boom old mode 100644 new mode 100755 diff --git a/tests/command_tests.py b/tests/command_tests.py index b85b7dd..6d0c79b 100644 --- a/tests/command_tests.py +++ b/tests/command_tests.py @@ -520,44 +520,6 @@ class CommandTests(unittest.TestCase): self.assertFalse(exists(be._entry_path)) @unittest.skipIf(not have_root_lv(), "requires root LV") - def test_clone_entry_del_opts_and_re_add(self): - # Fedora 24 (Workstation Edition) - - # Delete rhgb quiet - osp = get_os_profile_by_id(test_os_id) - be = create_entry("delopts", "2.6.0", "ffffffff", test_lv, - lvm_root_lv=test_root_lv, profile=osp, - del_opts="rhgb quiet") - - # Assert it's gone - self.assertFalse("rhgb quiet" in be.options) - - be2 = clone_entry(Selection(boot_id=be.boot_id), title="addoptsclone", - add_opts="rhgb quiet") - - # Assert it's back - self.assertTrue("rhgb quiet" in be2.options) - - @unittest.skipIf(not have_root_lv(), "requires root LV") - def test_clone_entry_add_opts_and_re_del(self): - # Fedora 24 (Workstation Edition) - - # Add debug - osp = get_os_profile_by_id(test_os_id) - be = create_entry("addopts", "2.6.0", "ffffffff", test_lv, - lvm_root_lv=test_root_lv, profile=osp, - add_opts="debug") - - # Assert it's there - self.assertTrue("debug" in be.options) - - be2 = clone_entry(Selection(boot_id=be.boot_id), title="deloptsclone", - del_opts="debug") - - # Assert it's gone - self.assertFalse("debug" in be2.options) - - @unittest.skipIf(not have_root_lv(), "requires root LV") def test_clone_delete_entry(self): # Fedora 24 (Workstation Edition) osp = get_os_profile_by_id(test_os_id)