mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
T6173: validate allowed characters in ISO image name
Building custom VyOS version: 1.5-asdf%-202404081841 I: Checking if packages required for VyOS image build are installed Version contained illegal character(s), allowed: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-+
This commit is contained in:
parent
0c12b79fd8
commit
611cfc85c5
@ -28,6 +28,7 @@ import platform
|
||||
import argparse
|
||||
import datetime
|
||||
import functools
|
||||
import string
|
||||
|
||||
import json
|
||||
|
||||
@ -227,6 +228,13 @@ if __name__ == "__main__":
|
||||
print("Use --build-type=release option if you want to set version number")
|
||||
sys.exit(1)
|
||||
|
||||
# Validate characters in version name
|
||||
if 'version' in args:
|
||||
allowed = string.ascii_letters + string.digits + '.' + '-' + '+'
|
||||
if not set(args['version']) <= set(allowed):
|
||||
print(f'Version contained illegal character(s), allowed: {allowed}')
|
||||
sys.exit(1)
|
||||
|
||||
## Inject some useful hardcoded options
|
||||
args['build_dir'] = defaults.BUILD_DIR
|
||||
args['pbuilder_config'] = os.path.join(defaults.BUILD_DIR, defaults.PBUILDER_CONFIG)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user