[pacman-dev] [PATCHv2] makepkg: fix -r and --needed conflict

William Giokas 1007380 at gmail.com
Sat Feb 9 13:57:39 EST 2013


In makepkg, passing -sr --needed causes there to be a conflict when
pacman goes to remove the dependencies, as the --needed flag is not an
option for pacman -R. This patch makes --needed not get added to the
PACMAN_OPTS array, but it acts like ASDEPS, and is only added to an
install function.

Signed-off-by: William Giokas <1007380 at gmail.com>
---
After the emails from Andrew and Allan, fixed up and made a whole lot
less wasteful. Thanks for the feedback.

 scripts/makepkg.sh.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index c464ec7..c41d325 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -54,6 +54,7 @@ readonly -a packaging_options other_options splitpkg_overrides
 
 # Options
 ASDEPS=0
+NEEDED=0
 ASROOT=0
 CLEANUP=0
 DEP_BIN=0
@@ -1983,6 +1984,7 @@ install_package() {
 
 	local fullver pkgarch pkg pkglist
 	(( ASDEPS )) && pkglist+=('--asdeps')
+	(( NEEDED )) && pkglist+=('--needed')
 
 	for pkg in ${pkgname[@]}; do
 		fullver=$(get_full_version $pkg)
@@ -2469,7 +2471,7 @@ while true; do
 		# Pacman Options
 		--asdeps)         ASDEPS=1;;
 		--noconfirm)      PACMAN_OPTS+=" --noconfirm" ;;
-		--needed)         PACMAN_OPTS+=" --needed" ;;
+		--needed)         NEEDED=1;;
 		--noprogressbar)  PACMAN_OPTS+=" --noprogressbar" ;;
 
 		# Makepkg Options
-- 
1.8.1.3.535.ga923c31



More information about the pacman-dev mailing list