Skip to contentSkip to conversation

Yocto 1561: enable cleanup of WORKDIR

PATCH In review Kang Kai 3 participants 5 messages Mar 2, 2012 – Mar 5, 2012

lore
Share & tools
lore

Kang Kai

author
#0 lore raw

cover Yocto 1561: enable cleanup of WORKDIR

Hi Saul,

This is implementation of Yocto 1561: enable cleanup of WORKDIR. The original design was create a new script to fullfill the feature, but it doesn't work. So I add a command line option to do it.

Regards,

The following changes since commit 6b6aa170d5c618cfcd016dd1de926db647f7f932:

busybox: Restore 'date' compatability (2012-03-01 23:16:43 +0000)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib kangkai/cleanup
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/cleanup

Kang Kai (1):
bitbake: enable cleanup of WORKDIR

 bitbake/bin/bitbake       |    4 +++
 bitbake/lib/bb/command.py |    5 +++
 bitbake/lib/bb/cooker.py  |   63 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 72 insertions(+), 0 deletions(-)
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 1/1 bitbake: enable cleanup of WORKDIR

[Yocto 1561]
Add a command line option for bitbake to enable cleanup of WORKDIR. It checks every package build directories under WORKDIR then parse the directory name to get package name and version. If the version is not the package prefer version then delete the directory.

---
 bitbake/bin/bitbake       |    4 +++
 bitbake/lib/bb/command.py |    5 +++
 bitbake/lib/bb/cooker.py  |   63 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 72 insertions(+), 0 deletions(-)
bitbake/bin/bitbake +4 -0
index c06d4e8..89582f7 100755
@@ -170,6 +170,10 @@ Default BBFILES are the .bb files in the current directory.""")
 
     parser.add_option("-B", "--bind", help = "The name/address for the bitbake server to bind to",
                action = "store", dest = "bind", default = False)
+
+    parser.add_option("-C", "--clean-workdir", help = "Clean up the old version build directories in workdir",
+               action = "store_true", dest = "clean_workdir", default = False)
+
     options, args = parser.parse_args(sys.argv)
 
     configuration = BBConfiguration(options)
bitbake/lib/bb/command.py +5 -0
index 1799f1c..a924e85 100644
@@ -294,6 +294,11 @@ class CommandsAsync:
         command.finishAsyncCommand()
     findConfigFilePath.needcache = False
 
+    def cleanupWorkdir(self, command, params):
+        command.cooker.cleanupWorkdir()
+        command.finishAsyncCommand()
+    cleanupWorkdir.needcache = True
+
     def showVersions(self, command, params):
         """
         Show the currently selected versions
bitbake/lib/bb/cooker.py +63 -0

81 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#2 lore raw

Re: [PATCH 1/1] bitbake: enable cleanup of WORKDIR

Quoted 6 lines · Kang Kai

[Yocto 1561]
Add a command line option for bitbake to enable cleanup of WORKDIR. It checks every package build directories under WORKDIR then parse the directory name to get package name and version. If the version is not the package prefer version then delete the directory.

Quoted 6 lines

---
 bitbake/bin/bitbake       |    4 +++
 bitbake/lib/bb/command.py |    5 +++
 bitbake/lib/bb/cooker.py  |   63 +++++++++++++++++++++++++++++++++++++++++++++

 3 files changed, 72 insertions(+), 0 deletions(-)

This is wrong on multiple levels. bitbake (other than some hacky stuff in the fetcher that needs to die) has *zero* knowledge of the use of WORKDIR today, that's entirely metadata implementation.

Signature · 1 line
Christopher Larson
#3 lore raw

Re: [PATCH 1/1] bitbake: enable cleanup of WORKDIR

Quoted 14 lines · Chris Larson
Quoted 6 lines · Kang Kai

[Yocto 1561]
Add a command line option for bitbake to enable cleanup of WORKDIR. It checks every package build directories under WORKDIR then parse the directory name to get package name and version. If the version is not the package prefer version then delete the directory.

Quoted 6 lines
---
 bitbake/bin/bitbake       |    4 +++
 bitbake/lib/bb/command.py |    5 +++
 bitbake/lib/bb/cooker.py  |   63 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 72 insertions(+), 0 deletions(-)
Quoted 3 lines

This is wrong on multiple levels. bitbake (other than some hacky stuff in the fetcher that needs to die) has *zero* knowledge of the use of WORKDIR today, that's entirely metadata implementation.

Totally agreed. I saw a comment earlier today in the bugzilla about this and made the same comment even before I saw this patch...

Cheers,

Richard

author
#4 lore raw

Re: [PATCH 1/1] bitbake: enable cleanup of WORKDIR

Quoted 14 lines · Richard Purdie
Quoted 13 lines · Chris Larson
Quoted 12 lines · Kang Kai

[Yocto 1561]
Add a command line option for bitbake to enable cleanup of WORKDIR. It checks every package build directories under WORKDIR then parse the directory name to get package name and version. If the version is not the package prefer version then delete the directory.

---
  bitbake/bin/bitbake       |    4 +++
  bitbake/lib/bb/command.py |    5 +++
  bitbake/lib/bb/cooker.py  |   63 +++++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 72 insertions(+), 0 deletions(-)
Quoted 5 lines
Quoted 3 lines

This is wrong on multiple levels. bitbake (other than some hacky stuff in the fetcher that needs to die) has *zero* knowledge of the use of WORKDIR today, that's entirely metadata implementation.

Totally agreed. I saw a comment earlier today in the bugzilla about this and made the same comment even before I saw this patch...

OK. I'll do it in another way.

Regards,
Kai

Quoted 5 lines

Cheers,

Richard