swh:1:snp:a72e953ecd624a7df6e6196bbdd05851996c5e40
Raw File
Tip revision: 9058264a69f9efc1af805c4473c946f87859b731 authored by Kristoffer Carlsson on 19 December 2021, 12:30:42 UTC
release-1.6: Set VERSION to 1.6.5 (#43397)
Tip revision: 9058264
relative_path.py
import sys, os
if len(sys.argv) != 3:
    sys.stderr.write("\nrelative_path.py - incomplete arguments: %s\n"%(sys.argv))
    sys.exit(1)

# We always use `/` as the path separator, no matter what OS we're running on, since our
# shells and whatnot during the build are all POSIX shells/cygwin.  We rely on the build
# system itself to canonicalize to `\` when it needs to, and deal with the shell escaping
# and whatnot at the latest possible moment.
sys.stdout.write(os.path.relpath(sys.argv[2], sys.argv[1]).replace(os.path.sep, '/'))
back to top