Skip to content

Commit 153b5bd

Browse files
committed
Fix mixed cname with separate version argument parsing
Signed-off-by: Tobias Wolf <[email protected]>
1 parent acd4782 commit 153b5bd

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/gardenlinux/features/__main__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ def main() -> None:
7474
if args.arch is not None:
7575
arch = args.arch
7676

77+
if gardenlinux_root == "":
78+
gardenlinux_root = "."
79+
7780
if args.version is not None:
7881
version = args.version
7982

@@ -106,12 +109,6 @@ def main() -> None:
106109

107110
feature_dir_name = path.basename(args.feature_dir)
108111

109-
if gardenlinux_root == "":
110-
gardenlinux_root = "."
111-
112-
if gardenlinux_root == "":
113-
gardenlinux_root = "."
114-
115112
additional_filter_func = lambda node: node not in args.ignore
116113

117114
if args.type == "arch":

src/gardenlinux/features/cname.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,18 @@ def __init__(self, cname, arch=None, version=None):
6363
if self._arch is None and arch is not None:
6464
self._arch = arch
6565

66+
print("---")
6667
if self._version is None and version is not None:
68+
print("-r-")
6769
re_match = re.match("([a-z0-9.]+)(-([a-z0-9]+))?$", version)
6870
assert re_match, f"Not a valid version {version}"
6971

7072
self._commit_id = re_match[3]
7173
self._version = re_match[1]
74+
print("---")
75+
print(self._commit_id)
76+
print(self._version)
77+
print("---")
7278

7379
@property
7480
def arch(self) -> Optional[str]:

src/gardenlinux/features/cname_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def main():
5151
if args.arch is not None:
5252
arch = args.arch
5353

54-
if args.version is not None:
55-
version = args.version
54+
if gardenlinux_root == "":
55+
gardenlinux_root = "."
5656

5757
if not version:
5858
version_data = get_version_and_commit_id_from_files(gardenlinux_root)

0 commit comments

Comments
 (0)