All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][opkg-utils] opkg-build: Exit when fail to list files.
@ 2016-03-31 21:27 Aníbal Limón
  2016-04-01  5:26 ` Mike Looijmans
  0 siblings, 1 reply; 5+ messages in thread
From: Aníbal Limón @ 2016-03-31 21:27 UTC (permalink / raw)
  To: opkg-devel, yocto

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
+			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
 	    
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH][opkg-utils] opkg-build: Exit when fail to list files.
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Looijmans @ 2016-04-01  5:26 UTC (permalink / raw)
  To: yocto

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.:

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
>   	
>



Kind regards,

Mike Looijmans
System Expert

TOPIC Embedded Products
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijmans@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail







^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][opkg-utils] opkg-build: Exit when fail to list files.
  2016-04-01  5:26 ` Mike Looijmans
@ 2016-04-01 14:50   ` Aníbal Limón
  2016-04-05 14:54     ` Alejandro del Castillo
  0 siblings, 1 reply; 5+ messages in thread
From: Aníbal Limón @ 2016-04-01 14:50 UTC (permalink / raw)
  To: Mike Looijmans, yocto

[-- Attachment #1: Type: text/plain, Size: 2201 bytes --]

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.

> 
> 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
>>      
>>
> 
> 
> 
> Kind regards,
> 
> Mike Looijmans
> System Expert
> 
> TOPIC Embedded Products
> Eindhovenseweg 32-C, NL-5683 KH Best
> Postbus 440, NL-5680 AK Best
> Telefoon: +31 (0) 499 33 69 79
> E-mail: mike.looijmans@topicproducts.com
> Website: www.topicproducts.com
> 
> Please consider the environment before printing this e-mail
> 
> 
> 
> 
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] opkg-utils: opkg-build exit when fail to list files.
@ 2016-04-01 16:27 Aníbal Limón
  0 siblings, 0 replies; 5+ messages in thread
From: Aníbal Limón @ 2016-04-01 16:27 UTC (permalink / raw)
  To: openembedded-core

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-Exit-when-fail-to-list-files.patch  | 45 ++++++++++++++++++++++
 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |  4 +-
 2 files changed, 47 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch

diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch
new file mode 100644
index 0000000..6c66902
--- /dev/null
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils/opkg-build-Exit-when-fail-to-list-files.patch
@@ -0,0 +1,45 @@
+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]
+
+Upstream-Status: Submitted [2]
+
+[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8926#c0
+[2] https://groups.google.com/forum/#!topic/opkg-devel/cmX02bgHZms
+
+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
++			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
+ 	    
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
index 1bc561c..22f45a1 100644
--- a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
@@ -10,8 +10,8 @@ PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtu
 SRCREV = "53274f087565fd45d8452c5367997ba6a682a37a"
 PV = "0.1.8+git${SRCPV}"
 
-SRC_URI = "git://git.yoctoproject.org/opkg-utils"
-
+SRC_URI = "git://git.yoctoproject.org/opkg-utils \
+           file://opkg-build-Exit-when-fail-to-list-files.patch"
 SRC_URI_append_class-native = " file://tar_ignore_error.patch"
 
 S = "${WORKDIR}/git"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH][opkg-utils] opkg-build: Exit when fail to list files.
  2016-04-01 14:50   ` Aníbal Limón
@ 2016-04-05 14:54     ` Alejandro del Castillo
  0 siblings, 0 replies; 5+ messages in thread
From: Alejandro del Castillo @ 2016-04-05 14:54 UTC (permalink / raw)
  To: Aníbal Limón, Mike Looijmans, yocto



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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-04-05 14:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2016-04-01 16:27 [PATCH] opkg-utils: opkg-build exit " Aníbal Limón

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.