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

2018-11-27 Thread Allan McRae
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


[pacman-dev] [PATCH] libmakepkg/executable: don't rely on scoped value of $ret to flag outcomes

2018-11-27 Thread Eli Schwartz
Elsewhere, we return 1 if a library dropin fails, and when running
functions in a loop, we use `|| ret=1` to preserve scope. This ensures
the return value of the function remains useful in isolation. Do the
same thing here as well.

Drop trivial function which wraps a dropin that also uses $ret, since
it's no longer needed.

Signed-off-by: Eli Schwartz 
---
 scripts/libmakepkg/executable.sh.in  | 2 +-
 scripts/libmakepkg/executable/ccache.sh.in   | 2 +-
 scripts/libmakepkg/executable/distcc.sh.in   | 2 +-
 scripts/libmakepkg/executable/fakeroot.sh.in | 2 +-
 scripts/libmakepkg/executable/gpg.sh.in  | 4 
 scripts/libmakepkg/executable/gzip.sh.in | 2 +-
 scripts/libmakepkg/executable/pacman.sh.in   | 2 +-
 scripts/libmakepkg/executable/strip.sh.in| 2 +-
 scripts/libmakepkg/executable/vcs.sh.in  | 8 +---
 9 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/scripts/libmakepkg/executable.sh.in 
