diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-09 17:02:39 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-21 12:08:04 +0100 |
| commit | 71c6db8e65ced98db74fd18b726fa4b4c0346f05 (patch) | |
| tree | 0e5d7f21a2d65ba5b562068eb44d4e9b34465bed /meta/lib | |
| parent | c6c1ed6ba0b7e529d955eeda71c4a66317fa1331 (diff) | |
| download | poky-71c6db8e65ced98db74fd18b726fa4b4c0346f05.tar.gz | |
recipes: Start WORKDIR -> UNPACKDIR transition
Replace references of WORKDIR with UNPACKDIR where it makes sense to do
so in preparation for changing the default value of UNPACKDIR.
(From OE-Core rev: 1f18b9a512800860d5153d89eb82b56388efad6f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
| -rw-r--r-- | meta/lib/oe/recipeutils.py | 2 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 6 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/layerappend.py | 2 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/recipetool.py | 20 |
4 files changed, 15 insertions, 15 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index de1fbdd3a8..2d69a33113 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py | |||
| @@ -818,7 +818,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, | |||
| 818 | instdirline = 'install -d ${D}%s' % os.path.dirname(instdestpath) | 818 | instdirline = 'install -d ${D}%s' % os.path.dirname(instdestpath) |
| 819 | if not instdirline in instfunclines: | 819 | if not instdirline in instfunclines: |
| 820 | instfunclines.append(instdirline) | 820 | instfunclines.append(instdirline) |
| 821 | instfunclines.append('install -m %s ${WORKDIR}/%s ${D}%s' % (perms, os.path.basename(srcfile), instdestpath)) | 821 | instfunclines.append('install -m %s ${UNPACKDIR}/%s ${D}%s' % (perms, os.path.basename(srcfile), instdestpath)) |
| 822 | if instfunclines: | 822 | if instfunclines: |
| 823 | bbappendlines.append(('do_install:append%s()' % appendoverride, '', instfunclines)) | 823 | bbappendlines.append(('do_install:append%s()' % appendoverride, '', instfunclines)) |
| 824 | 824 | ||
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 882225dde3..8ce1c65a38 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
| @@ -956,9 +956,9 @@ class DevtoolModifyTests(DevtoolBase): | |||
| 956 | # others git:// in SRC_URI | 956 | # others git:// in SRC_URI |
| 957 | # cointains a patch | 957 | # cointains a patch |
| 958 | testrecipe = 'hello-rs' | 958 | testrecipe = 'hello-rs' |
| 959 | bb_vars = get_bb_vars(['SRC_URI', 'FILE', 'WORKDIR', 'CARGO_HOME'], testrecipe) | 959 | bb_vars = get_bb_vars(['SRC_URI', 'FILE', 'UNPACKDIR', 'CARGO_HOME'], testrecipe) |
| 960 | recipefile = bb_vars['FILE'] | 960 | recipefile = bb_vars['FILE'] |
| 961 | workdir = bb_vars['WORKDIR'] | 961 | unpackdir = bb_vars['UNPACKDIR'] |
| 962 | cargo_home = bb_vars['CARGO_HOME'] | 962 | cargo_home = bb_vars['CARGO_HOME'] |
| 963 | src_uri = bb_vars['SRC_URI'].split() | 963 | src_uri = bb_vars['SRC_URI'].split() |
| 964 | self.assertTrue(src_uri[0].startswith('git://'), | 964 | self.assertTrue(src_uri[0].startswith('git://'), |
| @@ -1029,7 +1029,7 @@ class DevtoolModifyTests(DevtoolBase): | |||
| 1029 | self.assertEqual(parms['type'], 'git-dependency', 'git dependencies uri should have "type=git-dependency"') | 1029 | self.assertEqual(parms['type'], 'git-dependency', 'git dependencies uri should have "type=git-dependency"') |
| 1030 | raw_url = raw_url.replace("git://", '%s://' % parms['protocol']) | 1030 | raw_url = raw_url.replace("git://", '%s://' % parms['protocol']) |
| 1031 | patch_line = '[patch."%s"]' % raw_url | 1031 | patch_line = '[patch."%s"]' % raw_url |
| 1032 | path_patched = os.path.join(workdir, parms['destsuffix']) | 1032 | path_patched = os.path.join(unpackdir, parms['destsuffix']) |
| 1033 | path_override_line = '%s = { path = "%s" }' % (parms['name'], path_patched) | 1033 | path_override_line = '%s = { path = "%s" }' % (parms['name'], path_patched) |
| 1034 | # Would have been better to use tomllib to read this file :/ | 1034 | # Would have been better to use tomllib to read this file :/ |
| 1035 | self.assertIn(patch_line, cargo_config_contents) | 1035 | self.assertIn(patch_line, cargo_config_contents) |
diff --git a/meta/lib/oeqa/selftest/cases/layerappend.py b/meta/lib/oeqa/selftest/cases/layerappend.py index 379ed589ad..64b17117cc 100644 --- a/meta/lib/oeqa/selftest/cases/layerappend.py +++ b/meta/lib/oeqa/selftest/cases/layerappend.py | |||
| @@ -37,7 +37,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" | |||
| 37 | SRC_URI:append = " file://appendtest.txt" | 37 | SRC_URI:append = " file://appendtest.txt" |
| 38 | 38 | ||
| 39 | sysroot_stage_all:append() { | 39 | sysroot_stage_all:append() { |
| 40 | install -m 644 ${WORKDIR}/appendtest.txt ${SYSROOT_DESTDIR}/ | 40 | install -m 644 ${UNPACKDIR}/appendtest.txt ${SYSROOT_DESTDIR}/ |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | """ | 43 | """ |
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 126906df50..42202b7831 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py | |||
| @@ -138,7 +138,7 @@ class RecipetoolAppendTests(RecipetoolBase): | |||
| 138 | '\n', | 138 | '\n', |
| 139 | 'do_install:append() {\n', | 139 | 'do_install:append() {\n', |
| 140 | ' install -d ${D}${%s}\n' % dirname, | 140 | ' install -d ${D}${%s}\n' % dirname, |
| 141 | ' install -m 0755 ${WORKDIR}/%s ${D}${%s}/ls\n' % (testfile2name, dirname), | 141 | ' install -m 0755 ${UNPACKDIR}/%s ${D}${%s}/ls\n' % (testfile2name, dirname), |
| 142 | '}\n'] | 142 | '}\n'] |
| 143 | self._try_recipetool_appendfile('coreutils', lspath, testfile2, '-r coreutils', expectedlines, [testfile2name]) | 143 | self._try_recipetool_appendfile('coreutils', lspath, testfile2, '-r coreutils', expectedlines, [testfile2name]) |
| 144 | # Now try bbappending the same file again, contents should not change | 144 | # Now try bbappending the same file again, contents should not change |
| @@ -164,7 +164,7 @@ class RecipetoolAppendTests(RecipetoolBase): | |||
| 164 | '\n', | 164 | '\n', |
| 165 | 'do_install:append() {\n', | 165 | 'do_install:append() {\n', |
| 166 | ' install -d ${D}${datadir}\n', | 166 | ' install -d ${D}${datadir}\n', |
| 167 | ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n', | 167 | ' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/something\n', |
| 168 | '}\n'] | 168 | '}\n'] |
| 169 | self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase', expectedlines, ['testfile']) | 169 | self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase', expectedlines, ['testfile']) |
| 170 | # Try adding another file, this time where the source file is executable | 170 | # Try adding another file, this time where the source file is executable |
| @@ -179,8 +179,8 @@ class RecipetoolAppendTests(RecipetoolBase): | |||
| 179 | '\n', | 179 | '\n', |
| 180 | 'do_install:append() {\n', | 180 | 'do_install:append() {\n', |
| 181 | ' install -d ${D}${datadir}\n', | 181 | ' install -d ${D}${datadir}\n', |
| 182 | ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n', | 182 | ' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/something\n', |
| 183 | ' install -m 0755 ${WORKDIR}/%s ${D}${datadir}/scriptname\n' % testfile2name, | 183 | ' install -m 0755 ${UNPACKDIR}/%s ${D}${datadir}/scriptname\n' % testfile2name, |
| 184 | '}\n'] | 184 | '}\n'] |
| 185 | self._try_recipetool_appendfile('netbase', '/usr/share/scriptname', testfile2, '-r netbase', expectedlines, ['testfile', testfile2name]) | 185 | self._try_recipetool_appendfile('netbase', '/usr/share/scriptname', testfile2, '-r netbase', expectedlines, ['testfile', testfile2name]) |
| 186 | 186 | ||
| @@ -192,7 +192,7 @@ class RecipetoolAppendTests(RecipetoolBase): | |||
| 192 | '\n', | 192 | '\n', |
| 193 | 'do_install:append() {\n', | 193 | 'do_install:append() {\n', |
| 194 | ' install -d ${D}${bindir}\n', | 194 | ' install -d ${D}${bindir}\n', |
| 195 | ' install -m 0755 ${WORKDIR}/testfile ${D}${bindir}/selftest-recipetool-testbin\n', | 195 | ' install -m 0755 ${UNPACKDIR}/testfile ${D}${bindir}/selftest-recipetool-testbin\n', |
| 196 | '}\n'] | 196 | '}\n'] |
| 197 | _, output = self._try_recipetool_appendfile('netbase', '/usr/bin/selftest-recipetool-testbin', self.testfile, '-r netbase', expectedlines, ['testfile']) | 197 | _, output = self._try_recipetool_appendfile('netbase', '/usr/bin/selftest-recipetool-testbin', self.testfile, '-r netbase', expectedlines, ['testfile']) |
| 198 | self.assertNotIn('WARNING: ', output) | 198 | self.assertNotIn('WARNING: ', output) |
| @@ -207,7 +207,7 @@ class RecipetoolAppendTests(RecipetoolBase): | |||
| 207 | '\n', | 207 | '\n', |
| 208 | 'do_install:append:mymachine() {\n', | 208 | 'do_install:append:mymachine() {\n', |
| 209 | ' install -d ${D}${datadir}\n', | 209 | ' install -d ${D}${datadir}\n', |
| 210 | ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n', | 210 | ' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/something\n', |
| 211 | '}\n'] | 211 | '}\n'] |
| 212 | _, output = self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase -m mymachine', expectedlines, ['mymachine/testfile']) | 212 | _, output = self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase -m mymachine', expectedlines, ['mymachine/testfile']) |
| 213 | self.assertNotIn('WARNING: ', output) | 213 | self.assertNotIn('WARNING: ', output) |
| @@ -241,7 +241,7 @@ class RecipetoolAppendTests(RecipetoolBase): | |||
| 241 | '\n', | 241 | '\n', |
| 242 | 'do_install:append() {\n', | 242 | 'do_install:append() {\n', |
| 243 | ' install -d ${D}${datadir}\n', | 243 | ' install -d ${D}${datadir}\n', |
| 244 | ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-subdir\n', | 244 | ' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/selftest-replaceme-subdir\n', |
| 245 | '}\n'] | 245 | '}\n'] |
| 246 | _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-subdir', self.testfile, '', expectedlines, ['testfile']) | 246 | _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-subdir', self.testfile, '', expectedlines, ['testfile']) |
| 247 | self.assertNotIn('WARNING: ', output) | 247 | self.assertNotIn('WARNING: ', output) |
| @@ -268,7 +268,7 @@ class RecipetoolAppendTests(RecipetoolBase): | |||
| 268 | '\n', | 268 | '\n', |
| 269 | 'do_install:append() {\n', | 269 | 'do_install:append() {\n', |
| 270 | ' install -d ${D}${sysconfdir}\n', | 270 | ' install -d ${D}${sysconfdir}\n', |
| 271 | ' install -m 0644 ${WORKDIR}/testfile ${D}${sysconfdir}/selftest-replaceme-patched\n', | 271 | ' install -m 0644 ${UNPACKDIR}/testfile ${D}${sysconfdir}/selftest-replaceme-patched\n', |
| 272 | '}\n'] | 272 | '}\n'] |
| 273 | _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/etc/selftest-replaceme-patched', self.testfile, '', expectedlines, ['testfile']) | 273 | _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/etc/selftest-replaceme-patched', self.testfile, '', expectedlines, ['testfile']) |
| 274 | for line in output.splitlines(): | 274 | for line in output.splitlines(): |
| @@ -286,7 +286,7 @@ class RecipetoolAppendTests(RecipetoolBase): | |||
| 286 | '\n', | 286 | '\n', |
| 287 | 'do_install:append() {\n', | 287 | 'do_install:append() {\n', |
| 288 | ' install -d ${D}${datadir}\n', | 288 | ' install -d ${D}${datadir}\n', |
| 289 | ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-scripted\n', | 289 | ' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/selftest-replaceme-scripted\n', |
| 290 | '}\n'] | 290 | '}\n'] |
| 291 | _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-scripted', self.testfile, '', expectedlines, ['testfile']) | 291 | _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-scripted', self.testfile, '', expectedlines, ['testfile']) |
| 292 | self.assertNotIn('WARNING: ', output) | 292 | self.assertNotIn('WARNING: ', output) |
| @@ -309,7 +309,7 @@ class RecipetoolAppendTests(RecipetoolBase): | |||
| 309 | '\n', | 309 | '\n', |
| 310 | 'do_install:append() {\n', | 310 | 'do_install:append() {\n', |
| 311 | ' install -d ${D}${datadir}\n', | 311 | ' install -d ${D}${datadir}\n', |
| 312 | ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-postinst\n', | 312 | ' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/selftest-replaceme-postinst\n', |
| 313 | '}\n'] | 313 | '}\n'] |
| 314 | _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-postinst', self.testfile, '-r selftest-recipetool-appendfile', expectedlines, ['testfile']) | 314 | _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-postinst', self.testfile, '-r selftest-recipetool-appendfile', expectedlines, ['testfile']) |
| 315 | 315 | ||
