sync with pacman 2.9.8
This commit is contained in:
parent
1fadb8d250
commit
041e51f68d
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# makepkg
|
# makepkg
|
||||||
#
|
#
|
||||||
# Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
# Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -43,6 +43,8 @@ NOEXTRACT=0
|
|||||||
NOSTRIP=0
|
NOSTRIP=0
|
||||||
RMDEPS=0
|
RMDEPS=0
|
||||||
|
|
||||||
|
PACMAN_OPTS=
|
||||||
|
|
||||||
# source Arch's abs.conf if it's present
|
# source Arch's abs.conf if it's present
|
||||||
[ -f /etc/abs/abs.conf ] && source /etc/abs/abs.conf
|
[ -f /etc/abs/abs.conf ] && source /etc/abs/abs.conf
|
||||||
|
|
||||||
@ -108,7 +110,7 @@ checkdeps() {
|
|||||||
|
|
||||||
[ $# -gt 0 ] || return
|
[ $# -gt 0 ] || return
|
||||||
|
|
||||||
missdep=`pacman -T $*`
|
missdep=`pacman $PACMAN_OPTS -T $*`
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ "$ret" != "0" ]; then
|
if [ "$ret" != "0" ]; then
|
||||||
if [ "$ret" = "127" ]; then
|
if [ "$ret" = "127" ]; then
|
||||||
@ -148,7 +150,7 @@ handledeps() {
|
|||||||
if [ "$DEP_BIN" = "1" ]; then
|
if [ "$DEP_BIN" = "1" ]; then
|
||||||
# install missing deps from binary packages (using pacman -S)
|
# install missing deps from binary packages (using pacman -S)
|
||||||
msg "Installing missing dependencies..."
|
msg "Installing missing dependencies..."
|
||||||
pacman -D $deplist
|
pacman $PACMAN_OPTS -D $deplist
|
||||||
if [ "$?" = "127" ]; then
|
if [ "$?" = "127" ]; then
|
||||||
error "Failed to install missing dependencies."
|
error "Failed to install missing dependencies."
|
||||||
exit 1
|
exit 1
|
||||||
@ -163,7 +165,7 @@ handledeps() {
|
|||||||
FAKEROOTKEY2=$FAKEROOTKEY
|
FAKEROOTKEY2=$FAKEROOTKEY
|
||||||
unset FAKEROOTKEY
|
unset FAKEROOTKEY
|
||||||
fi
|
fi
|
||||||
sudo pacman -D $deplist
|
sudo pacman $PACMAN_OPTS -D $deplist
|
||||||
if [ "$INFAKEROOT" = "1" ]; then
|
if [ "$INFAKEROOT" = "1" ]; then
|
||||||
export FAKEROOTKEY=$FAKEROOTKEY2
|
export FAKEROOTKEY=$FAKEROOTKEY2
|
||||||
unset FAKEROOTKEY2
|
unset FAKEROOTKEY2
|
||||||
@ -224,8 +226,10 @@ handledeps() {
|
|||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "makepkg version $myver"
|
echo "makepkg version $myver"
|
||||||
echo "usage: $0 [options]"
|
echo
|
||||||
echo "options:"
|
echo "Usage: $0 [options]"
|
||||||
|
echo
|
||||||
|
echo "Options:"
|
||||||
echo " -b, --builddeps Build missing dependencies from source"
|
echo " -b, --builddeps Build missing dependencies from source"
|
||||||
echo " -B, --noccache Do not use ccache during build"
|
echo " -B, --noccache Do not use ccache during build"
|
||||||
echo " -c, --clean Clean up work files after build"
|
echo " -c, --clean Clean up work files after build"
|
||||||
@ -246,8 +250,12 @@ usage() {
|
|||||||
echo " -S, --sudosync Install missing dependencies with pacman and sudo"
|
echo " -S, --sudosync Install missing dependencies with pacman and sudo"
|
||||||
echo " -w <destdir> Write package to <destdir> instead of the working dir"
|
echo " -w <destdir> Write package to <destdir> instead of the working dir"
|
||||||
echo
|
echo
|
||||||
echo " if -p is not specified, makepkg will look for a PKGBUILD"
|
echo "These options can be passed to pacman:"
|
||||||
echo " file in the current directory."
|
echo
|
||||||
|
echo " --noconfirm Do not ask for confirmation when resolving dependencies"
|
||||||
|
echo " --noprogressbar Do not show a progress bar when downloading files"
|
||||||
|
echo
|
||||||
|
echo "If -p is not specified, makepkg will look for ./PKGBUILD"
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,6 +263,10 @@ ARGLIST=$@
|
|||||||
|
|
||||||
while [ "$#" -ne "0" ]; do
|
while [ "$#" -ne "0" ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
# pacman
|
||||||
|
--noconfirm) PACMAN_OPTS="$PACMAN_OPTS --noconfirm" ;;
|
||||||
|
--noprogressbar) PACMAN_OPTS="$PACMAN_OPTS --noprogressbar" ;;
|
||||||
|
# makepkg
|
||||||
--clean) CLEANUP=1 ;;
|
--clean) CLEANUP=1 ;;
|
||||||
--cleancache) CLEANCACHE=1 ;;
|
--cleancache) CLEANCACHE=1 ;;
|
||||||
--syncdeps) DEP_BIN=1 ;;
|
--syncdeps) DEP_BIN=1 ;;
|
||||||
@ -378,7 +390,8 @@ fi
|
|||||||
if [ -f $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz -a "$FORCE" = "0" -a "$GENMD5" = "0" ]; then
|
if [ -f $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz -a "$FORCE" = "0" -a "$GENMD5" = "0" ]; then
|
||||||
if [ "$INSTALL" = "1" ]; then
|
if [ "$INSTALL" = "1" ]; then
|
||||||
warning "a package has already been built, installing existing package."
|
warning "a package has already been built, installing existing package."
|
||||||
pacman --upgrade $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
echo pacman $PACMAN_OPTS -U $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
||||||
|
pacman $PACMAN_OPTS -U $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
||||||
exit $?
|
exit $?
|
||||||
else
|
else
|
||||||
error "a package has already been built. (use -f to overwrite)"
|
error "a package has already been built. (use -f to overwrite)"
|
||||||
@ -680,6 +693,18 @@ if [ ! "`check_option NOSTRIP`" -a "$NOSTRIP" = "0" ]; then
|
|||||||
| grep -v "No such file" | grep -v "format not recognized"
|
| grep -v "No such file" | grep -v "format not recognized"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# remove libtool (.la) files
|
||||||
|
if [ "`check_option NOLIBTOOL`" ]; then
|
||||||
|
msg "Removing libtool .la files..."
|
||||||
|
find pkg -type f -name "*.la" -exec rm -f -- '{}' \;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# remove empty directories
|
||||||
|
if [ "`check_option NOEMPTYDIRS`" ]; then
|
||||||
|
msg "Removing empty directories..."
|
||||||
|
find pkg -mindepth 1 -type d -empty -exec rmdir {} \;
|
||||||
|
fi
|
||||||
|
|
||||||
# get some package meta info
|
# get some package meta info
|
||||||
builddate=`LC_ALL= ; LANG= ; date -u "+%a %b %e %H:%M:%S %Y"`
|
builddate=`LC_ALL= ; LANG= ; date -u "+%a %b %e %H:%M:%S %Y"`
|
||||||
if [ "$PACKAGER" != "" ]; then
|
if [ "$PACKAGER" != "" ]; then
|
||||||
@ -757,14 +782,14 @@ fi
|
|||||||
|
|
||||||
if [ "$RMDEPS" = "1" -a "`id -u`" = "0" -a "$INFAKEROOT" != "1" -a \( ! -z "$deplist" -o ! -z "$makedeplist" \) ]; then
|
if [ "$RMDEPS" = "1" -a "`id -u`" = "0" -a "$INFAKEROOT" != "1" -a \( ! -z "$deplist" -o ! -z "$makedeplist" \) ]; then
|
||||||
msg "Removing installed dependencies..."
|
msg "Removing installed dependencies..."
|
||||||
pacman -R $makedeplist $deplist
|
pacman $PACMAN_OPTS -R $makedeplist $deplist
|
||||||
elif [ "$RMDEPS" = "1" -a "$DEP_SUDO" = "1" ]; then
|
elif [ "$RMDEPS" = "1" -a "$DEP_SUDO" = "1" ]; then
|
||||||
msg "Removing installed dependencies..."
|
msg "Removing installed dependencies..."
|
||||||
if [ "$INFAKEROOT" = "1" ]; then
|
if [ "$INFAKEROOT" = "1" ]; then
|
||||||
FAKEROOTKEY2=$FAKEROOTKEY
|
FAKEROOTKEY2=$FAKEROOTKEY
|
||||||
unset FAKEROOTKEY
|
unset FAKEROOTKEY
|
||||||
fi
|
fi
|
||||||
sudo pacman -R $makedeplist $deplist
|
sudo pacman $PACMAN_OPTS -R $makedeplist $deplist
|
||||||
if [ "$INFAKEROOT" = "1" ]; then
|
if [ "$INFAKEROOT" = "1" ]; then
|
||||||
export FAKEROOTKEY=$FAKEROOTKEY2
|
export FAKEROOTKEY=$FAKEROOTKEY2
|
||||||
unset FAKEROOTKEY2
|
unset FAKEROOTKEY2
|
||||||
@ -774,16 +799,16 @@ fi
|
|||||||
msg "Finished making: $pkgname (`date`)"
|
msg "Finished making: $pkgname (`date`)"
|
||||||
|
|
||||||
if [ "$INSTALL" = "1" -a "`id -u`" = "0" -a "$INFAKEROOT" != "1" ]; then
|
if [ "$INSTALL" = "1" -a "`id -u`" = "0" -a "$INFAKEROOT" != "1" ]; then
|
||||||
msg "Running pacman --upgrade..."
|
msg "Installing package with pacman -U..."
|
||||||
pacman --upgrade $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
pacman $PACMAN_OPTS -U $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
||||||
exit $?
|
exit $?
|
||||||
elif [ "$INSTALL" = "1" -a "$DEP_SUDO" = "1" ]; then
|
elif [ "$INSTALL" = "1" -a "$DEP_SUDO" = "1" ]; then
|
||||||
msg "Running pacman --upgrade..."
|
msg "Installing package with pacman -U..."
|
||||||
if [ "$INFAKEROOT" = "1" ]; then
|
if [ "$INFAKEROOT" = "1" ]; then
|
||||||
FAKEROOTKEY2=$FAKEROOTKEY
|
FAKEROOTKEY2=$FAKEROOTKEY
|
||||||
unset FAKEROOTKEY
|
unset FAKEROOTKEY
|
||||||
fi
|
fi
|
||||||
sudo pacman --upgrade $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
sudo pacman $PACMAN_OPTS -U $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
||||||
if [ "$INFAKEROOT" = "1" ]; then
|
if [ "$INFAKEROOT" = "1" ]; then
|
||||||
export FAKEROOTKEY=$FAKEROOTKEY2
|
export FAKEROOTKEY=$FAKEROOTKEY2
|
||||||
unset FAKEROOTKEY2
|
unset FAKEROOTKEY2
|
||||||
|
@ -193,6 +193,13 @@ int main(int argc, char *argv[])
|
|||||||
cleanup(1);
|
cleanup(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(list_count(pm_targets) == 0 && !(config->op == PM_OP_QUERY || (config->op == PM_OP_SYNC
|
||||||
|
&& (config->op_s_sync || config->op_s_upgrade || config->op_s_clean || config->group
|
||||||
|
|| config->op_q_list)))) {
|
||||||
|
ERR(NL, "no targets specified (use -h for help)\n");
|
||||||
|
cleanup(1);
|
||||||
|
}
|
||||||
|
|
||||||
/* start the requested operation */
|
/* start the requested operation */
|
||||||
switch(config->op) {
|
switch(config->op) {
|
||||||
case PM_OP_ADD: ret = pacman_add(pm_targets); break;
|
case PM_OP_ADD: ret = pacman_add(pm_targets); break;
|
||||||
@ -205,9 +212,6 @@ int main(int argc, char *argv[])
|
|||||||
ERR(NL, "no operation specified (use -h for help)\n");
|
ERR(NL, "no operation specified (use -h for help)\n");
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
if(ret != 0 && config->op_d_vertest == 0) {
|
|
||||||
MSG(NL, "\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup(ret);
|
cleanup(ret);
|
||||||
/* not reached */
|
/* not reached */
|
||||||
@ -218,6 +222,10 @@ void cleanup(int signum)
|
|||||||
{
|
{
|
||||||
list_t *lp;
|
list_t *lp;
|
||||||
|
|
||||||
|
if(signum != 0 && config->op_d_vertest == 0) {
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
}
|
||||||
|
|
||||||
/* free alpm library resources */
|
/* free alpm library resources */
|
||||||
if(alpm_release() == -1) {
|
if(alpm_release() == -1) {
|
||||||
ERR(NL, "%s\n", alpm_strerror(pm_errno));
|
ERR(NL, "%s\n", alpm_strerror(pm_errno));
|
||||||
|
Loading…
Reference in New Issue
Block a user