b/scripts/libmakepkg/executable.sh.in
index 68c48038..92031d43 100644
--- a/scripts/libmakepkg/executable.sh.in
+++ b/scripts/libmakepkg/executable.sh.in
@@ -38,7 +38,7 @@ check_software() {
local ret=0
 
for func in ${executable_functions[@]}; do
-   $func
+   $func || ret=1
done
 
return $ret
diff --git a/scripts/libmakepkg/executable/ccache.sh.in 
b/scripts/libmakepkg/executable/ccache.sh.in
index dafde076..6143fee2 100644
--- a/scripts/libmakepkg/executable/ccache.sh.in
+++ b/scripts/libmakepkg/executable/ccache.sh.in
@@ -31,7 +31,7 @@ executable_ccache() {
if check_buildoption "ccache" "y"; then
if ! type -p ccache >/dev/null; then
error "$(gettext "Cannot find the %s binary required 
for compiler cache usage.")" "ccache"
-   ret=1
+   return 1
fi
fi
 }
diff --git a/scripts/libmakepkg/executable/distcc.sh.in 
b/scripts/libmakepkg/executable/distcc.sh.in
index b9883f6b..d3a8cc25 100644
--- a/scripts/libmakepkg/executable/distcc.sh.in
+++ b/scripts/libmakepkg/executable/distcc.sh.in
@@ -31,7 +31,7 @@ executable_distcc() {
if check_buildoption "distcc" "y"; then
if ! type -p distcc >/dev/null; then
error "$(gettext "Cannot find the %s binary required 
for distributed compilation.")" "distcc"
-   ret=1
+   return 1
fi
fi
 }
diff --git a/scripts/libmakepkg/executable/fakeroot.sh.in 
b/scripts/libmakepkg/executable/fakeroot.sh.in
index e22d9a96..56c1b3fd 100644
--- a/scripts/libmakepkg/executable/fakeroot.sh.in
+++ b/scripts/libmakepkg/executable/fakeroot.sh.in
@@ -31,7 +31,7 @@ executable_fakeroot() {
if check_buildenv "fakeroot" "y" && (( EUID > 0 )); then
if ! type -p fakeroot >/dev/null; then
error "$(gettext "Cannot find the %s binary.")" 
"fakeroot"
-   ret=1
+   return 1
fi
fi
 }
diff --git a/scripts/libmakepkg/executable/gpg.sh.in 
b/scripts/libmakepkg/executable/gpg.sh.in
index c0f57013..139773ef 100644
--- a/scripts/libmakepkg/executable/gpg.sh.in
+++ b/scripts/libmakepkg/executable/gpg.sh.in
@@ -28,6 +28,8 @@ source "$LIBRARY/util/option.sh"
 executable_functions+=('executable_gpg')
 
 executable_gpg() {
+   local ret=0
+
if [[ $SIGNPKG == 'y' ]] || { [[ -z $SIGNPKG ]] && check_buildenv 
"sign" "y"; }; then
if ! type -p gpg >/dev/null; then
error "$(gettext "Cannot find the %s binary required 
for signing packages.")" "gpg"
@@ -41,4 +43,6 @@ executable_gpg() {
ret=1
fi
fi
+
+   return $ret
 }
diff --git a/scripts/libmakepkg/executable/gzip.sh.in 
b/scripts/libmakepkg/executable/gzip.sh.in
index 66748320..bb1626bc 100644
--- a/scripts/libmakepkg/executable/gzip.sh.in
+++ b/scripts/libmakepkg/executable/gzip.sh.in
@@ -31,7 +31,7 @@ executable_gzip() {
if check_option "zipman" "y"; then
if ! type -p gzip >/dev/null; then
error "$(gettext "Cannot find the %s binary required 
for compressing man and info pages.")" "gzip"
-   ret=1
+   return 1
fi
fi
 }
diff --git a/scripts/libmakepkg/executable/pacman.sh.in 
b/scripts/libmakepkg/executable/pacman.sh.in
index d9967f45..d1433ffd 100644
--- a/scripts/libmakepkg/executable/pacman.sh.in
+++ b/scripts/libmakepkg/executable/pacman.sh.in
@@ -31,7 +31,7 @@ executable_pacman() {
 if (( ! NODEPS || DEP_BIN || RMDEPS || INSTALL )); then
if [[ -z $PACMAN_PATH ]]; then
error "$(gettext "Cannot find the %s binary required 
for dependency operations.")" "$PACMAN"
-   ret=1
+   return 1
fi
fi
 }
diff --git 

Re: [pacman-dev] [PATCH v2 1/2] makepkg: add internal variable to track when we're building a package

2018-11-27 Thread Allan McRae
On 28/11/18 1:46 am, Eli Schwartz wrote:
> On 11/27/18 6:33 AM, Allan McRae wrote:
>> On 14/11/18 11:55 am, Eli Schwartz wrote:
>>> There are state variables for everything else, and we use them to do
>>> conditional checks on things, but it's currently a bit difficult to test
>>> whether a package is being built, as it's the default action if *no*
>>> options are specified.
>>>
>>> Signed-off-by: Eli Schwartz 
>>> ---
>>>
>>> This makes the next patch simpler, and will be reused in some patches I
>>> intend to submit in the future.
>>>
>>>  scripts/makepkg.sh.in | 11 ++-
>>>  1 file changed, 6 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>>> index 3ac03d11..be8b761e 100644
>>> --- a/scripts/makepkg.sh.in
>>> +++ b/scripts/makepkg.sh.in
>>> @@ -59,6 +59,7 @@ known_hash_algos=('md5' 'sha1' 'sha224' 'sha256' 'sha384' 
>>> 'sha512')
>>>  # Options
>>>  ASDEPS=0
>>>  BUILDFUNC=0
>>> +BUILDPKG=1
>>>  CHECKFUNC=0
>>>  CLEANBUILD=0
>>>  CLEANUP=0
>>> @@ -1256,7 +1257,7 @@ while true; do
>>> --noprogressbar)  PACMAN_OPTS+=("--noprogressbar") ;;
>>>  
>>> # Makepkg Options
>>> -   --allsource)  SOURCEONLY=2 ;;
>>> +   --allsource)  BUILDPKG=0 SOURCEONLY=2 ;;
>>> -A|--ignorearch)  IGNOREARCH=1 ;;
>>> -c|--clean)   CLEANUP=1 ;;
>>> -C|--cleanbuild)  CLEANBUILD=1 ;;
>>> @@ -1267,7 +1268,7 @@ while true; do
>>> -f|--force)   FORCE=1 ;;
>>> -F)   INFAKEROOT=1 ;;
>>> # generating integrity checks does not depend on architecture
>>> -   -g|--geninteg)GENINTEG=1 IGNOREARCH=1;;
>>> +   -g|--geninteg)BUILDPKG=0 GENINTEG=1 IGNOREARCH=1;;
>>> --holdver)HOLDVER=1 ;;
>>> -i|--install) INSTALL=1 ;;
>>> --key)shift; GPGKEY=$1 ;;
>>> @@ -1279,8 +1280,8 @@ while true; do
>>> --nosign) SIGNPKG='n' ;;
>>> -o|--nobuild) NOBUILD=1 ;;
>>
>> BUILDPKG=0
> 
> My rationale here was that running source extraction, prepare() and
> pkgver() are part of the general category of building a package -- and
> if you use --nobuild, I expect you're likely going to use --noextract
> shortly after.

