[PATCH 1/2] valid_config_file_values: allow compression_mode

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/2] valid_config_file_values: allow compression_mode

Daniel Cordero
From: Daniel Cordero <[hidden email]>

Allow overriding compression mode globally from the catalyst config.

Otherwise, if one wanted a different compression method than the
default, one would need to add compression_mode to every spec file.
---
 catalyst/defaults.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index 14f671fe..c153fcc4 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -9,6 +9,7 @@ from DeComp.definitions import DECOMPRESSOR_PROGRAM_OPTIONS, LIST_XATTRS_OPTIONS
 
 
 valid_config_file_values = frozenset([
+    "compression_mode",
     "digests",
     "distdir",
     "envscript",
--
2.26.2


Reply | Threaded
Open this post in threaded view
|

[PATCH 2/2] Decompressor uses decompression options

Daniel Cordero
From: Daniel Cordero <[hidden email]>

If decompressor != compressor, the options given to the programs may not
be understood, causing runtime errors.

Allow the compression arguments to be overridden in a specfile.
Compressor can already be configured with compression_mode.

For decompression, while the decompressor is detected by the file
extension, use the separate decomp_opts so there is no argument
conflicts.
---
Note: compressor_options can't be empty, as catalyst just drops the key.

 catalyst/base/stagebase.py | 3 ++-
 catalyst/defaults.py       | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 5a8cd1df..6efcf0d1 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -48,6 +48,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
             "cflags",
             "common_flags",
             "compression_mode",
+            "compressor_options",
             "cxxflags",
             "decompressor_search_order",
             "distcc_hosts",
@@ -677,7 +678,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
             source=self.settings["source_path"],
             destination=self.settings["chroot_path"],
             arch=self.settings["compressor_arch"],
-            other_options=self.settings["compressor_options"],
+            other_options=self.settings["decomp_opt"],
         )
 
         display_msg = (
diff --git a/catalyst/defaults.py b/catalyst/defaults.py
index c153fcc4..fbf406b2 100644
--- a/catalyst/defaults.py
+++ b/catalyst/defaults.py
@@ -30,7 +30,7 @@ confdefaults = {
     "compression_mode": 'lbzip2',
     "compressor_arch": None,
     "compressor_options": XATTRS_OPTIONS['linux'],
-    "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS['linux'],
+    "decomp_opt": XATTRS_OPTIONS['linux'],
     "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER,
     "distdir": portage.settings['DISTDIR'],
     "icecream": "/var/cache/icecream",
--
2.26.2


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 2/2] Decompressor uses decompression options

Daniel Cordero
On Fri, May 29, 2020 at 07:04:32PM +0000, Daniel Cordero wrote:

>
> If decompressor != compressor, the options given to the programs may not
> be understood, causing runtime errors.
>
> Allow the compression arguments to be overridden in a specfile.
> Compressor can already be configured with compression_mode.
>
> For decompression, while the decompressor is detected by the file
> extension, use the separate decomp_opts so there is no argument
> conflicts.
> ---
> Note: compressor_options can't be empty, as catalyst just drops the key.
>
>  catalyst/base/stagebase.py | 3 ++-
>  catalyst/defaults.py       | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
> index 5a8cd1df..6efcf0d1 100644
> --- a/catalyst/base/stagebase.py
> +++ b/catalyst/base/stagebase.py
> @@ -48,6 +48,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
>              "cflags",
>              "common_flags",
>              "compression_mode",
> +            "compressor_options",
>              "cxxflags",
>              "decompressor_search_order",
>              "distcc_hosts",
> @@ -677,7 +678,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
>              source=self.settings["source_path"],
>              destination=self.settings["chroot_path"],
>              arch=self.settings["compressor_arch"],
> -            other_options=self.settings["compressor_options"],
> +            other_options=self.settings["decomp_opt"],
>          )
>  
>          display_msg = (

Speaking with some people in #gentoo-releng, this patch will break pixz
and lbzip2 decompression during the unpack stage. Will rework.

> diff --git a/catalyst/defaults.py b/catalyst/defaults.py
> index c153fcc4..fbf406b2 100644
> --- a/catalyst/defaults.py
> +++ b/catalyst/defaults.py
> @@ -30,7 +30,7 @@ confdefaults = {
>      "compression_mode": 'lbzip2',
>      "compressor_arch": None,
>      "compressor_options": XATTRS_OPTIONS['linux'],
> -    "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS['linux'],
> +    "decomp_opt": XATTRS_OPTIONS['linux'],
>      "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER,
>      "distdir": portage.settings['DISTDIR'],
>      "icecream": "/var/cache/icecream",
> --
> 2.26.2
>
>