Skip to content
Snippets Groups Projects
Commit 92d52dfd authored by Jan Mach's avatar Jan Mach
Browse files

Improved Debian package (pre|post)(inst|rm) scripts for better package installation.

(Redmine issue: #3387)
parent ba27b312
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Copyright (C) since 2011 CESNET, z.s.p.o # This file is part of Mentat system (https://mentat.cesnet.cz/).
#
# Copyright (C) since 2011 CESNET, z.s.p.o (http://www.ces.net/)
# Use of this source is governed by the MIT license, see LICENSE file. # Use of this source is governed by the MIT license, see LICENSE file.
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
...@@ -41,9 +43,16 @@ done ...@@ -41,9 +43,16 @@ done
# Make sure all configuration files have proper permissions # Make sure all configuration files have proper permissions
/usr/bin/find /etc/mentat/ -name *.conf* -exec /bin/chmod 644 {} \; /usr/bin/find /etc/mentat/ -name *.conf* -exec /bin/chmod 644 {} \;
# Make sure all configuration files have proper permissions
/usr/bin/find /etc/mentat/ -name *.json* -exec /bin/chmod 644 {} \;
# Make sure all cron scripts have proper permissions # Make sure all cron scripts have proper permissions
/usr/bin/find /etc/mentat/ -name cron_* -exec /bin/chmod 644 {} \; /usr/bin/find /etc/mentat/ -name cron_* -exec /bin/chmod 644 {} \;
# Make sure all executable scripts have proper permissions
/usr/bin/find /etc/mentat/scripts/ -name *.py -exec /bin/chmod 755 {} \;
/usr/bin/find /etc/mentat/scripts/ -name *.sh -exec /bin/chmod 755 {} \;
# Check for required dependencies # Check for required dependencies
/etc/mentat/scripts/depcheck.py /etc/mentat/scripts/depcheck.py
exit 0 exit 0
#!/usr/bin/perl #!/usr/bin/perl
#-------------------------------------------------------------------------------
# This file is part of Mentat system (https://mentat.cesnet.cz/).
#
# Copyright (C) since 2011 CESNET, z.s.p.o (http://www.ces.net/)
# Use of this source is governed by the MIT license, see LICENSE file.
#-------------------------------------------------------------------------------
use strict; use strict;
use warnings; use warnings;
print "postrm script launched with args: '@ARGV'\n"; print "mentat-ng: postrm script launched with args: '@ARGV'\n";
exit(0); exit(0);
#!/usr/bin/perl #!/usr/bin/perl
#-------------------------------------------------------------------------------
# This file is part of Mentat system (https://mentat.cesnet.cz/).
#
# Copyright (C) since 2011 CESNET, z.s.p.o (http://www.ces.net/)
# Use of this source is governed by the MIT license, see LICENSE file.
#-------------------------------------------------------------------------------
use strict; use strict;
use warnings; use warnings;
print "preinst script launched with args: '@ARGV'\n"; print "mentat-ng: preinst script launched with args: '@ARGV'\n";
exit(0); exit(0);
#!/usr/bin/perl #!/usr/bin/perl
#-------------------------------------------------------------------------------
# This file is part of Mentat system (https://mentat.cesnet.cz/).
#
# Copyright (C) since 2011 CESNET, z.s.p.o (http://www.ces.net/)
# Use of this source is governed by the MIT license, see LICENSE file.
#-------------------------------------------------------------------------------
use strict; use strict;
use warnings; use warnings;
print "prerm script launched with args: '@ARGV'\n"; print "mentat-ng: prerm script launched with args: '@ARGV'\n";
exit(0); exit(0);
...@@ -58,12 +58,17 @@ if __name__ == "__main__": ...@@ -58,12 +58,17 @@ if __name__ == "__main__":
try: try:
importlib.import_module(l) importlib.import_module(l)
present.append(l) present.append(l)
verbose_print("[SUCCESS] Python3 library dependency OK: '{}'".format(l)) verbose_print("[SUCCESS] mentat-ng - Python3 library dependency OK: '{}'".format(l))
except ImportError: except ImportError:
missing.append(l) missing.append(l)
print("[ ERROR ] Python3 library dependency MISS: '{}'".format(l)) verbose_print("[ ERROR ] mentat-ng - Python3 library dependency MISS: '{}'".format(l))
if len(missing): if len(missing):
print("\n*********************************************************************")
print(" MENTAT-NG: PLEASE INSTALL MISSING PYTHON3 LIBRARY DEPENDENCIES")
for l in missing:
print("\t* {}".format(l))
print("*********************************************************************\n")
sys.exit(1) sys.exit(1)
else: else:
sys.exit(0) sys.exit(0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment