Update post-install scripts
svn: r21265
This commit is contained in:
parent
17e70f14b3
commit
7afc3f7112
19
setup.py
19
setup.py
@ -241,7 +241,7 @@ def write_const_py(command):
|
|||||||
|
|
||||||
substitute_variables(const_py_in, const_py, subst_vars)
|
substitute_variables(const_py_in, const_py, subst_vars)
|
||||||
|
|
||||||
def update_posix():
|
def update_posix(command):
|
||||||
'''
|
'''
|
||||||
post-hook to update Linux systems after install
|
post-hook to update Linux systems after install
|
||||||
|
|
||||||
@ -251,14 +251,9 @@ def update_posix():
|
|||||||
if os.name != 'posix':
|
if os.name != 'posix':
|
||||||
return
|
return
|
||||||
# these commands will be ran on a Unix/ Linux system after install only...
|
# these commands will be ran on a Unix/ Linux system after install only...
|
||||||
for cmd, options in (
|
os.system('update-desktop-database &> /dev/null')
|
||||||
('ldconfig', ''),
|
mime_dir = command.install_data + '/share/mime'
|
||||||
('update-desktop-database', '&> /dev/null'),
|
os.system('update-mime-database ' + mime_dir + ' &> /dev/null')
|
||||||
('update-mime-database', '/usr/share/mime &> /dev/null'),
|
|
||||||
('gtk-update-icon-cache', '--quiet /usr/share/icons/hicolor')):
|
|
||||||
sys_cmd = ('%(command)s %(opts)s') % {
|
|
||||||
'command' : cmd, 'opts' : options}
|
|
||||||
os.system(sys_cmd)
|
|
||||||
|
|
||||||
class build(_build):
|
class build(_build):
|
||||||
"""Custom build command."""
|
"""Custom build command."""
|
||||||
@ -283,10 +278,10 @@ class install(_install):
|
|||||||
write_const_py(self)
|
write_const_py(self)
|
||||||
_install.run(self)
|
_install.run(self)
|
||||||
if self.enable_packager_mode:
|
if self.enable_packager_mode:
|
||||||
log.warn('WARNING: Packager mode enabled. Post-installation mime '
|
log.warn('WARNING: Packager mode enabled. Post-installation '
|
||||||
'type processing was not run.')
|
'scripts were not run.')
|
||||||
else:
|
else:
|
||||||
update_posix()
|
update_posix(self)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user