Comments (3)
/usr/lib/python3/dist-packages/apt/cache.py
, around 299
def __getitem__(self, key):
# type: (object) -> Package
""" look like a dictionary (get key) """
try:
key = str(key)
rawpkg = self._cache[key]
except KeyError:
raise KeyError('The cache has no package named %r' % key)
# It might be excluded due to not having a version or something
if not self.__is_real_pkg(rawpkg):
raise KeyError('The cache has no package named %r' % key)
pkg = self._rawpkg_to_pkg(rawpkg)
return pkg
/usr/local/sbin/tails-additional-software
, line 415-466
def apt_hook_pre():
"""Subcommand to handle Dpkg::Pre-Install-Pkgs."""
_exit_if_in_live_build()
logging.info("Saving package changes")
apt_cache = apt.cache.Cache()
installed_packages = []
removed_packages = []
line = sys.stdin.readline()
if not line.startswith("VERSION 3"):
raise ASPDataError("APT data is not version 3")
line = sys.stdin.readline()
# Ignore configuration space, which ends with an empty line
while line != "\n":
line = sys.stdin.readline()
# Package action lines
for line in sys.stdin:
# Package action lines consist of five fields in Version 2: package
# name (without architecture qualification even if foreign), old
# version, direction of version change (< for upgrades, > for
# downgrades, = for no change), new version, action. The version
# fields are "-" for no version at all (for example when installing
# a package for the first time; no version is treated as earlier
# than any real version, so that is an upgrade, indicated as - <
# 1.23.4). The action field is "**CONFIGURE**" if the package is
# being configured, "**REMOVE**" if it is being removed, or the
# filename of a .deb file if it is being unpacked.
#
# In Version 3 after each version field follows the architecture of
# this version, which is "-" if there is no version, and a field
# showing the MultiArch type "same", "foreign", "allowed" or "none".
# Note that "none" is an incorrect typename which is just kept to
# remain compatible, it should be read as "no" and users are
# encouraged to support both.
#
# Example:
#
# colordif - - none < 1.0.16-1 all none **CONFIGURE**
package_name, old_version, old_arch, old_multiarch, direction, \
new_version, new_arch, new_multiarch, action = line.split()
if action.endswith(".deb"):
# Filter packages that will only be upgraded
if not apt_cache[package_name].is_installed:
installed_packages.append(package_name)
elif action.endswith("**REMOVE**"):
removed_packages.append(package_name)
result = {"installed": installed_packages, "removed": removed_packages}
with open(ASP_STATE_PACKAGES, 'w') as f:
json.dump(result, f)
from adhocsecurebox.
/usr/local/sbin/tails-additional-software
, hotfix
sudo gedit /usr/local/sbin/tails-additional-software
original
if action.endswith(".deb"):
# Filter packages that will only be upgraded
if not apt_cache[package_name].is_installed:
installed_packages.append(package_name)
hofixed
We check if apt_cache[package_name]
is valid before trying to check if is_installed
if action.endswith(".deb"):
# Filter packages that will only be upgraded
if (package_name not in apt_cache) or apt_cache[package_name].is_installed:
installed_packages.append(package_name)
from adhocsecurebox.
Even with previous hotfix, while it allow to install .deb files one time, if the user marked the software to automaticaly re-install, I think we hit another bug.
Tails seems to try to install vscode with sudo apt install code
but since this was an deb file, thats not the right command.
While I agree that the hotfix would not solve 100% of the problem, it at least allow install .deb files once. Good. Not perfect, but at least good.
from adhocsecurebox.
Related Issues (20)
- TailsOS with Gnome Online Accounts integration [Integration with Google (Files, Documents, Mail), ownCloud, Microsoft, Facebook, etc)] (quick discussion) HOT 3
- Helper tool for quick export and import cosmetic changes on TailsOS ('dconf dump' / 'dconf load') HOT 2
- MVP of Tails terminal initialization helper "tails-do-it"
- MVP of any strategy to send files from Android phone to Tails HOT 2
- Tails (aka LUKS encrypted disk) message "Error when getting information for the file path/to/file: Structure needs cleaning HOT 1
- VSCode (Electron/Chromium apps) networking through Tor and/or Tails HOT 1
- Design some optionated directory structure for data operations
- Alternative minimal instructions to run this repository without Tails Persistence enabled
- MVP of Thunderbird backup
- MVP of Tails-like concepts on everyday Linux distributions
- YubiKey on Tails
- MVP of zuluCrypt and zuluMount on Tails
- MVP of AppArmor profiles for zuluCrypt & zuluMount on Ubuntu
- MVP of AppArmor profiles for Cryptomator on Ubuntu HOT 1
- MVP of AppArmor profile that only deny access to internet
- MVP of AppArmor profile that only deny access specific folder HOT 1
- Project naming and description
- MVP of Virtual Machines HOT 2
- MVP of encrypted backups resilient to bit rot (Data degradation / Data corruption)
- MVP of Tails as 'Securebox' for backup life cycle of external servers; focus on aid human triggered backups and no especial requirements on remote servers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adhocsecurebox.