Project

General

Profile

Feature #11754

Feature #11198: Port complex shell scripts into Python

Port complex build shell scripts to Python

Added by intrigeri about 1 year ago. Updated 20 days ago.

Status:
Confirmed
Priority:
Normal
Assignee:
Category:
Build system
Target version:
Start date:
08/31/2016
Due date:
% Done:

0%

QA Check:
Feature Branch:
Type of work:
Code

Description

(Splitting #11198 into smaller pieces.)

History

#1 Updated by intrigeri about 1 year ago

  • Blueprint set to https://tails.boum.org/blueprint/Port_shell_scripts_to_Python/

#2 Updated by sycamoreone about 1 year ago

  • Assignee changed from sycamoreone to intrigeri

The build shell scripts are the one in config/binary_local-hooks/ and config/chroot_local-hooks/?

#3 Updated by intrigeri about 1 year ago

  • Assignee changed from intrigeri to sycamoreone

The build shell scripts are the one in config/binary_local-hooks/ and config/chroot_local-hooks/?

Yes :)

#4 Updated by sycamoreone about 1 year ago

More questions:

What about the scripts in tails/auto? At least auto/build and auto/config are quite complex shell scripts.

Some of the scripts source functions or configuration variables from other shell scripts. All the scripts in config/binary_local-hooks source

"${LB_BASE:-/usr/share/live/build}"/scripts/build.sh

and scripts in chroot_local-hooks source

/usr/share/amnesia/build/variables (created by ./auto/build)

or

/usr/local/lib/tails-shell-library/*

We certainly don't want to maintain a bash and a Python version of config files and the library. Either we keep all scripts that use these in bash or we convert the library and all the scripts that use it to Python. But the tails-shell-library is also used in many other places, so it might not be possible to move them to Python.

Some scripts that are sourced by other scripts are

10-tbb:. /usr/local/lib/tails-shell-library/tor-browser.sh
11-localize_browser:. /usr/local/lib/tails-shell-library/tor-browser.sh
11-localize_browser:. /usr/local/lib/tails-shell-library/common.sh
11-localize_browser:. /usr/local/lib/tails-shell-library/localization.sh
11-localize_browser:. /etc/amnesia/environment
13-override-tbb-branding:. /usr/local/lib/tails-shell-library/tor-browser.sh
20-xul-ext_symlinks:. /usr/local/lib/tails-shell-library/tor-browser.sh
98-remove_unwanted_files:. /usr/share/amnesia/build/variables

#5 Updated by intrigeri about 1 year ago

What about the scripts in tails/auto? At least auto/build and auto/config are quite complex shell scripts.

I'd love to see them ported to Python. Beware though: I suspect that live-build (itself written in shell) sources these scripts, so it might be that we need at least a thin shell wrapper if we're going to port most of that code to Python.

We certainly don't want to maintain a bash and a Python version of config files and the library. Either we keep all scripts that use these in bash or we convert the library and all the scripts that use it to Python.

Agreed.

The same config files could be usable both in Python and shell though, if they only contain static data encoded in some standard format.

But the tails-shell-library is also used in many other places, so it might not be possible to move them to Python.

Some scripts that are sourced by other scripts are

> 10-tbb:. /usr/local/lib/tails-shell-library/tor-browser.sh
> 11-localize_browser:. /usr/local/lib/tails-shell-library/tor-browser.sh
> 11-localize_browser:. /usr/local/lib/tails-shell-library/common.sh
> 11-localize_browser:. /usr/local/lib/tails-shell-library/localization.sh
> 11-localize_browser:. /etc/amnesia/environment
> 13-override-tbb-branding:. /usr/local/lib/tails-shell-library/tor-browser.sh
> 20-xul-ext_symlinks:. /usr/local/lib/tails-shell-library/tor-browser.sh
> 98-remove_unwanted_files:. /usr/share/amnesia/build/variables
> 

I think that those should be ported to Python eventually: chroot local hooks prompted this effort, see for example our initial porting example (feature/11198-python-scripting) :)

#6 Updated by intrigeri 20 days ago

  • Assignee changed from sycamoreone to kurono

(as per updated roadmap, see parent ticket for details)

#7 Updated by intrigeri 20 days ago

  • Target version set to 2019

Also available in: Atom PDF