diff --git a/installsystems/image.py b/installsystems/image.py index 0b34136fee863dc0f9f0515f039634d308f69ad0..c0c4f791661b20395db6325606b3eb23295d78af 100644 --- a/installsystems/image.py +++ b/installsystems/image.py @@ -331,6 +331,10 @@ class SourceImage(Image): if not re.match("\d+-.*\.py$", fi): debug("%s skipped: invalid name" % fi) continue + # check execution bit + if not os.access(fp, os.X_OK): + debug("%s skipped: not executable" % fi) + continue # adding file ti = tarball.gettarinfo(fp, arcname=os.path.join(basedirectory, fi)) ti.mode = 0755 @@ -349,12 +353,17 @@ class SourceImage(Image): arrowlevel(1) # checking each file for fi in sorted(os.listdir(directory)): + fp = os.path.join(directory, fi) # check name if not re.match("\d+-.*\.py$", fi): debug("%s skipped: invalid name" % fi) continue + # check execution bit + if not os.access(fp, os.X_OK): + debug("%s skipped: not executable" % fi) + continue # compiling file - fs = open(os.path.join(directory, fi), "rb").read() + fs = open(fp, "rb").read() compile(fs, fi, mode="exec") arrow(fi) arrowlevel(-1)