From 7fe2bc18c3c6f503a9bf59ae546e24f5980df77c Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 7 Aug 2017 22:53:54 +0000 Subject: [PATCH] Close #334: Check if pkgname is the aport folder name (#347) ...and remove an redundant sentence with broken grammar in another error message. --- pmb/parse/apkbuild.py | 11 +++++++++++ pmb/parse/arguments.py | 3 +-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pmb/parse/apkbuild.py b/pmb/parse/apkbuild.py index 32f2776a..dd99276c 100644 --- a/pmb/parse/apkbuild.py +++ b/pmb/parse/apkbuild.py @@ -16,6 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with pmbootstrap. If not, see . """ +import os +import logging import pmb.config @@ -134,6 +136,15 @@ def apkbuild(args, path): else: ret[attribute] = "" + # Sanity check: pkgname + suffix = "/" + ret["pkgname"] + "/APKBUILD" + if not os.path.realpath(path).endswith(suffix): + logging.info("Folder: '" + os.path.dirname(path) + "'") + logging.info("Pkgname: '" + ret["pkgname"] + "'") + raise RuntimeError("The pkgname must be equal to the name of" + " the folder, that contains the APKBUILD!") + + # Fill cache ret = replace_variables(ret) ret = cut_off_function_names(ret) args.cache["apkbuild"][path] = ret diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py index 6cc52f59..d62a0ba2 100644 --- a/pmb/parse/arguments.py +++ b/pmb/parse/arguments.py @@ -259,7 +259,6 @@ def arguments(): " forward. Simply enable it in pmb/config/__init__.py" " in build_device_architectures, zap your package cache" " (otherwise you will have issues with noarch packages)" - " and try again. Some other things might break, but" - " they should be easy to fix them.") + " and try again.") return args