The variable name is wrong if --nobuild does not imply BUILDPKG=0.


Re: [pacman-dev] [PATCH v2 1/2] makepkg: add internal variable to track when we're building a package

2018-11-27 Thread Eli Schwartz
On 11/27/18 6:33 AM, Allan McRae wrote:
> On 14/11/18 11:55 am, Eli Schwartz wrote:
>> There are state variables for everything else, and we use them to do
>> conditional checks on things, but it's currently a bit difficult to test
>> whether a package is being built, as it's the default action if *no*
>> options are specified.
>>
>> Signed-off-by: Eli Schwartz 
>> ---
>>
>> This makes the next patch simpler, and will be reused in some patches I
>> intend to submit in the future.
>>
>>  scripts/makepkg.sh.in | 11 ++-
>>  1 file changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>> index 3ac03d11..be8b761e 100644
>> --- a/scripts/makepkg.sh.in
>> +++ b/scripts/makepkg.sh.in
>> @@ -59,6 +59,7 @@ known_hash_algos=('md5' 'sha1' 'sha224' 'sha256' 'sha384' 
>> 'sha512')
>>  # Options
>>  ASDEPS=0
>>  BUILDFUNC=0
>> +BUILDPKG=1
>>  CHECKFUNC=0
>>  CLEANBUILD=0
>>  CLEANUP=0
>> @@ -1256,7 +1257,7 @@ while true; do
>>  --noprogressbar)  PACMAN_OPTS+=("--noprogressbar") ;;
>>  
>>  # Makepkg Options
>> ---allsource)  SOURCEONLY=2 ;;
>> +--allsource)  BUILDPKG=0 SOURCEONLY=2 ;;
>>  -A|--ignorearch)  IGNOREARCH=1 ;;
>>  -c|--clean)   CLEANUP=1 ;;
>>  -C|--cleanbuild)  CLEANBUILD=1 ;;
>> @@ -1267,7 +1268,7 @@ while true; do
>>  -f|--force)   FORCE=1 ;;
>>  -F)   INFAKEROOT=1 ;;
>>  # generating integrity checks does not depend on architecture
>> --g|--geninteg)GENINTEG=1 IGNOREARCH=1;;
>> +-g|--geninteg)BUILDPKG=0 GENINTEG=1 IGNOREARCH=1;;
>>  --holdver)HOLDVER=1 ;;
>>  -i|--install) INSTALL=1 ;;
>>  --key)shift; GPGKEY=$1 ;;
>> @@ -1279,8 +1280,8 @@ while true; do
>>  --nosign) SIGNPKG='n' ;;
>>  -o|--nobuild) NOBUILD=1 ;;
> 
> BUILDPKG=0

My rationale here was that running source extraction, prepare() and
pkgver() are part of the general category of building a package -- and
if you use --nobuild, I expect you're likely going to use --noextract
shortly after.

e.g. in followup patches I would like to check whether (( BUILDPKG ||
SOURCEONLY == 2 || VERIFYSOURCE )) to determine if we should check for
vcs software, or || ( BUILDPKG && !SKIPCHECKSUMS ) as a modification to
checking for the checksum binaries.

>>  -p)   shift; BUILDFILE=$1 ;;
>> ---packagelist)PACKAGELIST=1 IGNOREARCH=1;;
>> ---printsrcinfo)   PRINTSRCINFO=1 IGNOREARCH=1;;
>> +--packagelist)BUILDPKG=0 PACKAGELIST=1 IGNOREARCH=1;;
>> +--printsrcinfo)   BUILDPKG=0 PRINTSRCINFO=1 IGNOREARCH=1;;
>>  -r|--rmdeps)  RMDEPS=1 ;;
>>  -R|--repackage)   REPKG=1 ;;
>>  --sign)   SIGNPKG='y' ;;
>> @@ -1289,7 +1290,7 @@ while true; do
>>  --skippgpcheck)   SKIPPGPCHECK=1;;
>>  -s|--syncdeps)DEP_BIN=1 ;;
>>  -S|--source)  SOURCEONLY=1 ;;
> 
> BUILDPKG=0

Will fix once I'm sure how to handle the above case.

