[oe] [PATCH] src_distribute_local.bbclass: add an error message and exit if a file is not found
Frans Meulenbroeks
fransmeulenbroeks at gmail.com
Thu Aug 12 17:20:23 UTC 2010
When a file was not found do_distribute_local would still continue.
This patch adds an error message and terminates do_distribute_local
Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks at gmail.com>
---
classes/src_distribute_local.bbclass | 28 +++++++++++++++++++++++-----
1 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/classes/src_distribute_local.bbclass b/classes/src_distribute_local.bbclass
index 7b1e7d7..bdf03e9 100644
--- a/classes/src_distribute_local.bbclass
+++ b/classes/src_distribute_local.bbclass
@@ -7,21 +7,39 @@ SRC_DISTRIBUTECOMMAND[dirs] = "${SRC_DISTRIBUTEDIR}/${LIC}/${PN}"
# symlinks the files to the SRC_DISTRIBUTEDIR
SRC_DISTRIBUTECOMMAND-symlink () {
test -e "${SRC}.md5" && ln -sf "${SRC}.md5" .
- ln -sf "${SRC}" .
+ if test -e {SRC}
+ then
+ ln -sf "${SRC}" .
+ else
+ echo "File does not exist:" ${SRC}
+ exit 1
+ fi
}
# copies the files to the SRC_DISTRIBUTEDIR
SRC_DISTRIBUTECOMMAND-copy () {
test -e "${SRC}.md5" && cp -f "${SRC}.md5" .
- cp -fr "${SRC}" .
+ if test -e {SRC}
+ then
+ cp -fr "${SRC}" .
+ else
+ echo "File does not exist:" ${SRC}
+ exit 1
+ fi
}
# moves the files to the SRC_DISTRIBUTEDIR and symlinks them back
SRC_DISTRIBUTECOMMAND-move+symlink () {
if ! [ -L ${SRC} ]; then
- src=`basename "${SRC}"`
- mv ${SRC} .
- ln -sf $src "${SRC}"
+ if test -e {SRC}
+ then
+ src=`basename "${SRC}"`
+ mv ${SRC} .
+ ln -sf $src "${SRC}"
+ else
+ echo "File does not exist:" ${SRC}
+ exit 1
+ fi
if [ -e ${SRC}.md5 ]; then
mv ${SRC}.md5 .
ln -sf $src "${SRC}.md5"
--
1.6.4.2
More information about the Openembedded-devel
mailing list