diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2019-06-06 09:05:12 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-06-06 19:15:04 +0300 |
commit | 27c5d9f16f535b2aacdf009744d4f99d59b9c81f (patch) | |
tree | 0550d61cfeb617b3a602b9470684d217ea0fe142 | |
parent | 5065db86f21f01d19a0b792bc8fb80389c8c2997 (diff) | |
download | meson-27c5d9f16f535b2aacdf009744d4f99d59b9c81f.zip meson-27c5d9f16f535b2aacdf009744d4f99d59b9c81f.tar.gz meson-27c5d9f16f535b2aacdf009744d4f99d59b9c81f.tar.bz2 |
gnome.yelp(): Fix media symlink fallback path
When the media file for a specific language doesn't exist we try to symlink
it to the C one. If symlinking fails we need to fall back to copying the C
one like in the non-symlink case.
The fallback code path didn't set the source so this always failed.
Also check if the C fallback exists before trying to symlink/copy, otherwise
we crash if C isn't the first lang we try.
-rw-r--r-- | mesonbuild/scripts/yelphelper.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/scripts/yelphelper.py b/mesonbuild/scripts/yelphelper.py index 0f8b0b8..95c8c9c 100644 --- a/mesonbuild/scripts/yelphelper.py +++ b/mesonbuild/scripts/yelphelper.py @@ -73,8 +73,9 @@ def install_help(srcdir, blddir, sources, media, langs, install_dir, destdir, pr for m in media: infile = os.path.join(srcdir, lang, m) outfile = os.path.join(indir, m) + c_infile = os.path.join(srcdir, 'C', m) if not os.path.exists(infile): - if lang == 'C': + if not os.path.exists(c_infile): mlog.warning('Media file "%s" did not exist in C directory' % m) continue elif symlinks: @@ -91,9 +92,10 @@ def install_help(srcdir, blddir, sources, media, langs, install_dir, destdir, pr continue except (NotImplementedError, OSError): mlog.warning('Symlinking not supported, falling back to copying') + infile = c_infile else: # Lang doesn't have media file so copy it over 'C' one - infile = os.path.join(srcdir, 'C', m) + infile = c_infile mlog.log('Installing %s to %s' % (infile, outfile)) if has_path_sep(m): os.makedirs(os.path.dirname(outfile), exist_ok=True) |