Adding nanorc
This commit is contained in:
@@ -467,11 +467,11 @@ class WOStackController(CementBaseController):
|
|||||||
Log.debug(self, "Setting packages variable for nanorc")
|
Log.debug(self, "Setting packages variable for nanorc")
|
||||||
apt_packages = apt_packages + ['nano']
|
apt_packages = apt_packages + ['nano']
|
||||||
packages = [
|
packages = [
|
||||||
['https://github.com/scopatz/nanorc/archive/master.tar.gz',
|
['https://github.com/scopatz/'
|
||||||
|
'nanorc/archive/master.tar.gz',
|
||||||
'/var/lib/wo/tmp/nanorc.tar.gz',
|
'/var/lib/wo/tmp/nanorc.tar.gz',
|
||||||
'nanorc']]
|
'nanorc']]
|
||||||
|
|
||||||
|
|
||||||
# UTILS
|
# UTILS
|
||||||
if pargs.utils:
|
if pargs.utils:
|
||||||
Log.debug(self, "Setting packages variable for utils")
|
Log.debug(self, "Setting packages variable for utils")
|
||||||
|
|||||||
@@ -1436,6 +1436,19 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
WOFileUtils.chmod(
|
WOFileUtils.chmod(
|
||||||
self, "/usr/local/sbin/update-ngxblocker", 0o700)
|
self, "/usr/local/sbin/update-ngxblocker", 0o700)
|
||||||
|
|
||||||
|
if any('/var/lib/wo/tmp/nanorc.tar.gz' == x[1]
|
||||||
|
for x in packages):
|
||||||
|
WOExtract.extract(self, '/var/lib/wo/tmp/nanorc.tar.gz',
|
||||||
|
'/var/lib/wo/tmp/')
|
||||||
|
WOFileUtils.mvfile(self, '/var/lib/wo/tmp/nanorc-master',
|
||||||
|
'/usr/share/nano-syntax-highlighting')
|
||||||
|
if os.path.exists('/etc/nanorc'):
|
||||||
|
Log.debug(
|
||||||
|
self, 'including nano syntax highlighting to /etc/nanorc')
|
||||||
|
WOFileUtils.textappend(
|
||||||
|
self, '/etc/nanorc', 'include /usr/share/'
|
||||||
|
'nano-syntax-highlighting/*.nanorc')
|
||||||
|
|
||||||
|
|
||||||
def pre_stack(self):
|
def pre_stack(self):
|
||||||
"""Inital server configuration and tweak"""
|
"""Inital server configuration and tweak"""
|
||||||
|
|||||||
@@ -368,4 +368,4 @@ class WOFileUtils():
|
|||||||
final_file.write('{0}'.format(content))
|
final_file.write('{0}'.format(content))
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
Log.debug(self, "{0}".format(e))
|
Log.debug(self, "{0}".format(e))
|
||||||
Log.error(self, "Unable to write content in {0}".format(path))
|
Log.error(self, "Unable to append content in {0}".format(path))
|
||||||
|
|||||||
Reference in New Issue
Block a user