On Fri, Nov 06, 2020 at 11:53:03AM +0800, Luan Shengde wrote:
On Fri, Nov 06, 2020 at 11:06:09AM +0800, Lin Jiaxin wrote:
[Why] Support more version's PKGBUILD.
[How] Replace the previous content with two source command.
example:
PKGBUILD_TAG=-1.1 BUILDFILE -> PKGBUILD BUILDFILE$PKGBUILD_TAG -> PKGBUILD-1.1
PKGBUILD-1.1 contains only the changed part. % cat PKGBUILD-1.1 pkgver=1.1 pkgrel=2
build() { make install DESTDIR="${pkgdir}/lkp/benchmarks/${pkgname}" }
Signed-off-by: Lin Jiaxin ljx.joe@qq.com
sbin/makepkg | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/sbin/makepkg b/sbin/makepkg index 25773621..dc8471b9 100755 --- a/sbin/makepkg +++ b/sbin/makepkg @@ -888,7 +888,7 @@ update_pkgver() { exit 1 fi sed --follow-symlinks -i "s:^pkgrel=[^ ]*:pkgrel=1:" "$BUILDFILE"
source_safe "$BUILDFILE"
elsesource_safe "$BUILDFILE" "$BUILDFILE$PKGBUILD_TAG" local fullver=$(get_full_version) msg "$(gettext "Updated version: %s")" "$pkgbase $fullver"
@@ -1604,10 +1604,14 @@ cd_safe() {
source_safe() { shopt -u extglob
- if ! source "$@"; then
error "$(gettext "Failed to source %s")" "$1"
exit 1
- fi
- local file
- for file in "$@"
the file here, itself is a local variable,
Thanks, Luan Shengde
If i do not use local, the file variable's value will be obtained by other functions after the function ends.
Thanks, Jiaxin