1 |
On Tue, 19 May 2020 20:42:18 -0700 |
2 |
Matt Turner <mattst88@g.o> wrote: |
3 |
|
4 |
> This does not seem like a useful feature to me. |
5 |
> |
6 |
> Signed-off-by: Matt Turner <mattst88@g.o> |
7 |
> --- |
8 |
> catalyst/base/stagebase.py | 3 --- |
9 |
> catalyst/defaults.py | 1 - |
10 |
> catalyst/support.py | 6 +++--- |
11 |
> etc/catalyst.conf | 12 ------------ |
12 |
> 4 files changed, 3 insertions(+), 19 deletions(-) |
13 |
> |
14 |
> diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py |
15 |
> index f39895fe..febaf969 100644 |
16 |
> --- a/catalyst/base/stagebase.py |
17 |
> +++ b/catalyst/base/stagebase.py |
18 |
> @@ -130,8 +130,6 @@ class StageBase(TargetBase, ClearBase, GenBase): |
19 |
> decomp_opt=self.settings["decomp_opt"]) |
20 |
> self.accepted_extensions = |
21 |
> self.decompressor.search_order_extensions( |
22 |
> self.settings["decompressor_search_order"]) |
23 |
> - log.notice("Source file specification matching setting is: |
24 |
> %s", |
25 |
> - self.settings["source_matching"]) |
26 |
> log.notice("Accepted source file extensions search order: |
27 |
> %s", self.accepted_extensions) |
28 |
> # save resources, it is not always needed |
29 |
> @@ -409,7 +407,6 @@ class StageBase(TargetBase, ClearBase, GenBase): |
30 |
> normpath(self.settings["storedir"] + "/builds/" + |
31 |
> self.settings["source_subpath"]), |
32 |
> self.accepted_extensions, |
33 |
> - self.settings["source_matching"] in ["strict"] |
34 |
> ) |
35 |
> log.debug('Source path returned from file_check is: %s', |
36 |
> self.settings["source_path"]) |
37 |
> diff --git a/catalyst/defaults.py b/catalyst/defaults.py |
38 |
> index 412cb956..14f671fe 100644 |
39 |
> --- a/catalyst/defaults.py |
40 |
> +++ b/catalyst/defaults.py |
41 |
> @@ -45,7 +45,6 @@ confdefaults = { |
42 |
> "repos": "%(storedir)s/repos", |
43 |
> "sharedir": "/usr/share/catalyst", |
44 |
> "shdir": "%(sharedir)s/targets", |
45 |
> - "source_matching": "strict", |
46 |
> "storedir": "/var/tmp/catalyst", |
47 |
> "target_distdir": "/var/cache/distfiles", |
48 |
> "target_pkgdir": "/var/cache/binpkgs", |
49 |
> diff --git a/catalyst/support.py b/catalyst/support.py |
50 |
> index c4a5c797..a6a6854a 100644 |
51 |
> --- a/catalyst/support.py |
52 |
> +++ b/catalyst/support.py |
53 |
> @@ -59,7 +59,7 @@ def cmd(mycmd, env=None, debug=False, |
54 |
> fail_func=None): print_traceback=False) |
55 |
> |
56 |
> |
57 |
> -def file_check(filepath, extensions=None, strict=True): |
58 |
> +def file_check(filepath, extensions=None): |
59 |
> '''Check for the files existence and that only one exists |
60 |
> if others are found with various extensions |
61 |
> ''' |
62 |
> @@ -73,8 +73,8 @@ def file_check(filepath, extensions=None, |
63 |
> strict=True): ".CONTENTS") and not x.endswith(".CONTENTS.gz") and not |
64 |
> x.endswith(".DIGESTS")] if len(files) == 1: |
65 |
> return files[0] |
66 |
> - if len(files) > 1 and strict: |
67 |
> - msg = "Ambiguos Filename: %s\nPlease specify the correct |
68 |
> extension as well" % filepath |
69 |
> + if len(files) > 1: |
70 |
> + msg = "Ambiguous Filename: %s\nPlease specify the correct |
71 |
> extension as well" % filepath raise CatalystError(msg, |
72 |
> print_traceback=False) target_file = None |
73 |
> for ext in extensions: |
74 |
|
75 |
|
76 |
I find this strict/loose option useful for testing various changes. |
77 |
I have my config set to loose. That way I can change compressors at |
78 |
will without changing spec file or deleting files, or editing the spec |
79 |
to specify the extension. |
80 |
|
81 |
While I find it useful. It may not be for most users. I would be ok |
82 |
with this if the others agree. Otherwise, this is not complex code to |
83 |
maintain. In fact is barely any code at all. |
84 |
|
85 |
|
86 |
|
87 |
|
88 |
> diff --git a/etc/catalyst.conf b/etc/catalyst.conf |
89 |
> index f64fe971..d33be15f 100644 |
90 |
> --- a/etc/catalyst.conf |
91 |
> +++ b/etc/catalyst.conf |
92 |
> @@ -50,18 +50,6 @@ envscript="/etc/catalyst/catalystrc" |
93 |
> # (These options can be used together) |
94 |
> options="autoresume bindist kerncache pkgcache seedcache" |
95 |
> |
96 |
> -# source_matching specifies how catalyst will match non-specific |
97 |
> file names -# if the filename is not found as an exact match. |
98 |
> -# ie: a filename without the extension specified. "/path/to/foo" |
99 |
> -# |
100 |
> -# possible values are: |
101 |
> -# "strict" meaning if more than one file of that name is present |
102 |
> with any -# file extension, then it will raise an |
103 |
> exception. -# "loose" meaning it will search for an existing |
104 |
> filename with an added -# extension from an ordered list |
105 |
> of extensions determined from the -# |
106 |
> decompressor_search_order specification in the spec file or (default) |
107 |
> -source_matching="strict" - |
108 |
> # port_logdir is where all build logs will be kept. This dir will be |
109 |
> automatically cleaned # of all logs over 30 days old. If left |
110 |
> undefined the logs will remain in the build directory # as usual and |
111 |
> get cleaned every time a stage build is restarted. |