summaryrefslogtreecommitdiff
path: root/scripts/image-build
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-04-13 19:49:59 +0000
committerChristian Breunig <christian@breunig.cc>2024-05-05 15:10:02 +0200
commitf257039bdfdd7258e964ee49ee296055c716e98c (patch)
treebcb9ec7e1007e797a264bfd69bc5d53657337e96 /scripts/image-build
parent7c88ff5800d63b40187e1368e08c95b8d53a74a4 (diff)
downloadvyos-build-f257039bdfdd7258e964ee49ee296055c716e98c.tar.gz
vyos-build-f257039bdfdd7258e964ee49ee296055c716e98c.zip
build: T3664: filter out non-TOML files from the build flavor dir
to avoid mistakenly listing auixilliary files like README as flavors (cherry picked from commit c07268987cb4f55a35240972e672e7d809f7ef4a)
Diffstat (limited to 'scripts/image-build')
-rwxr-xr-xscripts/image-build/build-vyos-image8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/image-build/build-vyos-image b/scripts/image-build/build-vyos-image
index 229bc2bc..f213767c 100755
--- a/scripts/image-build/build-vyos-image
+++ b/scripts/image-build/build-vyos-image
@@ -150,7 +150,7 @@ if __name__ == "__main__":
flavor_dir = defaults.BUILD_FLAVORS_DIR
print(f"I: using build flavors directory {flavor_dir}")
- build_flavors = list(map(lambda f: os.path.splitext(f)[0], os.listdir(flavor_dir)))
+ build_flavors = [f[0] for f in map(os.path.splitext, os.listdir(flavor_dir)) if (f[1] == ".toml")]
## Set up the option parser
## XXX: It uses values from the default configuration file for its option defaults,
@@ -346,9 +346,9 @@ if __name__ == "__main__":
if git_branch is None:
git_branch = repo.active_branch.name
except Exception as e:
- exit(f'Could not retrieve information from git: {repr(e)}')
- build_git = ""
- git_branch = ""
+ print(f'W: Could not retrieve information from git: {repr(e)}')
+ build_git = ""
+ git_branch = ""
# Create the build version string
if build_config['build_type'] == 'development':