[pacman-dev] [PATCH] Do not check directory permissions and config with --printsrcinfo

2019-10-24 Thread arch
From: Erich Eckner 

Variables from the config make no difference with `--printsrcinfo`, also
the directory permissions ($SRCDEST, $PKGDEST, $SRCPKGDEST, $BUILDDIR)
do not matter in that case.

This relieves one from customizing /etc/makepkg.conf on a system, where
only ever `makepkg --printsrcinfo` will be invoked, solely to get rid of
lint warnings.

Signed-off-by: Erich Eckner 
---
 scripts/makepkg.sh.in | 30 --
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index e134200f..f5f5f4f7 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1135,24 +1135,26 @@ else
 fi
 
 
-# check makepkg.conf for some basic requirements
-lint_config || exit $E_CONFIG_ERROR
+if (( !PRINTSRCINFO )); then
+   # check makepkg.conf for some basic requirements
+   lint_config || exit $E_CONFIG_ERROR
 
 
-# check that all settings directories are user-writable
-if ! ensure_writable_dir "BUILDDIR" "$BUILDDIR"; then
-   plain "$(gettext "Aborting...")"
-   exit $E_FS_PERMISSIONS
-fi
+   # check that all settings directories are user-writable
+   if ! ensure_writable_dir "BUILDDIR" "$BUILDDIR"; then
+   plain "$(gettext "Aborting...")"
+   exit $E_FS_PERMISSIONS
+   fi
 
-if (( ! (NOBUILD || GENINTEG) )) && ! ensure_writable_dir "PKGDEST" 
"$PKGDEST"; then
-   plain "$(gettext "Aborting...")"
-   exit $E_FS_PERMISSIONS
-fi
+   if (( ! (NOBUILD || GENINTEG) )) && ! ensure_writable_dir "PKGDEST" 
"$PKGDEST"; then
+   plain "$(gettext "Aborting...")"
+   exit $E_FS_PERMISSIONS
+   fi
 
-if ! ensure_writable_dir "SRCDEST" "$SRCDEST" ; then
-   plain "$(gettext "Aborting...")"
-   exit $E_FS_PERMISSIONS
+   if ! ensure_writable_dir "SRCDEST" "$SRCDEST" ; then
+   plain "$(gettext "Aborting...")"
+   exit $E_FS_PERMISSIONS
+   fi
 fi
 
 if (( SOURCEONLY )); then
-- 
2.23.0


[pacman-dev] (no subject)

2019-10-24 Thread arch
Since the update to pacman 5.2.0, `makepkg --printsrcinfo` may emmit 
warnings about invalid packager format. However, all config variables in 
/etc/makepkg.conf, as well as directory permissions are not relevant if 
`--printsrcinfo` is given. So we simply skip the lint_conf and directory 
permisison checks then.


[pacman-dev] [pacman] [PATCH] makepkg: remove makedepends before installing built package

2019-09-12 Thread arch
From: Erich Eckner 

When running `makepkg -i` it may be necessary to first remove make- and
checkdepends before installing the built package - for example if they
conflict each other. This is the case for wireguard-arch which
makedepends and conflicts wireguard-dkms.

Signed-off-by: Erich Eckner 
---
 scripts/makepkg.sh.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 43484db3..25d97287 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -821,6 +821,9 @@ create_srcpackage() {
 install_package() {
(( ! INSTALL )) && return 0
 
+   remove_deps || return $?
+   RMDEPS=0
+
if (( ! SPLITPKG )); then
msg "$(gettext "Installing package %s with %s...")" "$pkgname" 
"$PACMAN -U"
else
-- 
2.23.0


[pacman-dev] [PATCH] makepkg: remove installed packages if installation of makedepends fails

2019-06-25 Thread arch
From: Erich Eckner 

When makepkg fails to install makedepends=() or checkdepends=(), it
should still remove installed depends=() packages iff RMDEPS is set. To
correctly do this, it needs to remember the installed packages after
successfully installing depends=().

Signed-off-by: Erich Eckner 
---
 scripts/makepkg.sh.in | 4 
 1 file changed, 4 insertions(+)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index aa03e9d9..a6c94e97 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1366,6 +1366,10 @@ else
msg "$(gettext "Checking runtime dependencies...")"
resolve_deps ${depends[@]} || deperr=1
 
+   if (( RMDEPS )); then
+   current_pkglist=($(run_pacman -Qq))# required by remove_deps
+   fi
+
if (( RMDEPS && INSTALL )); then
original_pkglist=($(run_pacman -Qq))# required by remove_dep
fi
-- 
2.22.0


[pacman-dev] [PATCH] makepkg: install all dependencies simultanously, if possible when using rmdeps but not install, runtime dependencies do not need special handling for (non)removal, and can be inst

2018-06-08 Thread arch
From: Erich Eckner 

Signed-off-by: Erich Eckner 
---
 scripts/makepkg.sh.in | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index e9080a70..625b89a2 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1607,18 +1607,18 @@ else
fi
deperr=0
 
-   msg "$(gettext "Checking runtime dependencies...")"
-   resolve_deps ${depends[@]} || deperr=1
-
if (( RMDEPS && INSTALL )); then
+   msg "$(gettext "Checking runtime dependencies...")"
+   resolve_deps ${depends[@]} || deperr=1
+
original_pkglist=($(run_pacman -Qq))# required by remove_dep
fi
 
msg "$(gettext "Checking buildtime dependencies...")"
if (( CHECKFUNC )); then
-   resolve_deps "${makedepends[@]}" "${checkdepends[@]}" || 
deperr=1
+   resolve_deps "${depends[@]}" "${makedepends[@]}" 
"${checkdepends[@]}" || deperr=1
else
-   resolve_deps "${makedepends[@]}" || deperr=1
+   resolve_deps "${depends[@]}" "${makedepends[@]}" || deperr=1
fi
 
if (( RMDEPS )); then
-- 
2.17.1