[rkward] macports: hardened the build script

m.eik michalke meik.michalke at uni-duesseldorf.de
Sun Jan 3 18:31:21 UTC 2016


Git commit 8e1839fce29df20625153632b733f79ec12130d8 by m.eik michalke.
Committed on 03/01/2016 at 10:49.
Pushed by meikm into branch 'master'.

hardened the build script

  - made sure spaces in file paths don't mess anything up

M  +83   -83   macports/update_bundle.sh

http://commits.kde.org/rkward/8e1839fce29df20625153632b733f79ec12130d8

diff --git a/macports/update_bundle.sh b/macports/update_bundle.sh
index 272755e..94071a9 100755
--- a/macports/update_bundle.sh
+++ b/macports/update_bundle.sh
@@ -8,7 +8,7 @@ MPTINST=/opt/rkward
 # specify the target port
 PTARGET=rkward-devel
 PNSUFFX="-devel"
-USERBIN=${HOME}/bin
+USERBIN="${HOME}/bin"
 
 # initalize varaibles
 DEVEL=true
@@ -33,9 +33,9 @@ WIPEINST=false
 PVARIANT=""
 GITBRANCH="master"
 # specify work directory
-WORKDIR=/opt/ports/kde/${PTARGET}/work
+WORKDIR="${SRCPATH}/kde/${PTARGET}/work"
 # specify local public directory
-LPUBDIR=~/Public/rkward
+LPUBDIR="~/Public/rkward"
 # specify application dir used
 APPLDIR=/Applications/RKWard
 # specify the prefix for build directories below ${MPTINST}/var/macports/build
@@ -70,7 +70,7 @@ declare -a EXCLPKG=(audio_lame audio_libmodplug audio_libopus \
 
 #SVNREPO=http://svn.code.sf.net/p/rkward/code/trunk
 GITREPO=http://anongit.kde.org/rkward.git
-OLDWD=$(pwd)
+OLDWD="$(pwd)"
 
 if [[ $1 == "" ]] ; then
  echo "Usage: update_bundle.sh OPTIONS
@@ -126,7 +126,7 @@ while getopts ":CDE:dbfGlLprmsS:cU:xXF:" OPT; do
     S) SSHGEN=true >&2
        SSHCOMMENT=$OPTARG >&2 ;;
     D) PTARGET=rkward >&2
-       WORKDIR="/opt/ports/kde/${PTARGET}/work" >&2
+       WORKDIR="${SRCPATH}/kde/${PTARGET}/work" >&2
        PNSUFFX="" >&2
        DEVEL=false >&2 ;;
     d) DEBUG=true >&2
@@ -134,7 +134,7 @@ while getopts ":CDE:dbfGlLprmsS:cU:xXF:" OPT; do
        PNSUFFX="${PNSUFFX}-debug" >&2 ;;
     b) BINARY=true >&2
        PTARGET=${PTARGET}-binary >&2
-       WORKDIR="/opt/ports/kde/rkward-devel/work" >&2
+       WORKDIR="${SRCPATH}/kde/rkward-devel/work" >&2
        PNSUFFX="${PNSUFFX}-binary" >&2 ;;
     F) FRESHMCP=true >&2
        MCPVERS=$OPTARG >&2 ;;
@@ -205,12 +205,12 @@ if $WIPEINST ; then
       sudo rm "${libsymlink}"
     fi
   done
-  if [ -f ${SRCPATH} ] ; then
+  if [ -f "${SRCPATH}" ] ; then
     echo "removing symlink ${SRCPATH}..."
-    sudo rm ${SRCPATH} || exit 1
+    sudo rm "${SRCPATH}" || exit 1
   fi
   # ensure ${USERBIN}/update_bundle.sh
-  linkbuildscript ${USERBIN}
+  linkbuildscript "${USERBIN}"
   rmdirv "${GITROOT}"
   echo "successfully wiped RKWard from this machine!"
   exit 0
@@ -219,7 +219,7 @@ fi
 # prepare for a clean installation, remove all cached sources
 if $WIPEDSTF ; then
   echo "rm -rf ${MPTINST}/var/macports/distfiles/*"
