On Thu, Nov 05, 2020 at 03:39:55PM +0800, Cao Xueliang wrote:
On Thu, Nov 05, 2020 at 03:16:05PM +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
% cat PKGBUILD-1.1 pkgver=1.1 pkgrel=2
build() { make install DESTDIR="${pkgdir}/lkp/benchmarks/${pkgname}" }
PKGBUILD-1.1 contains only the changed part.
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 "$@"
- do
if ! source "$file"; then
What's the difference between source/. and source_safe?
Thanks, Xueliang
source_safe will shopt -u extglob before source
% source PKGBUILD.1 PKGBUILD.1:3: bad set of key/value pairs for associative array
% sh test !strip
% cat PKGBUILD.1 -n 1 license=('apache') 2 depends=('java-environment>=7' 'openssh' 'apache-ant' 'polkit') 3 options=('!strip')
% cat test shopt -u extglob source ./PKGBUILD.1 echo "$options" shopt -s extglob
Thanks, Jiaxin