>> ---verifysource)   VERIFYSOURCE=1 ;;
>> +--verifysource)   BUILDPKG=0 VERIFYSOURCE=1 ;;
>>  
>>  -h|--help)usage; exit $E_OK ;;
>>  -V|--version) version; exit $E_OK ;;
>>

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


[pacman-dev] [PATCH v3 2/2] Split prepare_buildenv() to libmakepkg

2018-11-27 Thread Que Quotion
From: Que Quotion 

Thank you for the assistance, and the merges.

I triple checked these patches before sending them.

I might have extremely early onset Alzheimer's. ¯\_(ツ)_/¯


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

2018-11-27 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  44cfc09511aa7c67eb09ee5ceec5cf6f23f7f9c9 (commit)
   via  61fe73804305a8bbb434cdc245944df5284f1964 (commit)
   via  3726693612a7ab34a1cd27916a6d65314299812c (commit)
   via  508b4e3ec0cb3e365942f4dc0626edda4789932b (commit)
   via  0bb04fa16a82db133dd010478c1256bc8500c5e7 (commit)
   via  d81b5cc2a5193a344fc6f9cbf72d406d5597d85b (commit)
   via  1aaf95089a971730b1c7bcdf6fd98c0534459b01 (commit)
   via  926eb345c26690ca93b6483ac949612c9b53e9db (commit)
   via  c41222837d76d550921a70dd95c509537031102c (commit)
   via  0dd14924424478564321fc681e3f344b53fb7b54 (commit)
  from  de915c4f145d6e985c3c0fdf8fe121b5066d711c (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 44cfc09511aa7c67eb09ee5ceec5cf6f23f7f9c9
Author: Andrew Gregory 
Date:   Sat Nov 24 15:56:13 2018 -0800

require actual siglevel for default

ALPM_SIG_USE_DEFAULT does not refer to an actual siglevel, rather it
indicates that the global default should be used in place of the
operation-specific one.  Setting this value for the global default
itself makes no sense.

Signed-off-by: Andrew Gregory 
Signed-off-by: Allan McRae 

commit 61fe73804305a8bbb434cdc245944df5284f1964
Author: Andrew Gregory 
Date:   Sat Nov 24 15:56:12 2018 -0800

always allow explicit empty siglevel for sync dbs

An empty siglevel does not do any signature verification which is
exactly what we want when compiled without gpg support.  This is already
allowed in other parts of the codebase and required for the test suite
to pass when compiled without gpg support.

Fixes: FS#60880

Signed-off-by: Andrew Gregory 
Signed-off-by: Allan McRae 

commit 3726693612a7ab34a1cd27916a6d65314299812c
Author: Andrew Gregory 
Date:   Sat Nov 24 15:56:11 2018 -0800

add specific error for missing gpg support

"wrong or NULL argument passed" is a useless error for end users.

Fixes FS#60880.

Signed-off-by: Andrew Gregory 
Signed-off-by: Allan McRae 

commit 508b4e3ec0cb3e365942f4dc0626edda4789932b
Author: Que Quotion 
Date:   Tue Nov 27 18:23:02 2018 +0900

Split prepare_buildenv() to libmakepkg

This opens the door for third parties to provide libmakepkg
extentions for the purpose of altering the build environment.

Signed-off-by: Que Quotion 
Signed-off-by: Allan McRae 

commit 0bb04fa16a82db133dd010478c1256bc8500c5e7
Author: Que Quotion 
Date:   Tue Nov 27 18:23:00 2018 +0900

Split check_software() to libmakepkg

This opens the door for third parties who provide extensions to
libmakepkg to supply scripts that confirm the presence of their
dependant executables.

Signed-off-by: Que Quotion 
Signed-off-by: Allan McRae 

commit d81b5cc2a5193a344fc6f9cbf72d406d5597d85b
Author: Dave Reisner 
Date:   Tue Nov 13 23:17:02 2018 -0500

scripts/meson: ensure wrapper scripts are executable

commit 1aaf95089a971730b1c7bcdf6fd98c0534459b01
Author: Eli Schwartz 
Date:   Sun Nov 4 18:27:22 2018 -0500

makepkg: if "!buildflags" and "debug" coincide, unset the debug buildflags 
too

If a user has a makepkg.conf policy to enable debug builds, but a
PKGBUILD has disabled buildflags, we would unset the *FLAGS but then
later append the debug *FLAGS anyway, which would result in some *FLAGS
being used, against the wishes of the PKGBUILD author.

Signed-off-by: Eli Schwartz 
Signed-off-by: Allan McRae 

commit 926eb345c26690ca93b6483ac949612c9b53e9db
Author: Dave Reisner 
Date:   Sat Nov 3 20:00:07 2018 -0400

buildsys: remove size_to_human

This was only ever used by paccache, and paccache has since been moved
to pacman-contrib.

commit c41222837d76d550921a70dd95c509537031102c
Author: Dave Reisner 
Date:   Sat Nov 3 19:58:31 2018 -0400

meson: separate out wrapped from non-wrapped scripts

makepkg-template is a perl script and doesn't get wrapped by our shell
wrapper. It (wrongly) reads from the host machine rather than the build
root, but this is working as implemented.

commit 0dd14924424478564321fc681e3f344b53fb7b54
Author: Allan McRae 
Date:   Tue Nov 27 22:42:13 2018 +1000

Remove Doxyfile from EXTRA_DIST

We generate this now, so no need to distribute. Fixes "make dist".

Signed-off-by: Allan McRae 

---

Summary of changes:
 doc/Makefile.am|   1 -
 lib/libalpm/alpm.h

[pacman-dev] [PATCH] Remove Doxyfile from EXTRA_DIST

2018-11-27 Thread Allan McRae
We generate this now, so no need to distribute. Fixes "make dist".

Signed-off-by: Allan McRae 
---
 doc/Makefile.am | 1 -
 1 file changed, 1 deletion(-)

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 711921fd..4bb0f01b 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -65,7 +65,6 @@ EXTRA_DIST = \
index.asciidoc \
submitting-patches.asciidoc \
translation-help.asciidoc \
-   Doxyfile \
$(MANPAGES) \
$(DOXYGEN_MANS)
 
-- 
2.19.1


Re: [pacman-dev] [PATCH v2 1/2] makepkg: add internal variable to track when we're building a package

2018-11-27 Thread Allan McRae
On 14/11/18 11:55 am, Eli Schwartz wrote:
> There are state variables for everything else, and we use them to do
> conditional checks on things, but it's currently a bit difficult to test
> whether a package is being built, as it's the default action if *no*
> options are specified.
> 
> Signed-off-by: Eli Schwartz 
> ---
> 
> This makes the next patch simpler, and will be reused in some patches I
> intend to submit in the future.
> 
>  scripts/makepkg.sh.in | 11 ++-
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 3ac03d11..be8b761e 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -59,6 +59,7 @@ known_hash_algos=('md5' 'sha1' 'sha224' 'sha256' 'sha384' 
> 'sha512')
>  # Options
>  ASDEPS=0
>  BUILDFUNC=0
> +BUILDPKG=1
>  CHECKFUNC=0
>  CLEANBUILD=0
>  CLEANUP=0
> @@ -1256,7 +1257,7 @@ while true; do
>   --noprogressbar)  PACMAN_OPTS+=("--noprogressbar") ;;
>  
>   # Makepkg Options
> - --allsource)  SOURCEONLY=2 ;;
> + --allsource)  BUILDPKG=0 SOURCEONLY=2 ;;
>   -A|--ignorearch)  IGNOREARCH=1 ;;
>   -c|--clean)   CLEANUP=1 ;;
>   -C|--cleanbuild)  CLEANBUILD=1 ;;
> @@ -1267,7 +1268,7 @@ while true; do
>   -f|--force)   FORCE=1 ;;
>   -F)   INFAKEROOT=1 ;;
>   # generating integrity checks does not depend on architecture
> - -g|--geninteg)GENINTEG=1 IGNOREARCH=1;;
> + -g|--geninteg)BUILDPKG=0 GENINTEG=1 IGNOREARCH=1;;
>   --holdver)HOLDVER=1 ;;
>   -i|--install) INSTALL=1 ;;
>   --key)shift; GPGKEY=$1 ;;
> @@ -1279,8 +1280,8 @@ while true; do
>   --nosign) SIGNPKG='n' ;;
>   -o|--nobuild) NOBUILD=1 ;;

