* [PATCH] utility-taska.bbclass: Add distclean task for removing sources
@ 2012-04-11 11:48 Noor, Ahsan
2012-04-11 11:51 ` Ahsan, Noor
0 siblings, 1 reply; 3+ messages in thread
From: Noor, Ahsan @ 2012-04-11 11:48 UTC (permalink / raw)
To: openembedded-core
From: Noor Ahsan <noor_ahsan@mentor.com>
* Bring distclean task from openembedded classic.
Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com>
---
meta/classes/utility-tasks.bbclass | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/meta/classes/utility-tasks.bbclass b/meta/classes/utility-tasks.bbclass
index cbb000a..8379de6 100644
--- a/meta/classes/utility-tasks.bbclass
+++ b/meta/classes/utility-tasks.bbclass
@@ -28,6 +28,36 @@ python do_clean() {
bb.build.exec_func(f, d)
}
+addtask distclean
+do_distclean[nostamp] = "1"
+python do_distclean() {
+ """clear downloaded sources, build and temp directories"""
+
+ bb.build.exec_func('do_clean', d)
+
+ src_uri = bb.data.getVar('SRC_URI', d, 1)
+ if not src_uri:
+ return
+
+ for uri in src_uri.split():
+ if bb.decodeurl(uri)[0] == "file":
+ continue
+
+ try:
+ local = bb.data.expand(bb.fetch.localpath(uri, d), d)
+ except bb.MalformedUrl, e:
+ bb.debug(1, 'Unable to generate local path for malformed uri: %s' % e)
+ else:
+ bb.note("removing %s" % base_path_out(local, d))
+ try:
+ if os.path.exists(local + ".done"):
+ os.remove(local + ".done")
+ if os.path.exists(local):
+ os.remove(local)
+ except OSError, e:
+ bb.note("Error in removal: %s" % e)
+}
+
addtask checkuri
do_checkuri[nostamp] = "1"
python do_checkuri() {
--
1.7.9
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] utility-taska.bbclass: Add distclean task for removing sources
2012-04-11 11:48 [PATCH] utility-taska.bbclass: Add distclean task for removing sources Noor, Ahsan
@ 2012-04-11 11:51 ` Ahsan, Noor
0 siblings, 0 replies; 3+ messages in thread
From: Ahsan, Noor @ 2012-04-11 11:51 UTC (permalink / raw)
To: Ahsan, Noor, openembedded-core
Sorry about the wrong patches.
-----Original Message-----
From: Ahsan, Noor
Sent: Wednesday, April 11, 2012 4:48 PM
To: openembedded-core@lists.openembedded.org
Cc: Ahsan, Noor
Subject: [PATCH] utility-taska.bbclass: Add distclean task for removing sources
From: Noor Ahsan <noor_ahsan@mentor.com>
* Bring distclean task from openembedded classic.
Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com>
---
meta/classes/utility-tasks.bbclass | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/meta/classes/utility-tasks.bbclass b/meta/classes/utility-tasks.bbclass
index cbb000a..8379de6 100644
--- a/meta/classes/utility-tasks.bbclass
+++ b/meta/classes/utility-tasks.bbclass
@@ -28,6 +28,36 @@ python do_clean() {
bb.build.exec_func(f, d)
}
+addtask distclean
+do_distclean[nostamp] = "1"
+python do_distclean() {
+ """clear downloaded sources, build and temp directories"""
+
+ bb.build.exec_func('do_clean', d)
+
+ src_uri = bb.data.getVar('SRC_URI', d, 1)
+ if not src_uri:
+ return
+
+ for uri in src_uri.split():
+ if bb.decodeurl(uri)[0] == "file":
+ continue
+
+ try:
+ local = bb.data.expand(bb.fetch.localpath(uri, d), d)
+ except bb.MalformedUrl, e:
+ bb.debug(1, 'Unable to generate local path for malformed uri: %s' % e)
+ else:
+ bb.note("removing %s" % base_path_out(local, d))
+ try:
+ if os.path.exists(local + ".done"):
+ os.remove(local + ".done")
+ if os.path.exists(local):
+ os.remove(local)
+ except OSError, e:
+ bb.note("Error in removal: %s" % e)
+}
+
addtask checkuri
do_checkuri[nostamp] = "1"
python do_checkuri() {
--
1.7.9
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] utility-taska.bbclass: Add distclean task for removing sources
@ 2012-04-11 11:44 Noor, Ahsan
0 siblings, 0 replies; 3+ messages in thread
From: Noor, Ahsan @ 2012-04-11 11:44 UTC (permalink / raw)
To: openembedded-core
From: Noor Ahsan <noor_ahsan@mentor.com>
* Bring distclean task from openembedded classic.
Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com>
---
meta/classes/utility-tasks.bbclass | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/meta/classes/utility-tasks.bbclass b/meta/classes/utility-tasks.bbclass
index cbb000a..8379de6 100644
--- a/meta/classes/utility-tasks.bbclass
+++ b/meta/classes/utility-tasks.bbclass
@@ -28,6 +28,36 @@ python do_clean() {
bb.build.exec_func(f, d)
}
+addtask distclean
+do_distclean[nostamp] = "1"
+python do_distclean() {
+ """clear downloaded sources, build and temp directories"""
+
+ bb.build.exec_func('do_clean', d)
+
+ src_uri = bb.data.getVar('SRC_URI', d, 1)
+ if not src_uri:
+ return
+
+ for uri in src_uri.split():
+ if bb.decodeurl(uri)[0] == "file":
+ continue
+
+ try:
+ local = bb.data.expand(bb.fetch.localpath(uri, d), d)
+ except bb.MalformedUrl, e:
+ bb.debug(1, 'Unable to generate local path for malformed uri: %s' % e)
+ else:
+ bb.note("removing %s" % base_path_out(local, d))
+ try:
+ if os.path.exists(local + ".done"):
+ os.remove(local + ".done")
+ if os.path.exists(local):
+ os.remove(local)
+ except OSError, e:
+ bb.note("Error in removal: %s" % e)
+}
+
addtask checkuri
do_checkuri[nostamp] = "1"
python do_checkuri() {
--
1.7.9
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-04-11 12:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 11:48 [PATCH] utility-taska.bbclass: Add distclean task for removing sources Noor, Ahsan
2012-04-11 11:51 ` Ahsan, Noor
-- strict thread matches above, loose matches on Subject: below --
2012-04-11 11:44 Noor, Ahsan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.