From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
To: "Aníbal Limón" <anibal.limon@linux.intel.com>,
"Mike Looijmans" <mike.looijmans@topic.nl>,
yocto@yoctoproject.org
Subject: Re: [PATCH][opkg-utils] opkg-build: Exit when fail to list files.
Date: Tue, 5 Apr 2016 09:54:12 -0500 [thread overview]
Message-ID: <5703D194.3070701@ni.com> (raw)
In-Reply-To: <56FE8AC9.2040605@linux.intel.com>
On 04/01/2016 09:50 AM, Aníbal Limón wrote:
> Hi,
>
> Comments below,
>
> alimon
>
>
> On 03/31/2016 11:26 PM, Mike Looijmans wrote:
>> On 31-03-16 23:27, Aníbal Limón wrote:
>>> We have an issue when ls segfaults in some cases [1] so it's
>>> better to detect the failure at this level instead of continue
>>> the build process.
>>>
>>> [YOCTO #8926]
>>>
>>> [1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8926#c0
>>>
>>> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
>>> ---
>>> opkg-build | 8 ++++++++
>>> 1 file changed, 8 insertions(+)
>>>
>>> diff --git a/opkg-build b/opkg-build
>>> index 98008b6..a9ccad2 100755
>>> --- a/opkg-build
>>> +++ b/opkg-build
>>> @@ -53,6 +53,10 @@ pkg_appears_sane() {
>>> echo "*** Warning: The following files have names ending in
>>> '~'.
>>> You probably want to remove them: " >&2
>>> ls -ld $tilde_files
>>> + if [ $? -ne 0 ]; then
>>
>> Instead of using $? you could just use the result of "ls" directly, i.e.:
>
> Do you have any specific reason for not use $? variable?, for me is more
> simple to test the exit status in this way.
Using $? works, but I agree with Mike: I think it's cleaner to directly test
the result of ls (and avoids and extra line).
>> if ! ls -ld $tilde_files; then
>>
>>
>>> + echo "*** Error: Fail to list files have names ending in
>>> '~'."
>>> + exit 1
>>> + fi
>>> echo >&2
>>> else
>>> echo "*** Removing the following files: $tilde_files"
>>> @@ -66,6 +70,10 @@ You probably want to remove them: " >&2
>>> echo "*** Warning: The following files have a UID greater
>>> than 99.
>>> You probably want to chown these to a system user: " >&2
>>> ls -ld $large_uid_files
>>> + if [ $? -ne 0 ]; then
>>> + echo "*** Error: Fail to list files have a UID greater
>>> than 99."
>>> + exit 1
>>> + fi
>>> echo >&2
>>> fi
>>>
--
Cheers,
Alejandro
next prev parent reply other threads:[~2016-04-05 14:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-31 21:27 [PATCH][opkg-utils] opkg-build: Exit when fail to list files Aníbal Limón
2016-04-01 5:26 ` Mike Looijmans
2016-04-01 14:50 ` Aníbal Limón
2016-04-05 14:54 ` Alejandro del Castillo [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-04-01 16:27 [PATCH] opkg-utils: opkg-build exit " Aníbal Limón
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5703D194.3070701@ni.com \
--to=alejandro.delcastillo@ni.com \
--cc=anibal.limon@linux.intel.com \
--cc=mike.looijmans@topic.nl \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.