Overview

Request 605312 superseded

No description set
Loading...

Ludwig Nussel's avatar

use single [ and change the expression to use ||. if you use && and the condition fails the whole script fails.


Franck Bui's avatar

I don't think you need to use || here, using && should be fine and should make the whole expression much more readable IMHO.


Dominique Leuenberger's avatar

No, @lnussel is right here...

if you use ^^, you end up with:

#[ -w /test ] && echo writable
# echo $?
1

(if /test is not writable - the exit code of the script would be 1, meaning an error for rpm)


Franck Bui's avatar

I was assuming rpm was using "set -e" when running its scriptlets. If so I don't think the code snippet you showed won't trigger an error.


Franck Bui's avatar

s/wont/will


Thomas Blume's avatar
author source maintainer

just to make sure, you mean something like that:

[ ! -w %{_sysconfdir}/machine-id ] || chmod 444 %{_sysconfdir}/machine-id

?


Request History
Thomas Blume's avatar

tsaupe created request


Saul Goodman's avatar

licensedigger accepted review

ok


Factory Auto's avatar

factory-auto added opensuse-review-team as a reviewer

Please review sources


Factory Auto's avatar

factory-auto added repo-checker as a reviewer

Please review build success


Factory Auto's avatar

factory-auto accepted review

Check script succeeded


Dominique Leuenberger's avatar

dimstar declined review

use single [ (no bashism if possible) and change the expression to use ||. if you use && and the condition fails the whole script fails.


Dominique Leuenberger's avatar

dimstar declined request

use single [ (no bashism if possible) and change the expression to use ||. if you use && and the condition fails the whole script fails.


Franck Bui's avatar

fbui superseded request

superseded by 644490

openSUSE Build Service is sponsored by