Few fixes.

Ubuntu installation (fix #4)
Generate map files when all shortcut is used (see #8)
Fix freshclam execution on Ubuntu
This commit is contained in:
Antoine Nguyen
2015-11-06 09:45:05 +01:00
parent 1824707d76
commit 5496f0caef
7 changed files with 41 additions and 16 deletions

View File

@@ -4,6 +4,7 @@ import contextlib
import datetime
import glob
import os
import platform
import shutil
import string
import subprocess
@@ -66,6 +67,18 @@ def exec_cmd(cmd, sudo_user=None, pinput=None, **kwargs):
return process.returncode, output
def dist_name():
"""Try to guess the distribution name."""
name, version, _id = platform.linux_distribution()
return "unknown" if not name else name.lower()
def preconfigure_package(name, question, qtype, answer):
"""Pre-configure a package before installation."""
line = "{0} {0}/{1} {2} {3}".format(name, question, qtype, answer)
exec_cmd("echo '{}' | debconf-set-selections".format(line))
def install_system_package(name, update=False):
"""Install a package system-wide."""
if update: