Forked from briandk/install-texlive-without-docs.py
Created
October 10, 2018 09:06
-
-
Save sys9kdr/17fcc5de1e305304fb4ffac53be3704b to your computer and use it in GitHub Desktop.
Instal a full latex texlive on Ubuntu Xenial without any of the docs
This file contains hidden or 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
import subprocess | |
get_line_by_line_texlive_dependencies = subprocess.run( | |
[ | |
"apt-cache", | |
"depends", | |
"texlive-full" | |
], | |
universal_newlines=True, | |
stdout=subprocess.PIPE | |
) | |
dependency_pattern = "Depends: " | |
def extract_dependency(dependency_text, pattern): | |
dependency = dependency_text.strip().replace(pattern, "") | |
return(dependency) | |
dependencies = [ | |
extract_dependency(line, dependency_pattern) | |
for line in get_line_by_line_texlive_dependencies.stdout.splitlines() | |
if line.strip().startswith(dependency_pattern) and not line.strip().endswith("-doc")] | |
arguments = [ | |
"apt-get", | |
"install", | |
"--assume-yes", | |
"--no-install-recommends" | |
] | |
arguments.extend(dependencies) | |
# execute apt-get install with all the package names | |
subprocess.run(arguments) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment