Commit 892cc46d authored by Tails developers's avatar Tails developers
Browse files

Revert "Merge branch 'feature/consistent-peristence-path' into stable"

This reverts commit bde4a069, reversing
changes made to 570d4114.

The wrong branch was merged.
parent bde4a069
......@@ -2,13 +2,14 @@
import gettext
import syslog
import glob
import os.path
import sys
import subprocess
PERSISTENCE_DIR="/live/persistence/TailsData_unlocked"
PACKAGES_LIST_FILE= PERSISTENCE_DIR + "/live-additional-software.conf"
PACKAGES_LIST_FILE="live-additional-software.conf"
ACTIVATION_FILE="/var/run/live-additional-software/activated"
UNLOCKED_PERSISTENCE_DIRS_GLOB="/live/persistence/*_unlocked/"
def _launch_apt_get(specific_args):
"""Launch apt-get with given args
......@@ -58,31 +59,34 @@ def _notify(title, body):
syslog.syslog(syslog.LOG_WARNING, "Warning: unable to notify the user. %s" % e)
syslog.syslog(syslog.LOG_WARNING, "The notification was: %s %s" % (title, body))
def has_additional_packages_list():
"""Return true iff PACKAGES_LIST_FILE exists
def get_additional_packages_lists():
"""Returns the paths of additional packageslists
"""
return os.path.isfile(PACKAGES_LIST_FILE)
syslog.syslog("Reading additional packages list")
packages_list = []
for persistent_dir in glob.glob(UNLOCKED_PERSISTENCE_DIRS_GLOB):
if os.path.isfile(persistent_dir + PACKAGES_LIST_FILE):
syslog.syslog("Found additional packages list in %s" % persistent_dir)
packages_list.append(persistent_dir + PACKAGES_LIST_FILE)
return packages_list
def get_additional_packages():
"""Returns the list of all the additional packages
"""
if not has_additional_packages_list():
return None
packages = []
with open(PACKAGES_LIST_FILE) as f:
for line in f:
line = line.strip()
if line: packages.append(line)
f.closed
for package_list in get_additional_packages_lists():
with open(package_list) as f:
for line in f:
line = line.strip()
if line: packages.append(line)
f.closed
return packages
def install_additional_packages():
"""The subcommand which activates and installs all additional packages
"""
syslog.syslog("Starting to install additional software...")
if has_additional_packages_list():
syslog.syslog("Found additional packages list")
else:
if not get_additional_packages_lists():
syslog.syslog(syslog.LOG_WARNING, "Warning: no additional software configured, exiting.")
return True
packages = get_additional_packages()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment