[pacman-dev] [GIT] The official pacman repository branch, master, updated. v5.1.1-129-g11bc315c

2019-01-30 Thread Allan McRae
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official pacman repository".

The branch, master has been updated
   via  11bc315cdb3c2a3f227b4d05c13f615dfb453b5e (commit)
   via  14755df06f4727f261a8174502754acd7243ab75 (commit)
  from  75aae126c423dcc9b215aef57daff9e7bd8f5f6b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 11bc315cdb3c2a3f227b4d05c13f615dfb453b5e
Author: morganamilo 
Date:   Thu Jan 31 02:07:09 2019 +

libmakepkg: lint disallowed architecture specific variables

Variables such as 'pkgdesc_x86_64' are invalid, instead of ignoring them
raise an error.

This also disallows using 'any' as an architecture specific variable

Signed-off-by: morganamilo 
Signed-off-by: Allan McRae 

commit 14755df06f4727f261a8174502754acd7243ab75
Author: morganamilo 
Date:   Thu Jan 31 02:04:56 2019 +

libmakepkg: lint disallowed variables in package()

makepkg will now error if disallowed variables are set inside of
the package function.

Disallowed variables are variables that do exist, like 'makedepends'
and 'pkgver' but can not be set inside of a package function.

Signed-off-by: morganamilo 
Signed-off-by: Allan McRae 

---

Summary of changes:
 scripts/Makefile.am|  2 +
 .../libmakepkg/lint_pkgbuild/arch_specific.sh.in   | 82 ++
 scripts/libmakepkg/lint_pkgbuild/meson.build   |  2 +
 .../lint_pkgbuild/package_function_variable.sh.in  | 62 
 scripts/libmakepkg/util/pkgbuild.sh.in |  9 +++
 5 files changed, 157 insertions(+)
 create mode 100644 scripts/libmakepkg/lint_pkgbuild/arch_specific.sh.in
 create mode 100644 
scripts/libmakepkg/lint_pkgbuild/package_function_variable.sh.in


hooks/post-receive
-- 
The official pacman repository


[pacman-dev] [PATCH v6 1/2] libmakepkg: lint disallowed variables in package()

2019-01-30 Thread morganamilo
makepkg will now error if disallowed variables are set inside of
the package function.

Disallowed variables are variables that do exist, like 'makedepends'
and 'pkgver' but can not be set inside of a package function.

Signed-off-by: morganamilo 
---

v5:
Move this lint to its own file.

v6:
"libmakepkg: add exists_function_variable helper" was squashed
into this commit.

Fixups and rebase against master

 scripts/Makefile.am   |  1 +
 scripts/libmakepkg/lint_pkgbuild/meson.build  |  1 +
 .../package_function_variable.sh.in   | 62 +++
 scripts/libmakepkg/util/pkgbuild.sh.in|  9 +++
 4 files changed, 73 insertions(+)
 create mode 100644 
