sstate fetch symlink removal
cover sstate fetch symlink removal
This change removes the clutter of symlinks when sstate comes from a mirror rather than being created on the host.
The following changes since commit c7e614c438706fb3ed7520b4990ebb3973366942:
useradd: Fix infinite build loop (2016-05-23 10:33:45 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib rewitt/sstate-symlink
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=rewitt/sstate-symlink
Randy Witt (1):
sstate.bbclass: Don't create symlinks, download to the correct
location
meta/classes/sstate.bbclass | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
Signature · 1 line
2.5.5
PATCH 1/1 sstate.bbclass: Don't create symlinks, download to the correct location
Previously the sstate was all downloaded to the same directory and then symlinks were added in the directories that pointed to the siginfo and sstate in the parent directory.
This change makes it so that now the files are just downloaded to the correct location without the need for symlinks.
--- meta/classes/sstate.bbclass | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
meta/classes/sstate.bbclass +3 -9
@@ -623,10 +623,10 @@ def pstaging_fetch(sstatefetch, sstatepkg, d): # Try a fetch from the sstate mirror, if it fails just return and # we will build the package - uris = ['file://{0}'.format(sstatefetch), - 'file://{0}.siginfo'.format(sstatefetch)] + uris = ['file://{0};downloadfilename={1}'.format(sstatefetch, sstatefetch), + 'file://{0}.siginfo;downloadfilename={1}.siginfo'.format(sstatefetch, sstatefetch)] if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG", True), False): - uris += ['file://{0}.sig'.format(sstatefetch)] + uris += ['file://{0}.sig;downloadfilename={1}.sig'.format(sstatefetch, sstatefetch)] for srcuri in uris: localdata.setVar('SRC_URI', srcuri)
@@ -634,12 +634,6 @@ def pstaging_fetch(sstatefetch, sstatepkg, d): fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False) fetcher.download() - # Need to optimise this, if using file:// urls, the fetcher just changes the local path - # For now work around by symlinking - localpath = bb.data.expand(fetcher.localpath(srcuri), localdata) - if localpath != sstatepkg and os.path.exists(localpath) and not os.path.exists(sstatepkg): - os.symlink(localpath, sstatepkg) - except bb.fetch2.BBFetchException: break
Signature · 1 line
2.5.5
Re: [PATCH 1/1] sstate.bbclass: Don't create symlinks, download to the correct location
Quoted 30 lines · Randy Witt
Previously the sstate was all downloaded to the same directory and then symlinks were added in the directories that pointed to the siginfo and sstate in the parent directory.
This change makes it so that now the files are just downloaded to the correct location without the need for symlinks.
Signed-off-by Randy Witt <[email protected]>--- meta/classes/sstate.bbclass | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)meta/classes/sstate.bbclass +2
-2@@ -623,10 +623,10 @@ def pstaging_fetch(sstatefetch, sstatepkg, d): # Try a fetch from the sstate mirror, if it fails just return and # we will build the package - uris = ['file://{0}'.format(sstatefetch), - 'file://{0}.siginfo'.format(sstatefetch)] + uris = ['file://{0};downloadfilename={1}'.format(sstatefetch, sstatefetch), + 'file://{0}.siginfo;downloadfilename={1}.siginfo'.format(sstatefetch,sstatefetch)]
ifbb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG", True), False):meta/classes/sstate.bbclass +1
-1- uris += ['file://{0}.sig'.format(sstatefetch)] + uris +=
Quoted 2 lines
['file://{0}.sig;downloadfilename={1}.sig'.format(sstatefetch, sstatefetch)]
The use of {1} and passing the argument a second time is not needed. This isn't the old style formatting with %s. Just use the existing argument:
file://{0};downloadfilename={0}'.format(sstatefetch)Signature · 5 lines
Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics
PATCH v2 1/1 sstate.bbclass: Don't create symlinks, download to the correct location
In reply to Randy WittPreviously the sstate was all downloaded to the same directory and then symlinks were added in the directories that pointed to the siginfo and sstate in the parent directory.
This change makes it so that now the files are just downloaded to the correct location without the need for symlinks.
--- meta/classes/sstate.bbclass | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
meta/classes/sstate.bbclass +3 -9
@@ -623,10 +623,10 @@ def pstaging_fetch(sstatefetch, sstatepkg, d): # Try a fetch from the sstate mirror, if it fails just return and # we will build the package - uris = ['file://{0}'.format(sstatefetch), - 'file://{0}.siginfo'.format(sstatefetch)] + uris = ['file://{0};downloadfilename={0}'.format(sstatefetch), + 'file://{0}.siginfo;downloadfilename={0}.siginfo'.format(sstatefetch)] if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG", True), False): - uris += ['file://{0}.sig'.format(sstatefetch)] + uris += ['file://{0}.sig;downloadfilename={0}.sig'.format(sstatefetch)] for srcuri in uris: localdata.setVar('SRC_URI', srcuri)
@@ -634,12 +634,6 @@ def pstaging_fetch(sstatefetch, sstatepkg, d): fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False) fetcher.download() - # Need to optimise this, if using file:// urls, the fetcher just changes the local path - # For now work around by symlinking - localpath = bb.data.expand(fetcher.localpath(srcuri), localdata) - if localpath != sstatepkg and os.path.exists(localpath) and not os.path.exists(sstatepkg): - os.symlink(localpath, sstatepkg) - except bb.fetch2.BBFetchException: break
Signature · 1 line
2.5.5