summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevan Franchini <twitch153@hotmail.com>2013-08-23 15:39:31 -0400
committerAnthony G. Basile <blueness@gentoo.org>2013-08-24 19:02:51 -0400
commit3bbdf6579d88c0abe77519e0148dd0a7dcc7d3fe (patch)
treed33b77dbf8a4c9d59ccf9ae4fd565eb2c9ce246b
parentWebappConfig/config.py: fix indentation (diff)
downloadwebapp-config-3bbdf6579d88c0abe77519e0148dd0a7dcc7d3fe.tar.gz
webapp-config-3bbdf6579d88c0abe77519e0148dd0a7dcc7d3fe.tar.bz2
webapp-config-3bbdf6579d88c0abe77519e0148dd0a7dcc7d3fe.zip
Webappconfig/{config.py,worker.py}: Adds configurable --copy option.
This allows for altering the value of vhost_link_type in /etc/vhosts/webapp-config to copy files by default when installing a webapp as opposed to soft-linking or hard-linking. This patch also repairs the previous damage in which the behavior of the --copy flag was being ignored; due to the fact that the boolean g_copy was not being passed down throughout the program because of the extra --cp flag. Man page alterations have also been made to reflect the removal of the --cp flag in the program. X-Gentoo-Bug: 231482 X-Gentoo-Bug-URL: https://bugs.gentoo.org/231482 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r--WebappConfig/config.py11
-rw-r--r--WebappConfig/worker.py2
-rw-r--r--doc/webapp-config.8.xml1
3 files changed, 7 insertions, 7 deletions
diff --git a/WebappConfig/config.py b/WebappConfig/config.py
index bb86a55..26eab59 100644
--- a/WebappConfig/config.py
+++ b/WebappConfig/config.py
@@ -490,8 +490,7 @@ class Config:
' when creating virtual files. <NOTE>: some pack'
'ages will not work if you use this option')
- group.add_option('--cp',
- '--copy',
+ group.add_option('--copy',
action='store_true',
help = 'Directly copy the webapp files from'
' the /usr/share/webapps/ directory when installing'
@@ -1027,12 +1026,14 @@ class Config:
self.config.set('USER', 'g_link_type', 'soft')
- elif (self.config.has_option('USER', 'g_copy') and
- self.config.getboolean('USER', 'g_copy')):
+ elif ((self.config.has_option('USER', 'vhost_link_type') and
+ self.config.get('USER', 'vhost_link_type') == 'soft') or
+ (self.config.has_option('USER', 'g_copy') and
+ self.config.getboolean('USER', 'g_copy'))):
OUT.debug('Selecting copying of links', 7)
- self.config.set('USER', 'g_link_type', 'clone')
+ self.config.set('USER', 'g_link_type', 'copy')
else:
diff --git a/WebappConfig/worker.py b/WebappConfig/worker.py
index 250f068..5b10060 100644
--- a/WebappConfig/worker.py
+++ b/WebappConfig/worker.py
@@ -508,7 +508,7 @@ class WebappAdd:
if self.__v:
OUT.warn('Failed to softlink (' + str(e) + ')')
- elif self.__link_type == 'clone':
+ elif self.__link_type == 'copy':
try:
OUT.debug('Trying to copy files directly', 8)
diff --git a/doc/webapp-config.8.xml b/doc/webapp-config.8.xml
index 5b0048b..459e301 100644
--- a/doc/webapp-config.8.xml
+++ b/doc/webapp-config.8.xml
@@ -473,7 +473,6 @@
</varlistentry>
<varlistentry>
- <term><option>--cp</option></term>
<term><option>--copy</option></term>
<listitem>
<para>Use this option to create the virtual copy by copying the files from the <filename>/usr/share/webapps/</filename> directories.</para>