BUILDPKG=0

>   -p)   shift; BUILDFILE=$1 ;;
> - --packagelist)PACKAGELIST=1 IGNOREARCH=1;;
> - --printsrcinfo)   PRINTSRCINFO=1 IGNOREARCH=1;;
> + --packagelist)BUILDPKG=0 PACKAGELIST=1 IGNOREARCH=1;;
> + --printsrcinfo)   BUILDPKG=0 PRINTSRCINFO=1 IGNOREARCH=1;;
>   -r|--rmdeps)  RMDEPS=1 ;;
>   -R|--repackage)   REPKG=1 ;;
>   --sign)   SIGNPKG='y' ;;
> @@ -1289,7 +1290,7 @@ while true; do
>   --skippgpcheck)   SKIPPGPCHECK=1;;
>   -s|--syncdeps)DEP_BIN=1 ;;
>   -S|--source)  SOURCEONLY=1 ;;

BUILDPKG=0

> - --verifysource)   VERIFYSOURCE=1 ;;
> + --verifysource)   BUILDPKG=0 VERIFYSOURCE=1 ;;
>  
>   -h|--help)usage; exit $E_OK ;;
>   -V|--version) version; exit $E_OK ;;
> 


Re: [pacman-dev] [PATCH] check localdb before upgrading package

2018-11-27 Thread Allan McRae
On 17/11/18 1:47 pm, Andrew Gregory wrote:
> Commit 2ee7a8d89ad693617307260604e1d58757fd2978 replaced a manual check
> for a local package with a check for the "oldpkg" member, which gets set
> at the beginning of the transaction.  If the package was also in the
> remove list, such as when a package gets replaced, it would no longer be
> in the local db and pacman would try to remove it twice, resulting in
> superfluous error messages.
> 
> Fixes: FS#50875, FS#5554
> 
> Signed-off-by: Andrew Gregory 
> ---
>  lib/libalpm/add.c |  2 +-
>  test/pacman/meson.build   |  1 +
>  test/pacman/tests/TESTS   |  1 +
>  .../tests/replace-and-upgrade-package.py  | 27 +++
>  4 files changed, 30 insertions(+), 1 deletion(-)
>  create mode 100644 test/pacman/tests/replace-and-upgrade-package.py
> 

Thanks!  Committed with bug number typo fixed.

A


Re: [pacman-dev] [PATCH 1/3] add specific error for missing gpg support

2018-11-27 Thread Allan McRae
On 25/11/18 9:56 am, Andrew Gregory wrote:
> "wrong or NULL argument passed" is a useless error for end users.
> 
> Fixes FS#60880.
> 
> Signed-off-by: Andrew Gregory 
> ---

This patch series looks good to me.

Allan


Re: [pacman-dev] [PATCH v3 2/2] Split prepare_buildenv() to libmakepkg

2018-11-27 Thread Allan McRae
On 27/11/18 7:23 pm, Que Quotion wrote:
> From: Que Quotion 
> 
> This opens the door for third parties to provide libmakepkg
> extentions for the purpose of altering the build environment.
> 
> See makepkg-optimize in the AUR for examples.
> 
> Signed-off-by: Que Quotion 
> ---

OK.

Caught a couple of typos.  Also, some of these options have been around
forever...  I see some of them originating in 2007 at the latest.   I
suspect they may go back further, but just started the copyright year on
the split files from then.

Allan


Re: [pacman-dev] [PATCH v3 1/2] Split check_software() to libmakepkg

2018-11-27 Thread Allan McRae
On 27/11/18 7:23 pm, Que Quotion wrote:
> From: Que Quotion 
> 
> This opens the door for third parties who provide extensions to
> libmakepkg to supply scripts that confirm the presence of their
> dependant executables.
> 
> See makepkg-optimize in the AUR for examples.
> 
> Signed-off-by: Que Quotion 
> ---
> Split v2 patch into two patches as requested.
> First, split check_software() out so that we can split
> prepare_buildenv() out as a separate patch later.
> 

I had reviewed this offline.   A couple of issues crept in while doing
the latest revisions (truncated copyright year, indenting in copyright
notice for one file), but I have fixed these and pulled the patch.

Thanks,
Allan


[pacman-dev] [PATCH v3 2/2] Split prepare_buildenv() to libmakepkg

2018-11-27 Thread Que Quotion
From: Que Quotion 

This opens the door for third parties to provide libmakepkg
extentions for the purpose of altering the build environment.

See makepkg-optimize in the AUR for examples.

