Bug 288461 - digikam: bashism in /bin/sh script [patch]
Summary: digikam: bashism in /bin/sh script [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Maintenance-Database (show other bugs)
Version: 2.3.0
Platform: Debian unstable Linux
: NOR minor
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-08 09:49 UTC by Mark Purcell
Modified: 2017-07-14 14:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.5.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Purcell 2011-12-08 09:49:21 UTC
Version:           2.3.0 (using KDE 4.7.3) 
OS:                Linux

# http://bugs.debian.org/581078
#
Index: digikam-2.2.0/core/utilities/scripts/cleanup_digikamdb/cleanup_digikamdb
===================================================================
--- digikam-2.2.0.orig/core/utilities/scripts/cleanup_digikamdb/cleanup_digikamdb       2011-10-03 21:34:14.000000000 +1100
+++ digikam-2.2.0/core/utilities/scripts/cleanup_digikamdb/cleanup_digikamdb    2011-10-23 10:55:39.000000000 +1100
@@ -110,14 +110,14 @@
 
 cleanupDB()
 {
-    cd "$1" 2&> /dev/null
+    cd "$1" > /dev/null 2>&1
     if [ $? = 0 ]; then
         local db_out="${output_str_database}:"
-        echo -e "${output_str_location}:\t$(pwd)"
+        echo "${output_str_location}:  $(pwd)"
 
         for db in $(eval "find . ${db_find_cmd} 2> /dev/null")
         do
-            echo -ne "${db_out}\t${db} ... "
+            echo -n "${db_out} ${db} ... "
             sqlite3 ${db} "VACUUM;"
             if [ $? = 0 ]
             then
@@ -126,9 +126,12 @@
                 echo "failed!"
             fi
         done
-        echo -e "\n=> Finished";
+        echo
+        echo "=> Finished"
     else
-        echo -e "\nI was not able to enter the database folder.\n"
+        echo
+        echo "I was not able to enter the database folder."
+        echo
         echo "Make sure that the variable '${config_key}' in your 'digikamrc' config file"
         echo "is set correctly and that you have permissions to access the database folder."
     fi


Reproducible: Always

Steps to Reproduce:
Source code inspection


Expected Results:  
https://wiki.ubuntu.com/DashAsBinSh

OS: Linux (x86_64) release 3.1.0-1-amd64
Compiler: gcc
Comment 1 caulier.gilles 2011-12-08 09:53:29 UTC
With this patch, script still compatible with old BASH shell ?

Gilles Caulier
Comment 2 Mark Purcell 2011-12-08 09:56:49 UTC
On Thu, 8 Dec 2011 20:53:29 Gilles Caulier wrote:
> 09:53:29 --- With this patch, script still compatible with old BASH shell

Gilles,

Yes with the patch the script is compatable with bash/ dash or anything else.

Mark
Comment 3 caulier.gilles 2011-12-13 10:21:53 UTC
patch applied to git master

Gilles Caulier