diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-06-21 04:36:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-21 04:36:30 -0400 |
commit | 2d659b649bf43963791cc6e9896da6ef46370743 (patch) | |
tree | 333ef612d1677be434a06a40a1fb74a12d8d482f /mesonbuild/scripts/yelphelper.py | |
parent | f171faee32b877aec064a1bc4ab91adda632299d (diff) | |
parent | 733aee123d79e9540395150fb5aecc43dd46068b (diff) | |
download | meson-2d659b649bf43963791cc6e9896da6ef46370743.zip meson-2d659b649bf43963791cc6e9896da6ef46370743.tar.gz meson-2d659b649bf43963791cc6e9896da6ef46370743.tar.bz2 |
Merge pull request #1924 from mesonbuild/tingping/yelp-fixes
Various yelp fixes
Diffstat (limited to 'mesonbuild/scripts/yelphelper.py')
-rw-r--r-- | mesonbuild/scripts/yelphelper.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/mesonbuild/scripts/yelphelper.py b/mesonbuild/scripts/yelphelper.py index 47dfb71..978a870 100644 --- a/mesonbuild/scripts/yelphelper.py +++ b/mesonbuild/scripts/yelphelper.py @@ -74,13 +74,24 @@ def install_help(srcdir, blddir, sources, media, langs, install_dir, destdir, pr if not os.path.exists(infile): if lang == 'C': mlog.warning('Media file "%s" did not exist in C directory' % m) + continue elif symlinks: srcfile = os.path.join(c_install_dir, m) mlog.log('Symlinking %s to %s.' % (outfile, srcfile)) if '/' in m or '\\' in m: os.makedirs(os.path.dirname(outfile), exist_ok=True) - os.symlink(srcfile, outfile) - continue + try: + try: + os.symlink(srcfile, outfile) + except FileExistsError: + os.remove(outfile) + os.symlink(srcfile, outfile) + continue + except (NotImplementedError, OSError): + mlog.warning('Symlinking not supported, falling back to copying') + else: + # Lang doesn't have media file so copy it over 'C' one + infile = os.path.join(srcdir, 'C', m) mlog.log('Installing %s to %s' % (infile, outfile)) if '/' in m or '\\' in m: os.makedirs(os.path.dirname(outfile), exist_ok=True) |