diff options
Diffstat (limited to 'recipes/os-release')
-rw-r--r-- | recipes/os-release/os-release.bbappend | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/recipes/os-release/os-release.bbappend b/recipes/os-release/os-release.bbappend new file mode 100644 index 0000000..98e2d16 --- /dev/null +++ b/recipes/os-release/os-release.bbappend | |||
@@ -0,0 +1,39 @@ | |||
1 | ############################################################################## | ||
2 | ## | ||
3 | ## Copyright (C) 2016 The Qt Company Ltd. | ||
4 | ## Contact: http://www.qt.io/licensing/ | ||
5 | ## | ||
6 | ## This file is part of the Boot to Qt meta layer. | ||
7 | ## | ||
8 | ## $QT_BEGIN_LICENSE:COMM$ | ||
9 | ## | ||
10 | ## Commercial License Usage | ||
11 | ## Licensees holding valid commercial Qt licenses may use this file in | ||
12 | ## accordance with the commercial license agreement provided with the | ||
13 | ## Software or, alternatively, in accordance with the terms contained in | ||
14 | ## a written agreement between you and The Qt Company. For licensing terms | ||
15 | ## and conditions see http://www.qt.io/terms-conditions. For further | ||
16 | ## information use the contact form at http://www.qt.io/contact-us. | ||
17 | ## | ||
18 | ## $QT_END_LICENSE$ | ||
19 | ## | ||
20 | ############################################################################## | ||
21 | |||
22 | # Reported upstream https://bugzilla.yoctoproject.org/show_bug.cgi?id=9144 | ||
23 | python do_fix_quotes () { | ||
24 | with open(d.expand('${B}/os-release'), 'w') as f: | ||
25 | for field in d.getVar('OS_RELEASE_FIELDS', True).split(): | ||
26 | value = d.getVar(field, True) | ||
27 | if value: | ||
28 | f.write('{0}="{1}"\n'.format(field, value)) | ||
29 | } | ||
30 | |||
31 | do_verify_if_fixed_by_upstream () { | ||
32 | pretty_name_first_char=$(cat ${B}/os-release | grep "^PRETTY_NAME" | cut -f 2 -d '=' | cut -c1) | ||
33 | if [ "${pretty_name_first_char}" = "\"" ]] ; then | ||
34 | bbwarn "Issue appears to be fixed by upstream, remove this workaround." | ||
35 | fi | ||
36 | } | ||
37 | |||
38 | addtask do_verify_if_fixed_by_upstream after do_compile before do_install | ||
39 | addtask do_fix_quotes after do_verify_if_fixed_by_upstream before do_install | ||