-  sudo rm -rf ${MPTINST}/var/macports/distfiles/*
+  sudo rm -rf "${MPTINST}/var/macports/distfiles/*"
 fi
 
 if $SSHGEN ; then
@@ -233,12 +233,12 @@ fi
 # prepare build environment
 if $BLDSETUP ; then
   # check for Xcode.app
-  if ! [ -d /Applications/Xcode.app ] ; then
+  if ! [ -d "/Applications/Xcode.app" ] ; then
     echo "you must install Xcode first!"
     exit 1
   fi
   sudo mkdir -p "${GITROOT}" || exit 1
-  sudo chown ${USER} "${GITROOT}" || exit 1
+  sudo chown "${USER}" "${GITROOT}" || exit 1
   cd "${GITROOT}" || exit 1
   if $ANONGIT ; then
     git clone git://anongit.kde.org/rkward.git || exit 1
@@ -255,12 +255,12 @@ if $BLDSETUP ; then
       git checkout "${GITBRANCH}" || exit 1
     fi
   fi
-  echo "sudo ln -s ${GITROOT}/rkward/macports/ /opt/ports"
-  sudo ln -s ${GITROOT}/rkward/macports/ /opt/ports || exit 1
+  echo "sudo ln -s ${GITROOT}/rkward/macports/ ${SRCPATH}"
+  sudo ln -s "${GITROOT}/rkward/macports/" "${SRCPATH}" || exit 1
   linkbuildscript "${USERBIN}"
   if [ -f "${HOME}/.bash_profile" ] ; then
     BPFPATH=$(grep "^PATH" "${HOME}/.bash_profile")
-    if ! $(echo ${BPFPATH} | grep -q "${USERBIN}/:${MPTINST}/bin/:") ; then
+    if ! $(echo "${BPFPATH}" | grep -q "${USERBIN}/:${MPTINST}/bin/:") ; then
       echo "PATH=${USERBIN}/:${MPTINST}/bin/:\$PATH" >> "${HOME}/.bash_profile"
     fi
   else
@@ -280,34 +280,34 @@ if $FRESHMCP ; then
     echo "can't find ${SRCPATH} -- you should call the script with \"-G\" before setting up MacPorts!"
   fi
   echo "creating ${MPTINST}..."
-  sudo mkdir -p ${MPTINST} || exit 1
+  sudo mkdir -p "${MPTINST}" || exit 1
   mkdir /tmp/MP && cd /tmp/MP
   curl "https://distfiles.macports.org/MacPorts/MacPorts-${MCPVERS}.tar.bz2" -o "MacPorts-${MCPVERS}.tar.bz2" || exit 1
   tar xjvf "MacPorts-${MCPVERS}.tar.bz2" || exit 1
   cd "MacPorts-${MCPVERS}" || exit 1
-  ./configure --prefix=${MPTINST}  || exit 1
+  ./configure --prefix="${MPTINST}"  || exit 1
   make || exit 1
   sudo make install || exit 1
-  cd $OLDWD || exit 1
+  cd "${OLDWD}" || exit 1
   rm -rf /tmp/MP || exit 1
   echo "update MacPorts configuration"
-  sudo sed -i -e "s+#\(portautoclean[[:space:]]*\)yes+\1no+" ${MPTINST}/etc/macports/macports.conf
-  sudo sed -i -e "s+\(applications_dir[[:space:]]*\)/Applications/MacPorts+\1${APPLDIR}+" ${MPTINST}/etc/macports/macports.conf
-  sudo ${MPTINST}/bin/port -v selfupdate || exit 1
+  sudo sed -i -e "s+#\(portautoclean[[:space:]]*\)yes+\1no+" "${MPTINST}/etc/macports/macports.conf"
+  sudo sed -i -e "s+\(applications_dir[[:space:]]*\)/Applications/MacPorts+\1${APPLDIR}+" "${MPTINST}/etc/macports/macports.conf"
+  sudo "${MPTINST}/bin/port" -v selfupdate || exit 1
   echo "adding local portfiles to ${MPTINST}/etc/macports/sources.conf..."
-  sudo sed -i -e "s+rsync://rsync.macports.org.*\[default\]+file://${SRCPATH}/\\`echo -e '\n\r'`&+" ${MPTINST}/etc/macports/sources.conf || exit 1
+  sudo sed -i -e "s+rsync://rsync.macports.org.*\[default\]+file://${SRCPATH}/\\`echo -e '\n\r'`&+" "${MPTINST}/etc/macports/sources.conf" || exit 1
   # install a needed gcc/clang first?
   if [[ $CMPLR ]] ; then
-    sudo ${MPTINST}/bin/port -v install ${CMPLR} ${LLVMFIX} || exit 1
+    sudo "${MPTINST}/bin/port" -v install "${CMPLR}" "${LLVMFIX}" || exit 1
   fi
   if [[ $CLANG ]] ; then
-    sudo ${MPTINST}/bin/port -v install ${CLANG} ${LLVMFIX} || exit 1
+    sudo "${MPTINST}/bin/port" -v install "${CLANG}" "${LLVMFIX}" || exit 1
   fi
   # (re-)generate portindex
-  cd ${SRCPATH} || exit 1
-  ${MPTINST}/bin/portindex || exit 1
-  cd $OLDWD || exit 1
-  sudo ${MPTINST}/bin/port -v selfupdate || exit 1
+  cd "${SRCPATH}" || exit 1
+  "${MPTINST}/bin/portindex" || exit 1
+  cd "${OLDWD}" || exit 1
+  sudo "${MPTINST}/bin/port" -v selfupdate || exit 1
   echo "successfully completed reincarnation of ${MPTINST}!"
   exit 0
 fi
@@ -315,37 +315,37 @@ fi
 # update installed ports
 if $UPMPORTS ; then
   echo "sudo ${MPTINST}/bin/port selfupdate"
-  sudo ${MPTINST}/bin/port selfupdate
+  sudo "${MPTINST}/bin/port" selfupdate
   echo "sudo ${MPTINST}/bin/port -v upgrade outdated"
-  sudo ${MPTINST}/bin/port -v upgrade outdated
+  sudo "${MPTINST}/bin/port" -v upgrade outdated
   # get rid of inactive stuff
   echo "sudo ${MPTINST}/bin/port clean inactive"
-  sudo ${MPTINST}/bin/port clean inactive
+  sudo "${MPTINST}/bin/port" clean inactive
   echo "sudo ${MPTINST}/bin/port -f uninstall inactive"
-  sudo ${MPTINST}/bin/port -f uninstall inactive
+  sudo "${MPTINST}/bin/port" -f uninstall inactive
 fi
 
 # remove previous installation and its build left-overs
 if $UPRKWARD ; then
-  INSTALLEDPORTS=$(${MPTINST}/bin/port installed)
+  INSTALLEDPORTS=$("${MPTINST}/bin/port" installed)
   # make sure each instance of previous RKWard installations is removed first
   for i in rkward rkward-devel rkward-binary rkward-devel-binary rkward-debug rkward-devel-debug ; do
-    if [[ $(echo $INSTALLEDPORTS | grep "[[:space:]]${i}[[:space:]]" 2> /dev/null ) ]] ; then
+    if [[ $(echo "$INSTALLEDPORTS" | grep "[[:space:]]${i}[[:space:]]" 2> /dev/null ) ]] ; then
       echo "sudo ${MPTINST}/bin/port uninstall ${i}"
-      sudo ${MPTINST}/bin/port uninstall ${i}
+      sudo "${MPTINST}/bin/port" uninstall "${i}"
       echo "${MPTINST}/bin/port clean ${i}"
-      sudo ${MPTINST}/bin/port clean ${i}
+      sudo "${MPTINST}/bin/port" clean "${i}"
     fi
   done
   # build and install recent version
   echo "sudo ${MPTINST}/bin/port -v install ${PTARGET} ${PVARIANT}"
-  sudo ${MPTINST}/bin/port -v install ${PTARGET} ${PVARIANT} || exit 1
+  sudo "${MPTINST}/bin/port" -v install "${PTARGET}" "${PVARIANT}" || exit 1
 fi
 
 # remove static libraries, they're a waste of disk space
 if $RMSTLIBS ; then
   echo "deleting all static libs in ${MPTINST}/lib/..."
-  sudo rm ${MPTINST}/lib/*.a
+  sudo rm "${MPTINST}/lib/*.a"
   echo "deleting all static libs in ${MPTINST}/var/macports/build..."
   #find "${MPTINST}/var/macports/build" -name "*.a" -exec sudo rm \{\} \;
   # only remove libs in destroot/libs/
@@ -354,7 +354,7 @@ fi
 
 # list disk usage of ports
 if $LSDSKUSG ; then
-  cd ${MPTINST}/var/macports/build/
+  cd "${MPTINST}/var/macports/build/"
   SBFLDRS=$(ls)
   for i in ${SBFLDRS} ; do
     echo $(du -sh ${i}/$(ls ${i}/)/work/destroot | sed -e "s+\(${BLDPRFX}\)\(.*\)\(/work/destroot\)+\2+")
@@ -364,7 +364,7 @@ fi
 # set some variables
 if $COPYMDMD ; then
   # get version information of installed ports
-  PORTVERS=$(${MPTINST}/bin/port list $PTARGET | sed -e "s/.*@//;s/[[:space:]].*//")
+  PORTVERS=$("${MPTINST}/bin/port" list $PTARGET | sed -e "s/.*@//;s/[[:space:]].*//")
   if $DEVEL ; then
     # we moved to git
     # TARGETVERS=${PORTVERS}$(svn info "$SVNREPO" | grep "^Revision:" | sed "s/[^[:digit:]]*//")
@@ -385,23 +385,23 @@ if $COPYMDMD ; then
       TARGETVERS=${PORTVERS}-git$(git ls-remote http://anongit.kde.org/rkward master | cut -c 1-7)
       GOTQUICKGIT=false
     fi
-    if [[ ${GOTQUICKGIT} ]] ; then
+    if ${GOTQUICKGIT} ; then
       CHANGEDATE=$(grep "last change.*<time datetime=" "${TEMPFILE}" | sed "s/.*datetime=\"\(.*\)+00:00.*/\1/g" | sed "s/[^[:digit:]]//g")
       LASTCOMMIT=$(grep -m1 "<td class=\"monospace\">[[:alnum:]]\{7\}" "${TEMPFILE}" | sed "s#.*<td class=\"monospace\">\(.*\)</td>.*#\1#")
       TARGETVERS="${PORTVERS}-git${CHANGEDATE}~${LASTCOMMIT}"
     fi
     rm "${TEMPFILE}"
   else
-    TARGETVERS=$PORTVERS
+    TARGETVERS="$PORTVERS"
   fi
-  KDEVERS=$(${MPTINST}/bin/port list kdelibs4 | sed -e "s/.*@//;s/[[:space:]].*//")
+  KDEVERS=$("${MPTINST}/bin/port" list kdelibs4 | sed -e "s/.*@//;s/[[:space:]].*//")
 fi
 
 # get R version, long and short
 if $BINARY ; then
   RVERS=$(R --version | grep "R version" | sed -e "s/R version \([[:digit:].]*\).*/\1/")
 else
-  RVERS=$(${MPTINST}/bin/port list R-framework | sed -e "s/.*@//;s/[[:space:]].*//")
+  RVERS=$("${MPTINST}/bin/port" list R-framework | sed -e "s/.*@//;s/[[:space:]].*//")
 fi
 # if we have to re-create the symlinks for binary installation
 # this can be used to get the short version numer <major>.<minor>:
@@ -420,28 +420,28 @@ if $MAKEMDMD ; then
     # this is to fix some kind of a race condition: if RKWard gets installed before R-framework,
     # it will create a directory which must actually be a symlink in order for R to run! so we'll
     # move RKWard's own packages before bundling it
-    RKWDSTROOT=${WORKDIR}/destroot
-    RKWRFWPATH=${RKWDSTROOT}/${MPTINST}/Library/Frameworks/R.framework
-    if ! [ -d ${RKWRFWPATH} ] ; then
+    RKWDSTROOT="${WORKDIR}/destroot"
+    RKWRFWPATH="${RKWDSTROOT}/${MPTINST}/Library/Frameworks/R.framework"
+    if ! [ -d "${RKWRFWPATH}" ] ; then
       echo "cannot find R.framework, bogus path? ${RKWRFWPATH}"
       exit 1
     fi
-    RFWPATH=${MPTINST}/var/macports/build/${BLDPRFX}math_R-framework/R-framework/work/destroot
-    RVERSPATH=${RFWPATH}/${MPTINST}/Library/Frameworks/R.framework/Versions
+    RFWPATH="${MPTINST}/var/macports/build/${BLDPRFX}math_R-framework/R-framework/work/destroot"
+    RVERSPATH="${RFWPATH}/${MPTINST}/Library/Frameworks/R.framework/Versions"
     # this variable will hold the R version of the installed framework
-    RFWVERS=$(cd ${RVERSPATH} && find . -type d -maxdepth 1 -mindepth 1 | sed -e "s#./##" || exit 1)
+    RFWVERS=$(cd "${RVERSPATH}" && find . -type d -maxdepth 1 -mindepth 1 | sed -e "s#./##" || exit 1)
     if [[ $RFWVERS == "" ]] ; then
       echo "could not get R version! aborting..."
       exit 1
     fi
     # only do this if the Resources directory exists
-    if [ -d ${RKWRFWPATH}/Resources ] ; then
+    if [ -d "${RKWRFWPATH}/Resources" ] ; then
       # now cd into RKWard's destroot and re-arrange the directory structure
-      cd $RKWRFWPATH || exit 1
+      cd "${RKWRFWPATH}" || exit 1
       sudo mkdir -p "Versions/${RFWVERS}/Resources" || exit 1
       sudo mv "Resources/library" "Versions/${RFWVERS}/Resources/" || exit 1
       sudo rm -rf "Resources" || exit 1
-      cd $OLDWD || exit 1
+      cd "${OLDWD}" || exit 1
     fi
   fi
   if $DOEXCPCK ; then
@@ -449,11 +449,11 @@ if $MAKEMDMD ; then
     # defined in the array EXCLPKG with empty ones, so their stuff is not included
     for i in ${EXCLPKG[@]} ; do
       THISPKG=${MPTINST}/var/macports/build/${BLDPRFX}${i}
-      if [ -d ${THISPKG} ] ; then
+      if [ -d "${THISPKG}" ] ; then
         SUBFLDR=$(ls $THISPKG)
-        if [ -d ${THISPKG}/${SUBFLDR}/work/destroot ] && [ ! -d ${THISPKG}/${SUBFLDR}/work/destroot_off ]; then
-          sudo mv ${THISPKG}/${SUBFLDR}/work/destroot ${THISPKG}/${SUBFLDR}/work/destroot_off
-          sudo mkdir ${THISPKG}/${SUBFLDR}/work/destroot
+        if [ -d "${THISPKG}/${SUBFLDR}/work/destroot" ] && [ ! -d "${THISPKG}/${SUBFLDR}/work/destroot_off" ]; then
+          sudo mv "${THISPKG}/${SUBFLDR}/work/destroot" "${THISPKG}/${SUBFLDR}/work/destroot_off"
+          sudo mkdir "${THISPKG}/${SUBFLDR}/work/destroot"
         fi
         unset SUBFLDR
       else
@@ -466,17 +466,17 @@ if $MAKEMDMD ; then
 #  # cleaning boost, the avahi port somehow gets installed in two varaints...
 #  sudo port clean boost
   echo "sudo ${MPTINST}/bin/port -v mpkg ${PTARGET}"
-  sudo ${MPTINST}/bin/port -v mpkg ${PTARGET} || exit 1
+  sudo "${MPTINST}/bin/port" -v mpkg "${PTARGET}" || exit 1
 
   if $DOEXCPCK ; then
     # restore original destroot directories
     for i in ${EXCLPKG[@]} ; do
-      THISPKG=${MPTINST}/var/macports/build/${BLDPRFX}${i}
-      if [ -d ${THISPKG} ] ; then
-        SUBFLDR=$(ls $THISPKG)
-        if [ -d ${THISPKG}/${SUBFLDR}/work/destroot_off ] ; then
-          sudo rmdir ${THISPKG}/${SUBFLDR}/work/destroot
-          sudo mv ${THISPKG}/${SUBFLDR}/work/destroot_off ${THISPKG}/${SUBFLDR}/work/destroot
+      THISPKG="${MPTINST}/var/macports/build/${BLDPRFX}${i}"
+      if [ -d "${THISPKG}" ] ; then
+        SUBFLDR="$(ls $THISPKG)"
+        if [ -d "${THISPKG}/${SUBFLDR}/work/destroot_off" ] ; then
+          sudo rmdir "${THISPKG}/${SUBFLDR}/work/destroot"
+          sudo mv "${THISPKG}/${SUBFLDR}/work/destroot_off" "${THISPKG}/${SUBFLDR}/work/destroot"
         fi
         unset SUBFLDR
       fi
@@ -484,30 +484,30 @@ if $MAKEMDMD ; then
     done
   fi
   if $RPATHFIX ; then
-    if [ -d ${RKWRFWPATH}/Versions ] ; then
-      cd $RKWRFWPATH || exit 1
+    if [ -d "${RKWRFWPATH}/Versions" ] ; then
+      cd "${RKWRFWPATH}" || exit 1
       sudo mkdir -p "Resources" || exit 1
       sudo mv "Versions/${RFWVERS}/Resources/library" "Resources/" || exit 1
       sudo rm -rf "Versions" || exit 1
-      cd $OLDWD || exit 1
+      cd "${OLDWD}" || exit 1
     fi
   fi
 
 
   # copy the image file to a public directory
   if $COPYMDMD ; then
-    MPKGFILE=${WORKDIR}/${PTARGET}-${PORTVERS}.pkg
+    MPKGFILE="${WORKDIR}/${PTARGET}-${PORTVERS}.pkg"
     if $BINARY ; then
-      TRGTFILE=${LPUBDIR}/RKWard${PNSUFFX}-${TARGETVERS}_KDE-${KDEVERS}_needs_CRAN_R-${RVERS}.pkg
+      TRGTFILE="${LPUBDIR}/RKWard${PNSUFFX}-${TARGETVERS}_KDE-${KDEVERS}_needs_CRAN_R-${RVERS}.pkg"
     else
-      TRGTFILE=${LPUBDIR}/RKWard${PNSUFFX}-${TARGETVERS}_R-${RVERS}_KDE-${KDEVERS}_MacOSX_bundle.pkg
+      TRGTFILE="${LPUBDIR}/RKWard${PNSUFFX}-${TARGETVERS}_R-${RVERS}_KDE-${KDEVERS}_MacOSX_bundle.pkg"
     fi
-    if ! [ -d ${LPUBDIR} ] ; then
+    if ! [ -d "${LPUBDIR}" ] ; then
       echo "creating directory: ${LPUBDIR}"
-      mkdir -p ${LPUBDIR} || exit 1
+      mkdir -p "${LPUBDIR}" || exit 1
     fi
     echo "copying: $MPKGFILE to $TRGTFILE ..."
-    cp -av $MPKGFILE $TRGTFILE
+    cp -av "${MPKGFILE}" "${TRGTFILE}"
     echo "done."
   fi
 fi
@@ -516,26 +516,26 @@ fi
 if $MKSRCTAR ; then
   if ! $COPYMDMD ; then
     # get version information of installed ports
-    PORTVERS=$(${MPTINST}/bin/port list $PTARGET | sed -e "s/.*@//;s/[[:space:]].*//")
+    PORTVERS=$("${MPTINST}/bin/port" list $PTARGET | sed -e "s/.*@//;s/[[:space:]].*//")
   fi
-  SRCFILE=${SRCPATH}/sources_bundle_RKWard-${PORTVERS}_${SRCDATE}.tar
-  if [ -f $SRCFILE ] ; then
-    rm $SRCFILE || exit 1
+  SRCFILE="${SRCPATH}/sources_bundle_RKWard-${PORTVERS}_${SRCDATE}.tar"
+  if [ -f "${SRCFILE}" ] ; then
+    rm "${SRCFILE}" || exit 1
   fi
-  tar cvf $SRCFILE ${MPTINST}/var/macports/distfiles || exit 1
+  tar cvf "${SRCFILE}" "${MPTINST}/var/macports/distfiles" || exit 1
   # copy the source archive to a public directory
   if $COPYMDMD ; then
     if $BINARY ; then
-      TRGSFILE=${LPUBDIR}/RKWard${PNSUFFX}-${TARGETVERS}_KDE-${KDEVERS}_src.tar
+      TRGSFILE="${LPUBDIR}/RKWard${PNSUFFX}-${TARGETVERS}_KDE-${KDEVERS}_src.tar"
     else
-      TRGSFILE=${LPUBDIR}/RKWard${PNSUFFX}-${TARGETVERS}_R-${RVERS}_KDE-${KDEVERS}_src.tar
+      TRGSFILE="${LPUBDIR}/RKWard${PNSUFFX}-${TARGETVERS}_R-${RVERS}_KDE-${KDEVERS}_src.tar"
     fi
-    if ! [ -d ${LPUBDIR} ] ; then
+    if ! [ -d "${LPUBDIR}" ] ; then
       echo "creating directory: ${LPUBDIR}"
-      mkdir -p ${LPUBDIR} || exit 1
+      mkdir -p "${LPUBDIR}" || exit 1
     fi
     echo "copying: $SRCFILE to $TRGSFILE ..."
-    cp -av $SRCFILE $TRGSFILE
+    cp -av "${SRCFILE}" "${TRGSFILE}"
     echo "done."
   fi
 fi



More information about the rkward-tracker mailing list