Merge pull request #151 from GladysNalvarte/master

fixing empty lines and comments in apt.txt
pull/143/head
Min RK 2017-12-01 12:24:42 +01:00 zatwierdzone przez GitHub
commit d21d9a7b7c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 15 dodań i 7 usunięć

Wyświetl plik

@ -426,13 +426,19 @@ class BaseImage(BuildPack):
assemble_scripts = []
try:
with open(self.binder_path('apt.txt')) as f:
extra_apt_packages = [l.strip() for l in f]
# Validate that this is, indeed, just a list of packages
# We're doing shell injection around here, gotta be careful.
# FIXME: Add support for specifying version numbers
for p in extra_apt_packages:
if not re.match(r"^[a-z0-9.+-]+", p):
raise ValueError("Found invalid package name {} in apt.txt".format(p))
extra_apt_packages = []
for l in f:
package = l.partition('#')[0].strip()
if not package:
continue
# Validate that this is, indeed, just a list of packages
# We're doing shell injection around here, gotta be careful.
# FIXME: Add support for specifying version numbers
if not re.match(r"^[a-z0-9.+-]+", package):
raise ValueError("Found invalid package name {} in apt.txt".format(package))
extra_apt_packages.append(package)
assemble_scripts.append((
'root',

Wyświetl plik

@ -1 +1,3 @@
# testing to skip comments in this file
gfortran