Signed-off-by: Que Quotion 
---
 scripts/Makefile.am  |  6 +++
 scripts/libmakepkg/buildenv.sh.in| 47 +
 scripts/libmakepkg/buildenv/buildflags.sh.in | 35 +
 scripts/libmakepkg/buildenv/compiler.sh.in   | 55 
 scripts/libmakepkg/buildenv/debugflags.sh.in | 38 ++
 scripts/libmakepkg/buildenv/makeflags.sh.in  | 35 +
 scripts/libmakepkg/buildenv/meson.build  | 20 +++
 scripts/libmakepkg/meson.build   |  1 +
 scripts/makepkg.sh.in| 44 +---
 9 files changed, 238 insertions(+), 43 deletions(-)
 create mode 100644 scripts/libmakepkg/buildenv.sh.in
 create mode 100644 scripts/libmakepkg/buildenv/buildflags.sh.in
 create mode 100644 scripts/libmakepkg/buildenv/compiler.sh.in
 create mode 100644 scripts/libmakepkg/buildenv/debugflags.sh.in
 create mode 100644 scripts/libmakepkg/buildenv/makeflags.sh.in
 create mode 100644 scripts/libmakepkg/buildenv/meson.build

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 739aeb36..6e47c1a1 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -41,6 +41,7 @@ LIBRARY = \
 libmakepkgdir = $(datarootdir)/makepkg

 LIBMAKEPKGDIRS = \
+   buildenv \
executable \
integrity \
lint_config \
@@ -62,6 +63,11 @@ LIBMAKEPKG_IN = \
libmakepkg/executable/strip.sh \
libmakepkg/executable/sudo.sh \
libmakepkg/executable/vcs.sh \
+   libmakepkg/buildenv.sh \
+   libmakepkg/buildenv/buildflags.sh \
+   libmakepkg/buildenv/compiler.sh \
+   libmakepkg/buildenv/debugflags.sh \
+   libmakepkg/buildenv/makeflags.sh \
libmakepkg/integrity.sh \
libmakepkg/integrity/generate_checksum.sh \
libmakepkg/integrity/generate_signature.sh \
diff --git a/scripts/libmakepkg/buildenv.sh.in 
b/scripts/libmakepkg/buildenv.sh.in
new file mode 100644
index ..3126e94c
--- /dev/null
+++ b/scripts/libmakepkg/buildenv.sh.in
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+#   buildenv.sh - functions for altering the build environment before
+#   compiliation
+#
+#   Copyright (c) 2016-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_BUILDENV_SH" ]] && return
+LIBMAKEPKG_BUILDENV_SH=1
+
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
+source "$LIBRARY/util/message.sh"
+
+
+declare -a buildenv_functions build_options
+
+for lib in "$LIBRARY/buildenv/"*.sh; do
+   source "$lib"
+done
+
+readonly -a buildenv_functions build_options
+
+prepare_buildenv() {
+   for func in ${buildenv_functions[@]}; do
+   $func
+   done
+
+   # ensure all necessary build variables are exported
+   export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS MAKEFLAGS CHOST
+}
diff --git a/scripts/libmakepkg/buildenv/buildflags.sh.in 
b/scripts/libmakepkg/buildenv/buildflags.sh.in
new file mode 100644
index ..ac207fd3
--- /dev/null
+++ b/scripts/libmakepkg/buildenv/buildflags.sh.in
@@ -0,0 +1,35 @@
+#!/usr/bin/bash
+#
+#   buildflags.sh - Clear user-specified buildflags if requested
+#
+#   Copyright (c) 2016-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_BUILDENV_BUILDFLAGS_SH" ]] && return
+LIBMAKEPKG_BUILDENV_BUILDFLAGS_SH=1
+
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
+source "$LIBRARY/util/option.sh"
+
+build_options+=('buildflags')
+buildenv_functions+=('buildenv_buildflags')
+
+buildenv_buildflags() {
+   if check_option "buildflags" "n"; then

[pacman-dev] [PATCH v3 1/2] Split check_software() to libmakepkg

2018-11-27 Thread Que Quotion
From: Que Quotion 

This opens the door for third parties who provide extensions to
libmakepkg to supply scripts that confirm the presence of their
dependant executables.

See makepkg-optimize in the AUR for examples.

Signed-off-by: Que Quotion 
---
Split v2 patch into two patches as requested.
First, split check_software() out so that we can split
prepare_buildenv() out as a separate patch later.

 scripts/Makefile.am  |  12 ++
 scripts/libmakepkg/executable.sh.in  |  45 +
 scripts/libmakepkg/executable/ccache.sh.in   |  37 
 scripts/libmakepkg/executable/checksum.sh.in |  42 +
 scripts/libmakepkg/executable/distcc.sh.in   |  37 
 scripts/libmakepkg/executable/fakeroot.sh.in |  37 
 scripts/libmakepkg/executable/gpg.sh.in  |  44 +
 scripts/libmakepkg/executable/gzip.sh.in |  37 
 scripts/libmakepkg/executable/meson.build|  26 +++
 scripts/libmakepkg/executable/pacman.sh.in   |  37 
 scripts/libmakepkg/executable/strip.sh.in|  37 
 scripts/libmakepkg/executable/sudo.sh.in |  36 
 scripts/libmakepkg/executable/vcs.sh.in  | 109 
 scripts/libmakepkg/meson.build   |   1 +
 scripts/makepkg.sh.in| 172 ---
 15 files changed, 537 insertions(+), 172 deletions(-)
 create mode 100644 scripts/libmakepkg/executable.sh.in
 create mode 100644 scripts/libmakepkg/executable/ccache.sh.in
 create mode 100644 scripts/libmakepkg/executable/checksum.sh.in
 create mode 100644 scripts/libmakepkg/executable/distcc.sh.in
 create mode 100644 scripts/libmakepkg/executable/fakeroot.sh.in
 create mode 100644 scripts/libmakepkg/executable/gpg.sh.in
 create mode 100644 scripts/libmakepkg/executable/gzip.sh.in
 create mode 100644 scripts/libmakepkg/executable/meson.build
 create mode 100644 scripts/libmakepkg/executable/pacman.sh.in
 create mode 100644 scripts/libmakepkg/executable/strip.sh.in
 create mode 100644 scripts/libmakepkg/executable/sudo.sh.in
 create mode 100644 scripts/libmakepkg/executable/vcs.sh.in

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index c6b6220e..739aeb36 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -41,6 +41,7 @@ LIBRARY = \
 libmakepkgdir = $(datarootdir)/makepkg

 LIBMAKEPKGDIRS = \
+   executable \
integrity \
lint_config \
lint_package \
@@ -50,6 +51,17 @@ LIBMAKEPKGDIRS = \
util

 LIBMAKEPKG_IN = \
+   libmakepkg/executable.sh \
+   libmakepkg/executable/ccache.sh \
+   libmakepkg/executable/checksum.sh \
+   libmakepkg/executable/distcc.sh \
+   libmakepkg/executable/fakeroot.sh \
+   libmakepkg/executable/gpg.sh \
+   libmakepkg/executable/gzip.sh \
+   libmakepkg/executable/pacman.sh \
+   libmakepkg/executable/strip.sh \
+   libmakepkg/executable/sudo.sh \
+   libmakepkg/executable/vcs.sh \
libmakepkg/integrity.sh \
libmakepkg/integrity/generate_checksum.sh \
libmakepkg/integrity/generate_signature.sh \
diff --git a/scripts/libmakepkg/executable.sh.in 
b/scripts/libmakepkg/executable.sh.in
new file mode 100644
index ..68c48038
--- /dev/null
+++ b/scripts/libmakepkg/executable.sh.in
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+#   executable.sh - confirm presence of dependent executables
+#
+#   Copyright (c) 2011-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_EXECUTABLE_SH" ]] && return
+LIBMAKEPKG_EXECUTABLE_SH=1
+
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
+source "$LIBRARY/util/message.sh"
+
+
+declare -a executable_functions
+
+for lib in "$LIBRARY/executable/"*.sh; do
+   source "$lib"
+done
+
+readonly -a executable_functions
+
+check_software() {
+   local ret=0
+
+   for func in ${executable_functions[@]}; do
+   $func
+   done
+
+   return $ret
+}
diff --git a/scripts/libmakepkg/executable/ccache.sh.in 
b/scripts/libmakepkg/executable/ccache.sh.in
new file mode 100644
index ..6871d64a
--- /dev/null
+++ b/scripts/libmakepkg/executable/ccache.sh.in
@@ -0,0 +1,37 @@
+#!/usr/bin/bash
+#
+#   ccache.sh - Confirm presence of CCache binary
+#
+#   Copyright (c) 2011-2018 Pacman Development Team 
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General