* [PATCH] src_distribute_local.bbclass: add an error message and exit if a file is not found
@ 2010-08-12 17:20 Frans Meulenbroeks
2010-08-19 6:13 ` Frans Meulenbroeks
0 siblings, 1 reply; 3+ messages in thread
From: Frans Meulenbroeks @ 2010-08-12 17:20 UTC (permalink / raw)
To: openembedded-devel
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@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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] src_distribute_local.bbclass: add an error message and exit if a file is not found
2010-08-12 17:20 [PATCH] src_distribute_local.bbclass: add an error message and exit if a file is not found Frans Meulenbroeks
@ 2010-08-19 6:13 ` Frans Meulenbroeks
2010-09-02 9:07 ` Frans Meulenbroeks
0 siblings, 1 reply; 3+ messages in thread
From: Frans Meulenbroeks @ 2010-08-19 6:13 UTC (permalink / raw)
To: openembedded-devel
2010/8/12 Frans Meulenbroeks <fransmeulenbroeks@gmail.com>:
> 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@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"
> --
This has been in review for a week & no comments.
Unless someone reacts soon, I'm going to push this.
Frans.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] src_distribute_local.bbclass: add an error message and exit if a file is not found
2010-08-19 6:13 ` Frans Meulenbroeks
@ 2010-09-02 9:07 ` Frans Meulenbroeks
0 siblings, 0 replies; 3+ messages in thread
From: Frans Meulenbroeks @ 2010-09-02 9:07 UTC (permalink / raw)
To: openembedded-devel
Bump
2010/8/19 Frans Meulenbroeks <fransmeulenbroeks@gmail.com>:
> 2010/8/12 Frans Meulenbroeks <fransmeulenbroeks@gmail.com>:
>> 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@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"
>> --
>
> This has been in review for a week & no comments.
> Unless someone reacts soon, I'm going to push this.
>
> Frans.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-09-02 9:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-12 17:20 [PATCH] src_distribute_local.bbclass: add an error message and exit if a file is not found Frans Meulenbroeks
2010-08-19 6:13 ` Frans Meulenbroeks
2010-09-02 9:07 ` Frans Meulenbroeks
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.