pmb.build.is_necessary(): Add optional apkindex_path parameter
This is necessary for pmbuilder (the componenet, that creates packages in the upcoming binary package repository)
This commit is contained in:
parent
83eaa93c49
commit
906bda0e18
|
@ -65,13 +65,14 @@ def copy_to_buildpath(args, package, suffix="native"):
|
|||
"/home/user/build"], suffix=suffix)
|
||||
|
||||
|
||||
def is_necessary(args, arch, apkbuild):
|
||||
def is_necessary(args, arch, apkbuild, apkindex_path=None):
|
||||
"""
|
||||
Check if the package has already been built (because abuild's check
|
||||
only works, if it is the same architecture!)
|
||||
|
||||
:param arch: package target architecture
|
||||
:param apkbuild: from pmb.parse.apkbuild()
|
||||
:param apkindex_path: override the APKINDEX.tar.gz path
|
||||
:returns: boolean
|
||||
"""
|
||||
|
||||
|
@ -80,9 +81,12 @@ def is_necessary(args, arch, apkbuild):
|
|||
version_new = apkbuild["pkgver"] + "-r" + apkbuild["pkgrel"]
|
||||
|
||||
# Get old version from APKINDEX
|
||||
if not apkindex_path:
|
||||
apkindex_path = (args.work + "/packages/" + arch +
|
||||
"/APKINDEX.tar.gz")
|
||||
version_old = None
|
||||
index_data = pmb.parse.apkindex.read(args, package,
|
||||
args.work + "/packages/" + arch + "/APKINDEX.tar.gz", False)
|
||||
index_data = pmb.parse.apkindex.read(args, package, apkindex_path,
|
||||
False)
|
||||
if index_data:
|
||||
version_old = index_data["version"]
|
||||
|
||||
|
|
Loading…
Reference in New Issue