mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
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>
This commit is contained in:
@@ -818,7 +818,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
|
||||
instdirline = 'install -d ${D}%s' % os.path.dirname(instdestpath)
|
||||
if not instdirline in instfunclines:
|
||||
instfunclines.append(instdirline)
|
||||
instfunclines.append('install -m %s ${WORKDIR}/%s ${D}%s' % (perms, os.path.basename(srcfile), instdestpath))
|
||||
instfunclines.append('install -m %s ${UNPACKDIR}/%s ${D}%s' % (perms, os.path.basename(srcfile), instdestpath))
|
||||
if instfunclines:
|
||||
bbappendlines.append(('do_install:append%s()' % appendoverride, '', instfunclines))
|
||||
|
||||
|
||||
@@ -956,9 +956,9 @@ class DevtoolModifyTests(DevtoolBase):
|
||||
# others git:// in SRC_URI
|
||||
# cointains a patch
|
||||
testrecipe = 'hello-rs'
|
||||
bb_vars = get_bb_vars(['SRC_URI', 'FILE', 'WORKDIR', 'CARGO_HOME'], testrecipe)
|
||||
bb_vars = get_bb_vars(['SRC_URI', 'FILE', 'UNPACKDIR', 'CARGO_HOME'], testrecipe)
|
||||
recipefile = bb_vars['FILE']
|
||||
workdir = bb_vars['WORKDIR']
|
||||
unpackdir = bb_vars['UNPACKDIR']
|
||||
cargo_home = bb_vars['CARGO_HOME']
|
||||
src_uri = bb_vars['SRC_URI'].split()
|
||||
self.assertTrue(src_uri[0].startswith('git://'),
|
||||
@@ -1029,7 +1029,7 @@ class DevtoolModifyTests(DevtoolBase):
|
||||
self.assertEqual(parms['type'], 'git-dependency', 'git dependencies uri should have "type=git-dependency"')
|
||||
raw_url = raw_url.replace("git://", '%s://' % parms['protocol'])
|
||||
patch_line = '[patch."%s"]' % raw_url
|
||||
path_patched = os.path.join(workdir, parms['destsuffix'])
|
||||
path_patched = os.path.join(unpackdir, parms['destsuffix'])
|
||||
path_override_line = '%s = { path = "%s" }' % (parms['name'], path_patched)
|
||||
# Would have been better to use tomllib to read this file :/
|
||||
self.assertIn(patch_line, cargo_config_contents)
|
||||
|
||||
@@ -37,7 +37,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
|
||||
SRC_URI:append = " file://appendtest.txt"
|
||||
|
||||
sysroot_stage_all:append() {
|
||||
install -m 644 ${WORKDIR}/appendtest.txt ${SYSROOT_DESTDIR}/
|
||||
install -m 644 ${UNPACKDIR}/appendtest.txt ${SYSROOT_DESTDIR}/
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
@@ -138,7 +138,7 @@ class RecipetoolAppendTests(RecipetoolBase):
|
||||
'\n',
|
||||
'do_install:append() {\n',
|
||||
' install -d ${D}${%s}\n' % dirname,
|
||||
' install -m 0755 ${WORKDIR}/%s ${D}${%s}/ls\n' % (testfile2name, dirname),
|
||||
' install -m 0755 ${UNPACKDIR}/%s ${D}${%s}/ls\n' % (testfile2name, dirname),
|
||||
'}\n']
|
||||
self._try_recipetool_appendfile('coreutils', lspath, testfile2, '-r coreutils', expectedlines, [testfile2name])
|
||||
# Now try bbappending the same file again, contents should not change
|
||||
@@ -164,7 +164,7 @@ class RecipetoolAppendTests(RecipetoolBase):
|
||||
'\n',
|
||||
'do_install:append() {\n',
|
||||
' install -d ${D}${datadir}\n',
|
||||
' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n',
|
||||
' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/something\n',
|
||||
'}\n']
|
||||
self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase', expectedlines, ['testfile'])
|
||||
# Try adding another file, this time where the source file is executable
|
||||
@@ -179,8 +179,8 @@ class RecipetoolAppendTests(RecipetoolBase):
|
||||
'\n',
|
||||
'do_install:append() {\n',
|
||||
' install -d ${D}${datadir}\n',
|
||||
' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n',
|
||||
' install -m 0755 ${WORKDIR}/%s ${D}${datadir}/scriptname\n' % testfile2name,
|
||||
' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/something\n',
|
||||
' install -m 0755 ${UNPACKDIR}/%s ${D}${datadir}/scriptname\n' % testfile2name,
|
||||
'}\n']
|
||||
self._try_recipetool_appendfile('netbase', '/usr/share/scriptname', testfile2, '-r netbase', expectedlines, ['testfile', testfile2name])
|
||||
|
||||
@@ -192,7 +192,7 @@ class RecipetoolAppendTests(RecipetoolBase):
|
||||
'\n',
|
||||
'do_install:append() {\n',
|
||||
' install -d ${D}${bindir}\n',
|
||||
' install -m 0755 ${WORKDIR}/testfile ${D}${bindir}/selftest-recipetool-testbin\n',
|
||||
' install -m 0755 ${UNPACKDIR}/testfile ${D}${bindir}/selftest-recipetool-testbin\n',
|
||||
'}\n']
|
||||
_, output = self._try_recipetool_appendfile('netbase', '/usr/bin/selftest-recipetool-testbin', self.testfile, '-r netbase', expectedlines, ['testfile'])
|
||||
self.assertNotIn('WARNING: ', output)
|
||||
@@ -207,7 +207,7 @@ class RecipetoolAppendTests(RecipetoolBase):
|
||||
'\n',
|
||||
'do_install:append:mymachine() {\n',
|
||||
' install -d ${D}${datadir}\n',
|
||||
' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n',
|
||||
' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/something\n',
|
||||
'}\n']
|
||||
_, output = self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase -m mymachine', expectedlines, ['mymachine/testfile'])
|
||||
self.assertNotIn('WARNING: ', output)
|
||||
@@ -241,7 +241,7 @@ class RecipetoolAppendTests(RecipetoolBase):
|
||||
'\n',
|
||||
'do_install:append() {\n',
|
||||
' install -d ${D}${datadir}\n',
|
||||
' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-subdir\n',
|
||||
' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/selftest-replaceme-subdir\n',
|
||||
'}\n']
|
||||
_, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-subdir', self.testfile, '', expectedlines, ['testfile'])
|
||||
self.assertNotIn('WARNING: ', output)
|
||||
@@ -268,7 +268,7 @@ class RecipetoolAppendTests(RecipetoolBase):
|
||||
'\n',
|
||||
'do_install:append() {\n',
|
||||
' install -d ${D}${sysconfdir}\n',
|
||||
' install -m 0644 ${WORKDIR}/testfile ${D}${sysconfdir}/selftest-replaceme-patched\n',
|
||||
' install -m 0644 ${UNPACKDIR}/testfile ${D}${sysconfdir}/selftest-replaceme-patched\n',
|
||||
'}\n']
|
||||
_, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/etc/selftest-replaceme-patched', self.testfile, '', expectedlines, ['testfile'])
|
||||
for line in output.splitlines():
|
||||
@@ -286,7 +286,7 @@ class RecipetoolAppendTests(RecipetoolBase):
|
||||
'\n',
|
||||
'do_install:append() {\n',
|
||||
' install -d ${D}${datadir}\n',
|
||||
' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-scripted\n',
|
||||
' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/selftest-replaceme-scripted\n',
|
||||
'}\n']
|
||||
_, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-scripted', self.testfile, '', expectedlines, ['testfile'])
|
||||
self.assertNotIn('WARNING: ', output)
|
||||
@@ -309,7 +309,7 @@ class RecipetoolAppendTests(RecipetoolBase):
|
||||
'\n',
|
||||
'do_install:append() {\n',
|
||||
' install -d ${D}${datadir}\n',
|
||||
' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-postinst\n',
|
||||
' install -m 0644 ${UNPACKDIR}/testfile ${D}${datadir}/selftest-replaceme-postinst\n',
|
||||
'}\n']
|
||||
_, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-postinst', self.testfile, '-r selftest-recipetool-appendfile', expectedlines, ['testfile'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user