summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rwxr-xr-xpkg/linux/bitmask-root4
-rw-r--r--pkg/requirements-dev.pip10
-rw-r--r--pkg/requirements.pip7
-rwxr-xr-xpkg/tuf/release.py23
4 files changed, 37 insertions, 7 deletions
diff --git a/pkg/linux/bitmask-root b/pkg/linux/bitmask-root
index ba262a2c..ee195e3b 100755
--- a/pkg/linux/bitmask-root
+++ b/pkg/linux/bitmask-root
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 LEAP
@@ -51,7 +51,7 @@ cmdcheck = subprocess.check_output
# CONSTANTS
#
-VERSION = "2"
+VERSION = "3"
SCRIPT = "bitmask-root"
NAMESERVER = "10.42.0.1"
BITMASK_CHAIN = "bitmask"
diff --git a/pkg/requirements-dev.pip b/pkg/requirements-dev.pip
index 8b5a8d85..799376d2 100644
--- a/pkg/requirements-dev.pip
+++ b/pkg/requirements-dev.pip
@@ -10,8 +10,12 @@
# NOTE: you have to run pip install -r pkg/requirements.pip for pip
# to install it. (do it after python setup.py develop and it
# will only install this)
-
+#
+wheel
sphinx
+ipdb
--e git+https://github.com/leapcode/leap_pycommon.git@develop#egg=leap.common
--e git+https://github.com/leapcode/soledad.git@develop#egg=leap.soledad
+# in case you want to install a package from a git source, you can use this:
+# Useful to test pre-release branches together.
+#-e git+https://github.com/leapcode/leap_pycommon.git@develop#egg=leap.common
+#-e git+https://github.com/leapcode/soledad.git@develop#egg=leap.soledad
diff --git a/pkg/requirements.pip b/pkg/requirements.pip
index bf05aa28..9f49bf03 100644
--- a/pkg/requirements.pip
+++ b/pkg/requirements.pip
@@ -9,7 +9,10 @@ argparse
requests>=1.1.0
srp>=1.0.2
pyopenssl
-python-dateutil
+
+# This won't be needed after we refactor leap.common.events
+# to use zmq.
+python-dateutil==1.4 # See https://leap.se/code/issues/6099
psutil
@@ -19,6 +22,8 @@ python-daemon # this should not be needed for Windows.
keyring
zope.proxy
+# You will want to install this bundled if you don't have sodium in your system:
+# pip install pyzmq --install-option="--zmq=bundled"
pyzmq
leap.common>=0.3.7
diff --git a/pkg/tuf/release.py b/pkg/tuf/release.py
index c4abcd0d..0e1c989c 100755
--- a/pkg/tuf/release.py
+++ b/pkg/tuf/release.py
@@ -29,7 +29,6 @@ import sys
from tuf.repository_tool import load_repository
from tuf.repository_tool import import_rsa_privatekey_from_file
-from tuf.repository_tool import import_rsa_publickey_from_file
"""
Days until the expiration of targets.json and snapshot.json. After this ammount
@@ -102,6 +101,8 @@ class Targets(object):
recursive_walk=True,
followlinks=True)
+ self._remove_obsolete_targets(target_list)
+
for target in target_list:
octal_file_permissions = oct(os.stat(target).st_mode)[3:]
custom_file_permissions = {
@@ -109,6 +110,26 @@ class Targets(object):
}
self._repo.targets.add_target(target, custom_file_permissions)
+ def _remove_obsolete_targets(self, target_list):
+ """
+ Remove obsolete targets from TUF targets
+
+ :param target_list: list of targets on full path comming from TUF
+ get_filepaths_in_directory
+ :type target_list: list(str)
+ """
+ targets_path = os.path.join(self._repo_path, 'targets')
+ relative_path_list = map(lambda t: t.split("/targets")[1], target_list)
+ removed_targets = (set(self._repo.targets.target_files.keys())
+ - set(relative_path_list))
+
+ for target in removed_targets:
+ target_rel_path = target
+ if target[0] == '/':
+ target_rel_path = target[1:]
+ target_path = os.path.join(targets_path, target_rel_path)
+ self._repo.targets.remove_target(target_path)
+
if __name__ == "__main__":
main()