Skip to content
Snippets Groups Projects
Commit 558ede05 authored by Ludovico de Nittis's avatar Ludovico de Nittis
Browse files

generate-sysroots: Add ArgumentParser and handle FileExistsError for symlinks

parent 860ae417
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !115. Comments created here will be created in the context of that merge request.
......@@ -24,6 +24,22 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("path")
parser.add_argument('-i', '--install', action='store_true',
help='Install the sysroot in the provided [path], using $MESON_INSTALL_DESTDIR_PREFIX as a prefix')
args = parser.parse_args()
if args.install:
full_path = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], args.path.lstrip("/"))
else:
full_path = args.path
# If the chosen destination 'sysroot' is not yet available we create it
os.makedirs(full_path, mode=0o755, exist_ok=True)
os.chdir(full_path)
  • You could squash these changes into my commit too, and either attribute it to me Co-authored-by you, or the other way round.

  • Please register or sign in to reply
# Only the leaf directories need to be listed here.
for name in '''
......@@ -207,7 +223,10 @@ for name, target in {
'libvdpau_radeonsi.so.1.0.0',
}.items():
os.makedirs(os.path.dirname(name), mode=0o755, exist_ok=True)
os.symlink(target, name)
try:
os.symlink(target, name)
except FileExistsError:
pass
with open('debian10/usr/lib/os-release', 'w') as writer:
writer.write('''\
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment