Package: tomcat7
Version: 7.0.26-1
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu precise ubuntu-patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dear Maintainer,

tomcat7-instance-create does not handle paths that contain spaces, for example:

   tomcat7-instance-create ~/A\ B 

Just fails with a load of error messages.

In Ubuntu, the attached patch was applied to achieve the following:

  * Handle creation of user instances with pathnames containing spaces
    (LP: #977498):
    - d/tomcat7-instance-create: Quote access to files and directories
      so that spaces can be used when creating user instances.

Thanks for considering the patch.


- -- System Information:
Debian Release: wheezy/sid
  APT prefers precise-updates
  APT policy: (500, 'precise-updates'), (500, 'precise-security'), (500, 
'precise')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-22-generic (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJPhVneAAoJEL/srsug59jDQvcQAMbyqhmS/Eq9bEvsttetTBOl
w9Y/gVImSO3bfbP4wS1R0JuVpEY/7Ad4zqPtsR47PMgwaMrN8GGJHA3qgfJfUu/M
+4MpODFsG8laR1J1rpDd6tud/PIftJnOQ1XQkdvoeJL3dm+x4V/ZOllQ/NmKhLWp
JHixRVxtHuuAp15o2ACwp+FjPWWLCvPPQhihGztOXXQaeLWQVWcaFFJe2KoIJav9
DKFp/bC8BVk90wlYHfeh4Q9G3cIfsUfBJDV/TBaLEwqTKnxeneG9i7oQO7A7Jtph
EtAS0znewaTh48ZYsmhDBj7GOQeVDvzoy+DZKmocpSLgbB8jObcyJjdoR8CaaFzE
9tuGZkDsA+kG0J+2+J6aapRXyt0F0pq47QzLgltaN0NtJIxlmU6yKUhWa7A7ccrr
C83/LPsPZVENeiQ68fbMPgRG26EochRVjps+7WSrGdXeBtc5ulWkqEDvogXjSfNz
eb097JatSl24Yex1CQ4nf+OJrTqTygOUTsq24PksGNnm8spNn/2p+ZKwsJwuBa7A
GomvtJaATLIuBwcvyyFG5uLvN8CZ0my5F09H/xaXwnwA4/xsgAakkGcpa9oOXsqY
2FlxczZ8Bozx7RWrnP2cjNFpMcF6GtyIkGzrSBcOWYMTvyKVzVAzR5nvZi5Pn0ks
yW8LlODYy1xO1vaLEzFC
=+Q2E
-----END PGP SIGNATURE-----
diff -Nru tomcat7-7.0.26/debian/tomcat7-instance-create tomcat7-7.0.26/debian/tomcat7-instance-create
--- tomcat7-7.0.26/debian/tomcat7-instance-create	2012-03-07 17:36:02.000000000 +0000
+++ tomcat7-7.0.26/debian/tomcat7-instance-create	2012-04-11 10:49:32.000000000 +0100
@@ -106,34 +106,34 @@
   read answer
 fi
 
-mkdir -p ${TARGET}
+mkdir -p "${TARGET}"
 
-FULLTARGET=`cd ${TARGET} > /dev/null && pwd`
+FULLTARGET=`cd "${TARGET}" > /dev/null && pwd`
 
-mkdir ${TARGET}/conf
-mkdir ${TARGET}/logs
-mkdir ${TARGET}/webapps
-mkdir ${TARGET}/work
-mkdir ${TARGET}/temp
-cp -r /usr/share/tomcat7/skel/* ${TARGET}
+mkdir "${TARGET}/conf"
+mkdir "${TARGET}/logs"
+mkdir "${TARGET}/webapps"
+mkdir "${TARGET}/work"
+mkdir "${TARGET}/temp"
+cp -r /usr/share/tomcat7/skel/* "${TARGET}"
 
-sed -i -e "s/Connector port=\"8080\"/Connector port=\"${HPORT}\"/;s/Server port=\"8005\" shutdown=\"SHUTDOWN\"/Server port=\"${CPORT}\" shutdown=\"${CWORD}\"/" ${TARGET}/conf/server.xml
+sed -i -e "s/Connector port=\"8080\"/Connector port=\"${HPORT}\"/;s/Server port=\"8005\" shutdown=\"SHUTDOWN\"/Server port=\"${CPORT}\" shutdown=\"${CWORD}\"/" "${TARGET}/conf/server.xml"
 
-cat > ${TARGET}/bin/startup.sh << EOT
+cat > "${TARGET}/bin/startup.sh" << EOT
 #!/bin/sh
-export CATALINA_BASE=${FULLTARGET}
+export CATALINA_BASE="${FULLTARGET}"
 /usr/share/tomcat7/bin/startup.sh
 echo "Tomcat started"
 EOT
 
-cat > ${TARGET}/bin/shutdown.sh << EOT
+cat > "${TARGET}/bin/shutdown.sh" << EOT
 #!/bin/sh
-export CATALINA_BASE=${FULLTARGET}
+export CATALINA_BASE="${FULLTARGET}"
 /usr/share/tomcat7/bin/shutdown.sh
 echo "Tomcat stopped"
 EOT
 
-chmod a+x ${TARGET}/bin/startup.sh ${TARGET}/bin/shutdown.sh
+chmod a+x "${TARGET}/bin/startup.sh" "${TARGET}/bin/shutdown.sh"
 echo "* New Tomcat instance created in ${TARGET}"
 echo "* You might want to edit default configuration in ${TARGET}/conf"
 echo "* Run ${TARGET}/bin/startup.sh to start your Tomcat instance"

Reply via email to