scripts/libmakepkg/lint_pkgbuild/package_function_variable.sh.in

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 0e5619bd..f84fda1d 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -92,6 +92,7 @@ LIBMAKEPKG_IN = \
libmakepkg/lint_pkgbuild/optdepends.sh \
libmakepkg/lint_pkgbuild/options.sh \
libmakepkg/lint_pkgbuild/package_function.sh \
+   libmakepkg/lint_pkgbuild/package_function_variable.sh \
libmakepkg/lint_pkgbuild/pkgbase.sh \
libmakepkg/lint_pkgbuild/pkglist.sh \
libmakepkg/lint_pkgbuild/pkgname.sh \
diff --git a/scripts/libmakepkg/lint_pkgbuild/meson.build 
b/scripts/libmakepkg/lint_pkgbuild/meson.build
index 4ca414e4..f699a8e2 100644
--- a/scripts/libmakepkg/lint_pkgbuild/meson.build
+++ b/scripts/libmakepkg/lint_pkgbuild/meson.build
@@ -14,6 +14,7 @@ sources = [
   'optdepends.sh.in',
   'options.sh.in',
   'package_function.sh.in',
+  'package_function_variable.sh.in',
   'pkgbase.sh.in',
   'pkglist.sh.in',
   'pkgname.sh.in',
diff --git a/scripts/libmakepkg/lint_pkgbuild/package_function_variable.sh.in 
b/scripts/libmakepkg/lint_pkgbuild/package_function_variable.sh.in
new file mode 100644
index ..172e0a08
--- /dev/null
+++ b/scripts/libmakepkg/lint_pkgbuild/package_function_variable.sh.in
@@ -0,0 +1,62 @@
+#!/bin/bash
+#
+#   package_function_variable.sh - Check variables inside the package function.
+#
+#   Copyright (c) 2014-2018 Pacman Development Team 
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program.  If not, see .
+#
+
+[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_VARIABLE_SH" ]] && return
+LIBMAKEPKG_LINT_PKGBUILD_PACKAGE_FUNCTION_VARIABLE_SH=1
+
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
+source "$LIBRARY/util/message.sh"
+source "$LIBRARY/util/pkgbuild.sh"
+source "$LIBRARY/util/schema.sh"
+source "$LIBRARY/util/util.sh"
+
+
+lint_pkgbuild_functions+=('lint_package_function_variable')
+
+
+lint_package_function_variable() {
+   local i a pkg ret=0
+
+   # package function variables
+   for pkg in ${pkgname[@]}; do
+   for a in ${arch[@]}; do
+   [[ $a == "any" ]] && continue
+
+   for i in ${pkgbuild_schema_arrays[@]} 
${pkgbuild_schema_strings[@]}; do
+   in_array "$i" 
${pkgbuild_schema_package_overrides[@]} && continue
+   if exists_function_variable "package_$pkg" 
"${i}_${a}"; then
+   error "$(gettext "%s can not be set 
inside a package function")" "${i}_${a}"
+   ret=1
+   fi
+   done
+   done
+
+   for i in ${pkgbuild_schema_arrays[@]} 
${pkgbuild_schema_strings[@]}; do
+   in_array "$i" ${pkgbuild_schema_package_overrides[@]} 
&& continue
+   if exists_function_variable "package_$pkg" "$i"; then
+   error "$(gettext "%s can not be set inside a 
package function")" "$i"
+   ret=1
+   fi
+   done
+   done
+
+   return $ret
+}
diff --git a/scripts/libmakepkg/util/pkgbuild.sh.in 
b/scripts/libmakepkg/util/pkgbuild.sh.in
index 0dc239d1..298275a8 100644
--- a/scripts/libmakepkg/util/pkgbuild.sh.in
+++ b/scripts/libmakepkg/util/pkgbuild.sh.in
@@ -100,6 +100,15 @@ extract_function_variable() {
return $r
 }
 
+exists_function_variable() {
+   # $1: function name
+   # $2: variable name
+
+   local funcname=$1 attr=$2 out
+   extract_function_variable "$funcname" 

[pacman-dev] [PATCH v6 2/2] libmakepkg: lint disallowed architecture specific variables

2019-01-30 Thread morganamilo
Variables such as 'pkgdesc_x86_64' are invalid, instead of ignoring them
raise an error.

This also disallows using 'any' as an architecture specific variable

Signed-off-by: morganamilo 
---

v5:
"libmakepkg: disallow using any as an architecture specific variable"
was squashed into this commit.

Move this lint to its own file.

v6:
Fixups and rebase against master

 scripts/Makefile.am   |  1 +
 .../lint_pkgbuild/arch_specific.sh.in | 82 +++
 scripts/libmakepkg/lint_pkgbuild/meson.build  |  1 +
 3 files changed, 84 insertions(+)
 create mode 100644 scripts/libmakepkg/lint_pkgbuild/arch_specific.sh.in

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index f84fda1d..7fffd93b 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -80,6 +80,7 @@ LIBMAKEPKG_IN = \
libmakepkg/lint_package/missing_backup.sh \
libmakepkg/lint_pkgbuild.sh \
libmakepkg/lint_pkgbuild/arch.sh \
+   libmakepkg/lint_pkgbuild/arch_specific.sh \
libmakepkg/lint_pkgbuild/backup.sh \
libmakepkg/lint_pkgbuild/changelog.sh \
libmakepkg/lint_pkgbuild/checkdepends.sh \
diff --git a/scripts/libmakepkg/lint_pkgbuild/arch_specific.sh.in 
b/scripts/libmakepkg/lint_pkgbuild/arch_specific.sh.in
new file mode 100644
index ..25627dd9
--- /dev/null
+++ b/scripts/libmakepkg/lint_pkgbuild/arch_specific.sh.in
@@ -0,0 +1,82 @@
+#!/bin/bash
+#
+#   arch_specific.sh - Check that arch specific variables can be arch specific.
+#
+#   Copyright (c) 2014-2018 Pacman Development Team 
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program.  If not, see .
+#
+
+[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_ARCH_SPECIFIC_SH" ]] && return
+LIBMAKEPKG_LINT_PKGBUILD_ARCH_SPECIFIC_SH=1
+
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
+source "$LIBRARY/util/message.sh"
+source "$LIBRARY/util/pkgbuild.sh"
+source "$LIBRARY/util/schema.sh"
+source "$LIBRARY/util/util.sh"
+
+
+lint_pkgbuild_functions+=('lint_arch_specific')
+
+
+lint_arch_specific() {
+   local i a pkg ret=0
+
+   # global variables
+   for a in ${arch[@]}; do
+   if [[ $a == "any" ]]; then
+   for i in ${pkgbuild_schema_arch_arrays[@]}; do
+   if declare -p "${i}_${a}" > /dev/null 2>&1; then
+   error "$(gettext "Can not provide 
architecture specific variables for the '%s' architecture: %s")" "any" 
"${i}_${a}"
+   ret=1
+   fi
+   done
+   fi
+
+   for i in ${pkgbuild_schema_arrays[@]} 
${pkgbuild_schema_strings[@]}; do
+   in_array "$i" ${pkgbuild_schema_arch_arrays[@]} && 
continue
+   v="${i}_${a}"
+   if declare -p "$v" > /dev/null 2>&1; then
+   error "$(gettext "%s can not be architecture 
specific: %s")" "$i" "${i}_${a}"
+   ret=1
+   fi
+   done
+   done
+
+   # package function variables
+   for pkg in ${pkgname[@]}; do
+   for a in ${arch[@]}; do
+   if [[ $a == "any" ]]; then
+   for i in ${pkgbuild_schema_arch_arrays[@]}; do
+   if exists_function_variable 
"package_$pkg" "${i}_${a}"; then
+   error "$(gettext "Can not 
provide architecture specific variables for the '%s' architecture: %s")" "any" 
"${i}_${a}"
+   ret=1
+   fi
+   done
+   fi
+
+   for i in ${pkgbuild_schema_arrays[@]} 
${pkgbuild_schema_strings[@]}; do
+   in_array "$i" ${pkgbuild_schema_arch_arrays[@]} 
&& continue
+   if exists_function_variable "package_$pkg" 
"${i}_${a}"; then
+   error "$(gettext "%s can not be 
architecture specific: %s")" "$i" "${i}_${a}"
+   ret=1
+   fi
+   done
+   done
+   done
+
+   return $ret
+}
diff --git 

[pacman-dev] [GIT] The official pacman repository branch, master, updated. v5.1.1-127-g75aae126

2019-01-30 Thread Allan McRae
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official pacman repository".

The branch, master has been updated
   via  75aae126c423dcc9b215aef57daff9e7bd8f5f6b (commit)
   via  6cf0548128d6d1a839ba93997b017661520395be (commit)
  from  776fbe1cde58739d0469d3efbc76cb13b80f18b3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 75aae126c423dcc9b215aef57daff9e7bd8f5f6b
Author: morganamilo 
Date:   Wed Jan 30 18:07:20 2019 +

libmakepkg: centralise random arrays of pkgbuild variables

Refactor many of the different arrays of pkgbuild variables
into scripts/libmakepkg/util/schema.sh.in.

Signed-off-by: morganamilo 
Signed-off-by: Allan McRae 

commit 6cf0548128d6d1a839ba93997b017661520395be
Author: Allan McRae 
Date:   Wed Jan 30 10:40:09 2019 +1000

makepkg: use --unneeded for pacman call in remove_deps()

This patch was inspired by FS#32723 which asks makepkg to install 
makedepends
before depends.  The use case is to build a package depending on a virtual
package that is only provided by other packages (e.g. java-runtime in Arch
Linux), but wanting to build against a specific version.  Installing 
makedepends
first (but not at the same time as depends) would allow specifying the 
version
to build against, instead of pacman resolving to the default version when
installing depends.

It turns out, we can already achieve installing makedepends first by 
specifying
dependencies only in the package function (and making sure makedepends 
includes
everything needed). The only issue is that if we use makepkg to install the
built package with the --install flag and along with the --rmdeps flag, we 
will
try to remove any installed dependencies that are specified in the depends
array in the package function.  To counter this, we need to use the 
--unneeded
flag for the pacman call.

Signed-off-by: Allan McRae 

---

Summary of changes:
 scripts/Makefile.am|  1 +
 .../libmakepkg/integrity/generate_checksum.sh.in   |  1 +
 scripts/libmakepkg/integrity/verify_checksum.sh.in |  1 +
 scripts/libmakepkg/lint_pkgbuild/variable.sh.in| 20 -
 scripts/libmakepkg/util/meson.build|  1 +
 scripts/libmakepkg/util/pkgbuild.sh.in |  2 +
 scripts/libmakepkg/util/schema.sh.in   | 49 ++
 scripts/makepkg.sh.in  | 13 ++
 8 files changed, 65 insertions(+), 23 deletions(-)
 create mode 100644 scripts/libmakepkg/util/schema.sh.in


hooks/post-receive
-- 
The official pacman repository


[pacman-dev] [PATCH] libmakepkg: centralise random arrays of pkgbuild variables

2019-01-30 Thread morganamilo
Refactor many of the different arrays of pkgbuild variables
into scripts/libmakepkg/util/schema.sh.in.

Signed-off-by: morganamilo 
---

All the arch overrides happen to be arrays. The current code also uses
arrays in the variable name to document this.

so use pkgbuild_schema_arch_arrays over the previously discussed
pkgbuild_schema_arch_overrides.

 scripts/Makefile.am   |  1 +
 .../integrity/generate_checksum.sh.in |  1 +
 .../integrity/verify_checksum.sh.in   |  1 +
 .../libmakepkg/lint_pkgbuild/variable.sh.in   | 20 +++-
 scripts/libmakepkg/util/meson.build   |  1 +
 scripts/libmakepkg/util/pkgbuild.sh.in|  2 +
 scripts/libmakepkg/util/schema.sh.in  | 49 +++
 scripts/makepkg.sh.in | 11 +
 8 files changed, 64 insertions(+), 22 deletions(-)
 create mode 100644 scripts/libmakepkg/util/schema.sh.in

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 08fc34b2..0e5619bd 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -124,6 +124,7 @@ LIBMAKEPKG_IN = \
libmakepkg/util/option.sh \
libmakepkg/util/parseopts.sh \
libmakepkg/util/pkgbuild.sh \
+   libmakepkg/util/schema.sh \
libmakepkg/util/source.sh \
libmakepkg/util/util.sh
 
diff --git a/scripts/libmakepkg/integrity/generate_checksum.sh.in 
b/scripts/libmakepkg/integrity/generate_checksum.sh.in
index 57ef46ff..63cdc4d6 100644
--- a/scripts/libmakepkg/integrity/generate_checksum.sh.in
+++ b/scripts/libmakepkg/integrity/generate_checksum.sh.in
@@ -25,6 +25,7 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
 
 source "$LIBRARY/util/message.sh"
 source "$LIBRARY/util/pkgbuild.sh"
+source "$LIBRARY/util/schema.sh"
 
 generate_one_checksum() {
local integ=$1 arch=$2 sources numsrc indentsz idx
diff --git a/scripts/libmakepkg/integrity/verify_checksum.sh.in 
b/scripts/libmakepkg/integrity/verify_checksum.sh.in
index 532e0693..ec61b16d 100644
--- a/scripts/libmakepkg/integrity/verify_checksum.sh.in
+++ b/scripts/libmakepkg/integrity/verify_checksum.sh.in
@@ -25,6 +25,7 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
 
 source "$LIBRARY/util/message.sh"
 source "$LIBRARY/util/pkgbuild.sh"
+source "$LIBRARY/util/schema.sh"
 
 check_checksums() {
local integ a
diff --git a/scripts/libmakepkg/lint_pkgbuild/variable.sh.in 
b/scripts/libmakepkg/lint_pkgbuild/variable.sh.in
index a975b024..512bed7b 100644
--- a/scripts/libmakepkg/lint_pkgbuild/variable.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/variable.sh.in
@@ -25,22 +25,16 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
 
 source "$LIBRARY/util/message.sh"
 source "$LIBRARY/util/pkgbuild.sh"
+source "$LIBRARY/util/schema.sh"
 
 lint_pkgbuild_functions+=('lint_variable')
 
 
 lint_variable() {
-   # TODO: refactor - similar arrays are used elsewhere
-   local array=(arch backup groups license noextract options validpgpkeys)
-   local arch_array=(checkdepends conflicts depends makedepends md5sums
- optdepends provides replaces sha1sums sha224sums
- sha256sums sha384sums sha512sums source)
-   local string=(changelog epoch install pkgbase pkgdesc pkgrel pkgver url)
-
local i a pkg out bad ret=0
 
# global variables
-   for i in ${array[@]} ${arch_array[@]}; do
+   for i in ${pkgbuild_schema_arrays[@]}; do
if declare -p $i > /dev/null 2>&1; then
if ! is_array $i; then
error "$(gettext "%s should be an array")" "$i"
@@ -52,7 +46,7 @@ lint_variable() {
for a in ${arch[@]}; do
[[ $a == "any" ]] && continue
 
-   for i in ${arch_array[@]}; do
+   for i in ${pkgbuild_schema_arch_arrays[@]}; do
if declare -p "${i}_${a}" > /dev/null 2>&1; then
if ! is_array ${i}_${a}; then
error "$(gettext "%s should be an 
array")" "${i}_${a}"
@@ -62,7 +56,7 @@ lint_variable() {
done
done
 
-   for i in ${string[@]}; do
+   for i in ${pkgbuild_schema_strings[@]}; do
if declare -p "$i" > /dev/null 2>&1; then
if is_array $i; then
error "$(gettext "%s should not be an array")" 
"$i"
@@ -73,7 +67,7 @@ lint_variable() {
 
# package function variables
for pkg in ${pkgname[@]}; do
-   for i in ${array[@]} ${arch_array[@]}; do
+   for i in ${pkgbuild_schema_arrays[@]}; do
if extract_function_variable "package_$pkg" $i 0 out; 
then
error "$(gettext "%s should be an array")" "$i"
ret=1
@@ -83,7 +77,7 @@ lint_variable() {
for a in ${arch[@]}; do
[[ $a == "any" ]] && continue
 
-   for i in 

Re: [pacman-dev] [PATCH 1/2] libalpm: Add dlclientcert and dlclientkey options.

2019-01-30 Thread Maarten de Vries
On Thu, 29 Nov 2018 at 19:42, Maarten de Vries  wrote:
>
> On 28-11-18 05:08, Allan McRae wrote:
> > On 15/11/18 2:37 am, Maarten de Vries wrote:
> >> These patches add support for client certificates to alpm and pacman.
> >>
> >> This can already be achieved currently by setting an XferCommand,
> >> but doing so significantly reduces the quality of the feedback pacman
> >> gives during the downloads. Especially annoying are the 404 errors on
> >> most database signature files, but that's not the only issue.
> >>
> >> I admit this is a bit of an edge case, but I find myself in the
> >> situation where I have to download packages from a private repository
> >> that requires a valid client certificate. I really want the nice regular
> >> pacman feedback back though, so I figured I'd hack it in myself.
> >>
> >> I tried to follow naming schemes and other conventions the best I could,
> >> but please let me know if I should change anything, or forgot something.
> > I am very, very reluctant to include this.  We have been quite strict on
> > which download options we have included in pacman in the past - it took
> > quite some time for DisableDownloadTimeout to be added and we still
> > don't have real speed limiting - although this was (still is?) due to
> > curl implementation limitation.  This is way too much of an edge case,
> > and we do have XferCommand for such things.
> >
> > Note, database signature file errors can be removed by adding "SigLevel
> > = DatabaseNone" to the relevant databases.
> >
> > Allan
>
> Well, all I can say is that for this at least curl support is excellent.
> And this does make pacman useful as package manager for internal company
> repositories that need authentication.
>
> I would love to see it in mainline pacman, but if you feel it's too much
> of an edge case, I understand. At any rate, thank you for looking at the
> patches.
>
>
> -- Maarten
>

For the archives, in case anyone else needs similar functionality: I
didn't wan't to maintain a forked pacman for this, and I really don't
like the implications of the XferCommand option, so I wrote a tool to
inject options in a CURL session of another program using LD_PRELOAD.
It can be found at https://github.com/de-vri-es/curl-inject-opt .

-- Maarten