[pacman-dev] [PATCH 3/4] add pacman-conf utility

Allan McRae allan at archlinux.org
Thu Jan 18 05:29:14 UTC 2018


On 18/01/18 14:59, Allan McRae wrote:
> On 14/01/18 02:49, Andrew Gregory wrote:
>> Parsing pacman's configuration file is non-trivial and extremely
>> difficult to do correctly from scripts; even our own do it incorrectly.
>> pacman-conf is a dedicated tool specifically to allow scripts to parse
>> config files, getting the same value that pacman itself would use.
>>
>> Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
> 
> The automake changes resulted in a big warning that is fixed by enabling
> subdir-objects in configure.ac and ignoring the .dirstamp file it creates.


Crap... that breaks "make distcheck".  More specifically "make
distclean" as it tries to remove the generated object files for the
common files twice.

> There was also a directory being created in the src/util with the name
> '$(top_srcdir)'.  This is due to using a variable in the paths (no idea
> why this is an issue), but replacing it with a relative path "fixes" the
> issue.
> 
> I'll squash the following into your patch:
> 
> 
>>From 4c3d7964da2ba4276e4464920fb795e9f973e3ec Mon Sep 17 00:00:00 2001
> From: Allan McRae <allan at archlinux.org>
> Date: Thu, 18 Jan 2018 14:54:17 +1000
> Subject: [PATCH] [SQUASH] Fix automake usage for pacman-conf
> 
> Signed-off-by: Allan McRae <allan at archlinux.org>
> ---
>  .gitignore           |  1 +
>  configure.ac         |  2 +-
>  src/util/Makefile.am | 20 ++++++++++----------
>  3 files changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/.gitignore b/.gitignore
> index 499d499b..7399a120 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -1,5 +1,6 @@
>  *~
>  *.o
> +.dirstamp
>  ABOUT-NLS
>  aclocal.m4
>  autom4te.cache
> diff --git a/configure.ac b/configure.ac
> index 86f5bb6e..02afba83 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -60,7 +60,7 @@ AC_CONFIG_AUX_DIR([build-aux])
>  AC_REQUIRE_AUX_FILE([tap-driver.sh])
> 
>  AC_CANONICAL_HOST
> -AM_INIT_AUTOMAKE([1.11 foreign])
> +AM_INIT_AUTOMAKE([1.11 foreign subdir-objects])
>  AM_SILENT_RULES([yes])
> 
>  LT_INIT
> diff --git a/src/util/Makefile.am b/src/util/Makefile.am
> index aa812b99..84598ea0 100644
> --- a/src/util/Makefile.am
> +++ b/src/util/Makefile.am
> @@ -26,16 +26,16 @@ cleanupdelta_SOURCES = cleanupdelta.c
>  cleanupdelta_LDADD = $(top_builddir)/lib/libalpm/.libs/libalpm.la
> 
>  pacman_conf_SOURCES = pacman-conf.c \
> -	$(top_srcdir)/src/pacman/util.h \
> -	$(top_srcdir)/src/pacman/util.c \
> -	$(top_srcdir)/src/pacman/ini.h \
> -	$(top_srcdir)/src/pacman/ini.c \
> -	$(top_srcdir)/src/pacman/util-common.h \
> -	$(top_srcdir)/src/pacman/util-common.c \
> -	$(top_srcdir)/src/pacman/callback.h \
> -	$(top_srcdir)/src/pacman/callback.c \
> -	$(top_srcdir)/src/pacman/conf.h \
> -	$(top_srcdir)/src/pacman/conf.c
> +	../pacman/util.h \
> +	../pacman/util.c \
> +	../pacman/ini.h \
> +	../pacman/ini.c \
> +	../pacman/util-common.h \
> +	../pacman/util-common.c \
> +	../pacman/callback.h \
> +	../pacman/callback.c \
> +	../pacman/conf.h \
> +	../pacman/conf.c
>  pacman_conf_LDADD = $(top_builddir)/lib/libalpm/.libs/libalpm.la
> 
>  testpkg_SOURCES = testpkg.c
> 


More information about the pacman-dev mailing list