Ofer Schreiber has uploaded a new change for review.

Change subject: packaging: Avoid using the file command
......................................................................

packaging: Avoid using the file command

There is no need to execute `file` in order to determine if a given file
is an executable, the bulitin -x test is enough.

Change-Id: I190571c5b36f08772fc795eca9fbd082ba248c04
Signed-off-by: Ofer Schreiber <[email protected]>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1029036
---
M packaging/dbscripts/dbfunctions.sh
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/76/21176/1

diff --git a/packaging/dbscripts/dbfunctions.sh 
b/packaging/dbscripts/dbfunctions.sh
index 3504690..217934a 100755
--- a/packaging/dbscripts/dbfunctions.sh
+++ b/packaging/dbscripts/dbfunctions.sh
@@ -218,8 +218,7 @@
 
 run_file() {
    local execFile=${1}
-   isShellScript=$(file $execFile | grep "shell" | wc -l)
-   if [ $isShellScript -gt 0 ]; then
+   if [ -x "${execFile}" ]; then
        echo "Running upgrade shell script $execFile ..."
        export  DATABASE="${DATABASE}" SERVERNAME="${SERVERNAME}" 
PORT="${PORT}" USERNAME="${USERNAME}"
       ./$execFile


-- 
To view, visit http://gerrit.ovirt.org/21176
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I190571c5b36f08772fc795eca9fbd082ba248c04
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ofer Schreiber <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to