mirror of
https://github.com/clearlinux/bundle-chroot-builder.git
synced 2026-08-18 19:45:49 +00:00
Remove leading slash in os.path.join()
The os.path.join() function discard any previos paths/variables when it encounters one starting with a leading "/" so the statedir & bundle name were completely ignored when it ran into /usr/share/defaults/... This fixes it so the path is correctly made, and the dirs and files should be installed correctly. Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
This commit is contained in:
@@ -283,15 +283,13 @@ def create_chroots(args, state_dir, bundles, yum_conf):
|
||||
"""Read the configuration file for our script values"""
|
||||
conf = config['swupd']
|
||||
bundlename = conf['BUNDLE']
|
||||
url = conf['URL']
|
||||
contenturl = conf['CONTENTURL']
|
||||
versionurl = conf['VERSIONURL']
|
||||
formatname = conf['FORMAT']
|
||||
|
||||
confpath = os.path.join(out_dir, bundlename, "/usr/share/defaults/swupd/")
|
||||
"""Do not add a leading slash on anything except the first variable in os.path.join!"""
|
||||
confpath = os.path.join(out_dir, bundlename, "usr/share/defaults/swupd/")
|
||||
os.mkdir(confpath)
|
||||
with open(os.path.join(confpath, "url"), "w") as file:
|
||||
file.writelines(url)
|
||||
with open(os.path.join(confpath, "contenturl"), "w") as file:
|
||||
file.writelines(contenturl)
|
||||
with open(os.path.join(confpath, "versionurl"), "w") as file:
|
||||
|
||||
Reference in New Issue
Block a user