Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
converted chroot-script 40_add_torprojects_key to postinst script
- Loading branch information
Patrick Schleizer
committed
Jan 5, 2016
1 parent
5f49829
commit 495fc4c
Showing
2 changed files
with
77 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/bash | ||
|
||
## This file is part of Whonix. | ||
## Copyright (C) 2012 - 2014 Patrick Schleizer <adrelanos@riseup.net> | ||
## See the file COPYING for copying conditions. | ||
|
||
if [ -f /usr/lib/pre.bsh ]; then | ||
source /usr/lib/pre.bsh | ||
fi | ||
|
||
set -e | ||
|
||
tpo_keys_Add() { | ||
## The torproject archive key has been manually downloaded using the key fingerprint from | ||
## https://www.torproject.org/docs/debian.html.en and https://www.torproject.org/docs/signing-keys.html.en | ||
## using gpg: | ||
## gpg --keyserver keys.gnupg.net --recv <long-key-id> | ||
## Verified using: | ||
## gpg --list-sigs <long-key-id> | ||
## gpg --check-sigs <long-key-id> | ||
## And added to Whonix source code using: | ||
## gpg --armor --export <long-key-id> > /home/user/anon-shared-build-apt-sources-tpo/usr/share/anon-shared-build-apt-sources-tpo/tpoarchive-keys.d/torprojectarchive.asc | ||
|
||
for key in "/usr/share/anon-shared-build-apt-sources-tpo/tpoarchive-keys.d/"*; do | ||
filename="$(basename "$key")" | ||
if [ "$filename" = "placeholder" ]; then | ||
continue | ||
fi | ||
if [ "$filename" = "*" ]; then | ||
## Folder is empty. | ||
continue | ||
fi | ||
apt-key add "$key" | ||
done | ||
} | ||
|
||
true " | ||
##################################################################### | ||
## INFO: BEGIN: $DPKG_MAINTSCRIPT_PACKAGE $DPKG_MAINTSCRIPT_NAME ${1+"$@"} | ||
##################################################################### | ||
" | ||
|
||
case "$1" in | ||
configure) | ||
true "INFO: Configuring $DPKG_MAINTSCRIPT_PACKAGE..." | ||
|
||
## Doing this only once, | ||
## because when the user updates, the deb.torproject.org-keyring deb package is already | ||
## installed, which does a better job updating Tor Project's signing key. | ||
if [ ! -f "/var/lib/anon-dist/do_once/tpo_keys_add" ]; then | ||
tpo_keys_Add | ||
mkdir --parents "/var/lib/anon-dist/do_once" | ||
touch "/var/lib/anon-dist/do_once/tpo_keys_add" | ||
fi | ||
|
||
true "INFO: End configuring $DPKG_MAINTSCRIPT_PACKAGE." | ||
|
||
;; | ||
|
||
*) | ||
;; | ||
esac | ||
|
||
true "INFO: debhelper beginning here." | ||
|
||
#DEBHELPER# | ||
|
||
true "INFO: Done with debhelper." | ||
|
||
true " | ||
##################################################################### | ||
## INFO: END : $DPKG_MAINTSCRIPT_PACKAGE $DPKG_MAINTSCRIPT_NAME ${1+"$@"} | ||
##################################################################### | ||
" | ||
|
||
## Explicitly "exit 0", so eventually trapped errors can be ignored. | ||
exit 0 |
70 changes: 0 additions & 70 deletions
70
usr/lib/anon-dist/chroot-scripts-post.d/40_add_torprojects_key
This file was deleted.
Oops, something went wrong.