Close #334: Check if pkgname is the aport folder name (#347)

...and remove an redundant sentence with broken grammar in another
error message.
This commit is contained in:
Oliver Smith 2017-08-07 22:53:54 +00:00 committed by GitHub
parent ceda097655
commit 7fe2bc18c3
2 changed files with 12 additions and 2 deletions

View File

@ -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 <http://www.gnu.org/licenses/>.
"""
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

View File

@ -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