kopia lustrzana https://github.com/jupyterhub/repo2docker
fixing empty lines and comments in apt.txt
rodzic
fd740437e1
commit
82b0275a29
|
@ -418,13 +418,19 @@ class BaseImage(BuildPack):
|
||||||
assemble_scripts = []
|
assemble_scripts = []
|
||||||
try:
|
try:
|
||||||
with open(self.binder_path('apt.txt')) as f:
|
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
|
extra_apt_packages = []
|
||||||
# We're doing shell injection around here, gotta be careful.
|
for l in f:
|
||||||
# FIXME: Add support for specifying version numbers
|
package = l.partition('#')[0].strip()
|
||||||
for p in extra_apt_packages:
|
if not package:
|
||||||
if not re.match(r"^[a-z0-9.+-]+", p):
|
continue
|
||||||
raise ValueError("Found invalid package name {} in apt.txt".format(p))
|
# 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((
|
assemble_scripts.append((
|
||||||
'root',
|
'root',
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
gfortran
|
# testing to skip comments in this file
|
||||||
|
gfortran
|
Ładowanie…
Reference in New Issue