tails-documentation should prefer online docs
I.e. what sajolida requested in #14962#note-15: "How crazy would it be to open the doc online if Tor is ready and in the help browser if Tor is not ready?"
tails-documentation: prefer online resources.
I.e. if Tor is working, open the requested page of our website in Tor
Browser, to show the most up-to-date information.
Merge remote-tracking branch 'origin/feature/15332-prefer-online-docs' into devel
tails-documentation: use documented syntax for os.execv (refs: #15332).
Passing the command to be run is not enforced according to the doc,
but still: let's use the documented form.
#4 Updated by bertagaz over 1 year ago
- Status changed from In Progress to Fix committed
- Assignee deleted (
- % Done changed from 50 to 100
- QA Check changed from Ready for QA to Pass
Jenkins' results does not look good, but the old tests on
devellooks equally poor (see runs 1203-1205) so I don't think the merge should be blocked.
Yeah, works manually and when I run the test locally. This change is not so crazy, so I've merged it into devel for 3.6, congrats.
#5 Updated by intrigeri over 1 year ago
- Status changed from Fix committed to In Progress
- Assignee set to anonym
- % Done changed from 100 to 90
- QA Check changed from Pass to Info Needed
I'm surprised this works:
os.execv('/usr/local/bin/tor-browser', ['--new-tab', 'https://tails.boum.org/' + page])
… as the first element of the list passed as the 2nd argument should be the command to be run. The doc says this is not enforced but I wonder if we're just lucky that it works, given on my sid system:
$ python3 -c "import os ; os.execv('/bin/touch', ['/tmp/without'])" ; ls /tmp/without /tmp/without: missing file operand Try '/tmp/without --help' for more information. zsh: exit 1 python3 -c "import os ; os.execv('/bin/touch', ['/tmp/without'])" ls: cannot access '/tmp/without': No such file or directory $ python3 -c "import os ; os.execv('/bin/touch', ['/bin/touch', '/tmp/with'])" && ls /tmp/with /tmp/with
So I think it would be safer to apply this patch:
--- a/config/chroot_local-includes/usr/local/bin/tails-documentation +++ b/config/chroot_local-includes/usr/local/bin/tails-documentation @@ -91,7 +91,8 @@ except IndexError: # up-to-date option. if os.system('/usr/local/sbin/tor-has-bootstrapped') == 0: os.execv('/usr/local/bin/tor-browser', - ['--new-tab', 'https://tails.boum.org/' + page]) + ['/usr/local/bin/tor-browser', '--new-tab', + 'https://tails.boum.org/' + page]) wiki_path = '/usr/share/doc/tails/website' lang_code = os.getenv('LANG', 'en')[0:2]
What do you think?