Imported from pacman-2.7.1.tar.gz

This commit is contained in:
Judd Vinet 2003-12-21 01:34:32 +00:00
parent f54a888a1f
commit 68e24b947e
11 changed files with 226 additions and 168 deletions

View file

@ -1,5 +1,11 @@
VERSION DESCRIPTION VERSION DESCRIPTION
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
2.7.1 - Fixed a couple obscure segfaults
- LogFiles were logging incorrect dates - fixed
- Cleaned up md5sum output in makepkg -g
- Added (optional) colorized output messages to makepkg
- Renamed the "stable" repo to "release" in pacman.conf
- Renamed the "unofficial" repo to "extra" in pacman.conf
2.7 - Added build-time dependencies to makepkg (Jason Chu) 2.7 - Added build-time dependencies to makepkg (Jason Chu)
- Added md5sum integrity checking to packages in --sync - Added md5sum integrity checking to packages in --sync
mode (Aurelien Foret) mode (Aurelien Foret)

View file

@ -34,7 +34,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
PACVER = 2.7 PACVER = 2.7.1
TOPDIR = @srcdir@ TOPDIR = @srcdir@
SRCDIR = $(TOPDIR)/src/ SRCDIR = $(TOPDIR)/src/

View file

@ -1,4 +1,4 @@
.TH makepkg 8 "November 22, 2003" "makepkg #VERSION#" "" .TH makepkg 8 "December 20, 2003" "makepkg #VERSION#" ""
.SH NAME .SH NAME
makepkg \- package build utility makepkg \- package build utility
.SH SYNOPSIS .SH SYNOPSIS
@ -312,6 +312,9 @@ Output syntax and commandline options.
.B "\-i, \-\-install" .B "\-i, \-\-install"
Install/Upgrade the package after a successful build. Install/Upgrade the package after a successful build.
.TP .TP
.B "\-m, \-\-nocolor"
Disable color in output messages
.TP
.B "\-n, \-\-nostrip" .B "\-n, \-\-nostrip"
Do not strip binaries and libraries. Do not strip binaries and libraries.
.TP .TP

View file

@ -25,6 +25,9 @@ export CXXFLAGS="-march=i686 -O2 -pipe"
# Enable fakeroot for building packages as a non-root user # Enable fakeroot for building packages as a non-root user
export USE_FAKEROOT="y" export USE_FAKEROOT="y"
# Enable colorized output messages
export USE_COLOR="n"
# if you want your name to show up in the packages you build, set this. # if you want your name to show up in the packages you build, set this.
#export PACKAGER="John Doe <john@doe.com>" #export PACKAGER="John Doe <john@doe.com>"

View file

@ -13,7 +13,7 @@ NoUpgrade = etc/passwd etc/group etc/shadow
NoUpgrade = etc/fstab etc/raidtab NoUpgrade = etc/fstab etc/raidtab
NoUpgrade = etc/rc.conf etc/rc.local NoUpgrade = etc/rc.conf etc/rc.local
NoUpgrade = etc/lilo.conf boot/grub/menu.lst NoUpgrade = etc/lilo.conf boot/grub/menu.lst
#IgnorePkg = lilo gcc #IgnorePkg = lilo kernel
# #
# REPOSITORIES # REPOSITORIES
@ -21,48 +21,51 @@ NoUpgrade = etc/lilo.conf boot/grub/menu.lst
[current] [current]
Server = ftp://ftp.archlinux.org/current Server = ftp://ftp.archlinux.org/current
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/current Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/current
Server = ftp://ftp.webtrek.com/pub/mirrors/archlinux/current
Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/current Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/current
Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/current Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/current
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/current Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/current
Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/current Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/current
Server = ftp://ftp.kegep.tuc.gr/archlinux/current
Server = http://darkstar.ist.utl.pt/archlinux/current Server = http://darkstar.ist.utl.pt/archlinux/current
Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/current Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/current
Server = ftp://saule.mintis.lt/pub/linux/current Server = ftp://saule.mintis.lt/pub/linux/current
Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/current Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/current
Server = ftp://ftp.webtrek.com/pub/mirrors/archlinux/current
# The "unofficial" package set # Uncomment this block to access the EXTRA package set
# #
[unofficial] [extra]
Server = ftp://ftp.archlinux.org/unofficial Server = ftp://ftp.archlinux.org/extra
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/unofficial Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/extra
Server = ftp://ftp.webtrek.com/pub/mirrors/archlinux/unofficial Server = ftp://ftp.webtrek.com/pub/mirrors/archlinux/extra
Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/unofficial Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/extra
Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/unofficial Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/extra
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/unofficial Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/extra
Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/unofficial Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/extra
Server = http://darkstar.ist.utl.pt/archlinux/unofficial Server = ftp://ftp.kegep.tuc.gr/archlinux/extra
Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/unofficial Server = http://darkstar.ist.utl.pt/archlinux/extra
Server = ftp://saule.mintis.lt/pub/linux/unofficial Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/extra
Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/unofficial Server = ftp://saule.mintis.lt/pub/linux/extra
Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/extra
# If you use the 'stable' tree, you should disable the 'current' # If you use the RELEASE tree, you should disable the CURRENT
# tree to avoid conflicts # tree to avoid conflicts
# #
#[stable] #[release]
#Server = ftp://ftp.archlinux.org/stable #Server = ftp://ftp.archlinux.org/release
#Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/stable #Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/release
#Server = ftp://ftp.webtrek.com/pub/mirrors/archlinux/stable #Server = ftp://ftp.webtrek.com/pub/mirrors/archlinux/release
#Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/stable #Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/release
#Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/stable #Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/release
#Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/stable #Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/release
#Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/stable #Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/release
#Server = http://darkstar.ist.utl.pt/archlinux/stable #Server = ftp://ftp.kegep.tuc.gr/archlinux/release
#Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/stable #Server = http://darkstar.ist.utl.pt/archlinux/release
#Server = ftp://saule.mintis.lt/pub/linux/stable #Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/release
#Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/stable #Server = ftp://saule.mintis.lt/pub/linux/release
#Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/release
# Uncomment this block to access the 'unstable' package set # Uncomment this block to access the UNSTABLE package set
# #
#[unstable] #[unstable]
#Server = ftp://ftp.archlinux.org/unstable #Server = ftp://ftp.archlinux.org/unstable

View file

@ -411,14 +411,18 @@ GLOBALDEF int FtpConnect(const char *host, netbuf **nControl)
} }
else else
{ {
*pnum++ = '\0'; *pnum++ = '\0';
if (isdigit(*pnum)) if (isdigit(*pnum))
sin.sin_port = htons(atoi(pnum)); sin.sin_port = htons(atoi(pnum));
else else
{ {
pse = getservbyname(pnum,"tcp"); pse = getservbyname(pnum,"tcp");
sin.sin_port = pse->s_port; if(pse == NULL) {
} perror("getservbyname");
return 0;
}
sin.sin_port = pse->s_port;
}
} }
if ((sin.sin_addr.s_addr = inet_addr(lhost)) == -1) if ((sin.sin_addr.s_addr = inet_addr(lhost)) == -1)
{ {

View file

@ -20,7 +20,7 @@
# USA. # USA.
# #
myver='2.7' myver='2.7.1'
usage() { usage() {
echo "gensync $myver" echo "gensync $myver"

View file

@ -20,8 +20,9 @@
# USA. # USA.
# #
myver='2.7' myver='2.7.1'
startdir=`pwd` startdir=`pwd`
USE_COLOR="n"
# 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
@ -37,8 +38,33 @@ fi
### SUBROUTINES ### ### SUBROUTINES ###
plain() {
if [ "$USE_COLOR" = "Y" -o "$USE_COLOR" = "y" ]; then
echo -e " \033[1;1m$1\033[1;0m" >&2
else
echo " $1" >&2
fi
}
msg() { msg() {
echo "$1" >&2 if [ "$USE_COLOR" = "Y" -o "$USE_COLOR" = "y" ]; then
echo -e "\033[1;32m==>\033[1;0m \033[1;1m$1\033[1;0m" >&2
else
echo "==> $1" >&2
fi
}
warning() {
if [ "$USE_COLOR" = "Y" -o "$USE_COLOR" = "y" ]; then
echo -e "\033[1;33m==> WARNING:\033[1;0m \033[1;1m$1\033[1;0m" >&2
else
echo "==> WARNING: $1" >&2
fi
}
error() {
if [ "$USE_COLOR" = "Y" -o "$USE_COLOR" = "y" ]; then
echo -e "\033[1;31m==> ERROR:\033[1;0m \033[1;1m$1\033[1;0m" >&2
else
echo "==> ERROR: $1" >&2
fi
} }
strip_url() { strip_url() {
@ -53,7 +79,7 @@ checkdeps() {
ret=$? ret=$?
if [ "$ret" != "0" ]; then if [ "$ret" != "0" ]; then
if [ "$ret" = "127" ]; then if [ "$ret" = "127" ]; then
msg "==> Missing Dependencies:" msg "Missing Dependencies:"
msg "" msg ""
nl=0 nl=0
for dep in $missdep; do for dep in $missdep; do
@ -70,7 +96,7 @@ checkdeps() {
done done
msg "" msg ""
else else
msg "==> ERROR: pacman returned a fatal error." error "pacman returned a fatal error."
exit 1 exit 1
fi fi
fi fi
@ -88,10 +114,10 @@ handledeps() {
if [ "$deplist" != "" -a $haveperm -eq 1 ]; then if [ "$deplist" != "" -a $haveperm -eq 1 ]; then
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 -D $deplist
if [ "$?" = "127" ]; then if [ "$?" = "127" ]; then
msg "==> ERROR: Failed to install missing dependencies." error "Failed to install missing dependencies."
exit 1 exit 1
fi fi
# TODO: check deps again to make sure they were resolved # TODO: check deps again to make sure they were resolved
@ -99,15 +125,15 @@ handledeps() {
# install missing deps by building them from source. # install missing deps by building them from source.
# we look for each package name in $ABSROOT and build it. # we look for each package name in $ABSROOT and build it.
if [ "$ABSROOT" = "" ]; then if [ "$ABSROOT" = "" ]; then
msg "==> ERROR: The ABSROOT environment variable is not defined." error "The ABSROOT environment variable is not defined."
exit 1 exit 1
fi fi
# TODO: handle version comparators (eg, glibc>=2.2.5) # TODO: handle version comparators (eg, glibc>=2.2.5)
msg "==> Building missing dependencies..." msg "Building missing dependencies..."
for dep in $deplist; do for dep in $deplist; do
candidates=`find $ABSROOT -type d -name "$dep"` candidates=`find $ABSROOT -type d -name "$dep"`
if [ "$candidates" = "" ]; then if [ "$candidates" = "" ]; then
msg "==> ERROR: Could not find \"$dep\" under $ABSROOT" error "Could not find \"$dep\" under $ABSROOT"
exit 1 exit 1
fi fi
success=0 success=0
@ -126,7 +152,7 @@ handledeps() {
fi fi
done done
if [ "$success" = "0" ]; then if [ "$success" = "0" ]; then
msg "==> ERROR: Failed to build \"$dep\"" error "Failed to build \"$dep\""
exit 1 exit 1
fi fi
done done
@ -136,8 +162,8 @@ handledeps() {
fi fi
elif [ "$deplist" != "" -a $haveperm -eq 0 ]; then elif [ "$deplist" != "" -a $haveperm -eq 0 ]; then
if [ "$DEP_SRC" = "1" -o "$DEP_BIN" = "1" ]; then if [ "$DEP_SRC" = "1" -o "$DEP_BIN" = "1" ]; then
msg "==> WARNING: Cannot auto-install missing dependencies as a normal user!" warning "Cannot auto-install missing dependencies as a normal user!"
msg "==> Run makepkg as root to resolve dependencies automatically." plain "Run makepkg as root to resolve dependencies automatically."
fi fi
missingdeps=1 missingdeps=1
fi fi
@ -156,6 +182,7 @@ usage() {
echo " -g, --genmd5 Generate MD5sums for source files" echo " -g, --genmd5 Generate MD5sums for source files"
echo " -h, --help This help" echo " -h, --help This help"
echo " -i, --install Install package after successful build" echo " -i, --install Install package after successful build"
echo " -m, --nocolor Disable colorized output messages"
echo " -n, --nostrip Do not strip binaries/libraries" echo " -n, --nostrip Do not strip binaries/libraries"
echo " -p <buildscript> Use an alternate build script (instead of PKGBUILD)" echo " -p <buildscript> Use an alternate build script (instead of PKGBUILD)"
echo " -r, --rmdeps Remove installed dependencies after a successful build" echo " -r, --rmdeps Remove installed dependencies after a successful build"
@ -194,6 +221,7 @@ while [ "$#" -ne "0" ]; do
--install) INSTALL=1 ;; --install) INSTALL=1 ;;
--force) FORCE=1 ;; --force) FORCE=1 ;;
--nostrip) NOSTRIP=1 ;; --nostrip) NOSTRIP=1 ;;
--nocolor) USE_COLOR="n" ;;
--genmd5) GENMD5=1 ;; --genmd5) GENMD5=1 ;;
--rmdeps) RMDEPS=1 ;; --rmdeps) RMDEPS=1 ;;
--help) --help)
@ -205,7 +233,7 @@ while [ "$#" -ne "0" ]; do
exit 1 exit 1
;; ;;
-*) -*)
while getopts "cCsbdhifgnrp:w:-" opt; do while getopts "cCsbdhifgmnrp:w:-" opt; do
case $opt in case $opt in
c) CLEANUP=1 ;; c) CLEANUP=1 ;;
C) CLEANCACHE=1 ;; C) CLEANCACHE=1 ;;
@ -215,6 +243,7 @@ while [ "$#" -ne "0" ]; do
i) INSTALL=1 ;; i) INSTALL=1 ;;
g) GENMD5=1 ;; g) GENMD5=1 ;;
f) FORCE=1 ;; f) FORCE=1 ;;
m) USE_COLOR="n" ;;
n) NOSTRIP=1 ;; n) NOSTRIP=1 ;;
w) PKGDEST=$OPTARG ;; w) PKGDEST=$OPTARG ;;
p) BUILDSCRIPT=$OPTARG ;; p) BUILDSCRIPT=$OPTARG ;;
@ -248,11 +277,11 @@ cd -
if [ "$CLEANCACHE" = "1" ]; then if [ "$CLEANCACHE" = "1" ]; then
if [ "`id -u`" = "0" -a "$INFAKEROOT" != "1" ]; then if [ "`id -u`" = "0" -a "$INFAKEROOT" != "1" ]; then
msg "==> Cleaning up source files from the cache." msg "Cleaning up source files from the cache."
rm -rf /var/cache/pacman/src/* rm -rf /var/cache/pacman/src/*
exit 0 exit 0
else else
msg "==> You must be root to clean the cache." error "You must be root to clean the cache."
exit 1 exit 1
fi fi
fi fi
@ -262,7 +291,7 @@ unset replaces depends conflicts backup source install build makedepends
umask 0022 umask 0022
if [ ! -f $BUILDSCRIPT ]; then if [ ! -f $BUILDSCRIPT ]; then
msg "==> ERROR: $BUILDSCRIPT does not exist." error "$BUILDSCRIPT does not exist."
exit 1 exit 1
fi fi
@ -270,21 +299,21 @@ source $BUILDSCRIPT
# check for no-no's # check for no-no's
if [ `echo $pkgver | grep '-'` ]; then if [ `echo $pkgver | grep '-'` ]; then
msg "==> ERROR: pkgver is not allowed to contain hyphens." error "pkgver is not allowed to contain hyphens."
exit 1 exit 1
fi fi
if [ `echo $pkgrel | grep '-'` ]; then if [ `echo $pkgrel | grep '-'` ]; then
msg "==> ERROR: pkgrel is not allowed to contain hyphens." error "pkgrel is not allowed to contain hyphens."
exit 1 exit 1
fi 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
msg "==> 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 pacman --upgrade $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
exit $? exit $?
else else
msg "==> ERROR: a package has already been built. (use -f to overwrite)" error "a package has already been built. (use -f to overwrite)"
exit 1 exit 1
fi fi
fi fi
@ -294,86 +323,86 @@ fi
if [ "`id -u`" != "0" ]; then if [ "`id -u`" != "0" ]; then
if [ "$USE_FAKEROOT" = "y" -o "$USE_FAKEROOT" = "Y" ]; then if [ "$USE_FAKEROOT" = "y" -o "$USE_FAKEROOT" = "Y" ]; then
if [ `type -p fakeroot` ]; then if [ `type -p fakeroot` ]; then
msg "==> Entering fakeroot environment" msg "Entering fakeroot environment"
fakeroot -- $0 -F $ARGLIST fakeroot -- $0 -F $ARGLIST
exit $? exit $?
else else
msg "==> WARNING: Fakeroot is not installed. Building as an unprivileged user" warning "Fakeroot is not installed. Building as an unprivileged user"
msg "==> will result in non-root ownership of the packaged files." plain "will result in non-root ownership of the packaged files."
msg "==> Install the fakeroot package to correctly build as a non-root" plain "Install the fakeroot package to correctly build as a non-root"
msg "==> user." plain "user."
msg "" plain ""
sleep 1 sleep 1
fi fi
else else
msg "==> WARNING: Running makepkg as an unprivileged user will result in non-root" warning "Running makepkg as an unprivileged user will result in non-root"
msg "==> ownership of the packaged files. Try using the fakeroot" plain "ownership of the packaged files. Try using the fakeroot"
msg "==> environment. (USE_FAKEROOT=y in makepkg.conf)" plain "environment. (USE_FAKEROOT=y in makepkg.conf)"
msg "" plain ""
sleep 1 sleep 1
fi fi
fi fi
msg "==> Making package: $pkgname (`date`)" msg "Making package: $pkgname (`date`)"
unset deplist makedeplist unset deplist makedeplist
if [ `type -p pacman` -a "$NODEPS" = "0" ]; then if [ `type -p pacman` -a "$NODEPS" = "0" ]; then
msg "==> Checking Runtime Dependencies..." msg "Checking Runtime Dependencies..."
deplist=`checkdeps ${depends[@]}` deplist=`checkdeps ${depends[@]}`
handledeps $deplist handledeps $deplist
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
exit 1 exit 1
fi fi
msg "==> Checking Buildtime Dependencies..." msg "Checking Buildtime Dependencies..."
makedeplist=`checkdeps ${makedepends[@]}` makedeplist=`checkdeps ${makedepends[@]}`
handledeps $makedeplist handledeps $makedeplist
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
exit 1 exit 1
fi fi
elif [ "$NODEPS" = "1" ]; then elif [ "$NODEPS" = "1" ]; then
msg "==> WARNING: skipping dependency checks." warning "skipping dependency checks."
else else
msg "==> WARNING: pacman was not found in PATH. skipping dependency checks." warning "pacman was not found in PATH. skipping dependency checks."
fi fi
cd $startdir cd $startdir
# retrieve sources # retrieve sources
msg "==> Retrieving Sources..." msg "Retrieving Sources..."
mkdir -p src mkdir -p src
cd $startdir/src cd $startdir/src
for netfile in ${source[@]}; do for netfile in ${source[@]}; do
file=`strip_url $netfile` file=`strip_url $netfile`
if [ -f ../$file ]; then if [ -f ../$file ]; then
msg " |=> Found $file in build dir" msg " Found $file in build dir"
cp ../$file . cp ../$file .
elif [ -f /var/cache/pacman/src/$file ]; then elif [ -f /var/cache/pacman/src/$file ]; then
msg " |=> Using local copy of $file" msg " Using local copy of $file"
cp /var/cache/pacman/src/$file . cp /var/cache/pacman/src/$file .
else else
# check for a download utility # check for a download utility
if [ -z "$FTPAGENT" ]; then if [ -z "$FTPAGENT" ]; then
msg "==> ERROR: FTPAGENT is not configured. Check the /etc/makepkg.conf file." error "FTPAGENT is not configured. Check the /etc/makepkg.conf file."
msg "==> Aborting..." msg "Aborting..."
exit 1 exit 1
fi fi
ftpclient=`echo $FTPAGENT | awk {'print $1'}` ftpclient=`echo $FTPAGENT | awk {'print $1'}`
if [ ! -x $ftpclient ]; then if [ ! -x $ftpclient ]; then
msg "==> ERROR: ftpclient `basename $ftpclient` is not installed." error "ftpclient `basename $ftpclient` is not installed."
msg "==> Aborting..." msg "Aborting..."
exit 1 exit 1
fi fi
proto=`echo $netfile | sed 's|://.*||'` proto=`echo $netfile | sed 's|://.*||'`
if [ "$proto" != "ftp" -a "$proto" != "http" ]; then if [ "$proto" != "ftp" -a "$proto" != "http" ]; then
msg "==> ERROR: $netfile was not found in the build directory and is not a proper URL." error "$netfile was not found in the build directory and is not a proper URL."
msg "==> Aborting..." msg "Aborting..."
exit 1 exit 1
fi fi
msg " |=> Downloading $file" msg " Downloading $file"
$FTPAGENT $netfile 2>&1 $FTPAGENT $netfile 2>&1
if [ ! -f $file ]; then if [ ! -f $file ]; then
msg "==> ERROR: Failed to download $file" error "Failed to download $file"
msg "==> Aborting..." msg "Aborting..."
exit 1 exit 1
fi fi
if [ "`id -u`" = "0" -a "$INFAKEROOT" != "1" ]; then if [ "`id -u`" = "0" -a "$INFAKEROOT" != "1" ]; then
@ -387,15 +416,15 @@ done
if [ "$GENMD5" = "0" ]; then if [ "$GENMD5" = "0" ]; then
# MD5 validation # MD5 validation
if [ ${#md5sums[@]} -ne ${#source[@]} ]; then if [ ${#md5sums[@]} -ne ${#source[@]} ]; then
msg "==> WARNING: MD5sums are missing or incomplete. Cannot verify source integrity." warning "MD5sums are missing or incomplete. Cannot verify source integrity."
#sleep 1 #sleep 1
elif [ `type -p md5sum` ]; then elif [ `type -p md5sum` ]; then
msg "==> Validating source files with MD5sums" msg "Validating source files with MD5sums"
errors=0 errors=0
idx=0 idx=0
for netfile in ${source[@]}; do for netfile in ${source[@]}; do
file=`strip_url $netfile` file=`strip_url $netfile`
echo -n " |=> $file ... " >&2 echo -n " $file ... " >&2
echo "${md5sums[$idx]} $file" | md5sum -c - >/dev/null 2>&1 echo "${md5sums[$idx]} $file" | md5sum -c - >/dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "FAILED" >&2 echo "FAILED" >&2
@ -406,15 +435,15 @@ if [ "$GENMD5" = "0" ]; then
idx=$(($idx+1)) idx=$(($idx+1))
done done
if [ $errors -gt 0 ]; then if [ $errors -gt 0 ]; then
msg "==> ERROR: One or more files did not pass the validity check!" error "One or more files did not pass the validity check!"
exit 1 exit 1
fi fi
else else
msg "==> WARNING: The md5sum program is missing. Cannot verify source files!" warning "The md5sum program is missing. Cannot verify source files!"
sleep 1 sleep 1
fi fi
# extract sources # extract sources
msg "==> Extracting Sources..." msg "Extracting Sources..."
for netfile in ${source[@]}; do for netfile in ${source[@]}; do
file=`strip_url $netfile` file=`strip_url $netfile`
unset cmd unset cmd
@ -433,11 +462,11 @@ if [ "$GENMD5" = "0" ]; then
cmd="bunzip2 $file" ;; cmd="bunzip2 $file" ;;
esac esac
if [ "$cmd" != "" ]; then if [ "$cmd" != "" ]; then
msg " |=> $cmd" msg " $cmd"
$cmd $cmd
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
msg "==> ERROR: Failed to extract $file" error "Failed to extract $file"
msg "==> Aborting..." msg "Aborting..."
exit 1 exit 1
fi fi
fi fi
@ -445,12 +474,13 @@ if [ "$GENMD5" = "0" ]; then
else else
# generate md5 hashes # generate md5 hashes
if [ ! `type -p md5sum` ]; then if [ ! `type -p md5sum` ]; then
msg "==> ERROR: Cannot find the md5sum program." error "Cannot find the md5sum program."
exit 1 exit 1
fi fi
msg "==> Generating MD5sums for source files" msg "Generating MD5sums for source files"
msg "" plain ""
ct=0 ct=0
newline=0
numsrc=${#source[@]} numsrc=${#source[@]}
for netfile in ${source[@]}; do for netfile in ${source[@]}; do
file=`strip_url $netfile` file=`strip_url $netfile`
@ -458,17 +488,25 @@ else
if [ $ct -eq 0 ]; then if [ $ct -eq 0 ]; then
echo -n "md5sums=(" echo -n "md5sums=("
else else
echo -ne "\t" if [ $newline -eq 0 ]; then
echo -n " "
fi
fi fi
echo -n "'$sum'" echo -n "'$sum'"
ct=$(($ct+1)) ct=$(($ct+1))
if [ $ct -eq $numsrc ]; then if [ $ct -eq $numsrc ]; then
echo ')' echo ')'
else else
echo ' \' if [ $newline -eq 1 ]; then
echo '\'
newline=0
else
echo -n ' '
newline=1
fi
fi fi
done done
msg "" plain ""
exit 0 exit 0
fi fi
@ -480,16 +518,16 @@ fi
# check for existing pkg directory # check for existing pkg directory
if [ -d $startdir/pkg ]; then if [ -d $startdir/pkg ]; then
msg "==> Removing existing pkg directory..." msg "Removing existing pkg directory..."
rm -rf $startdir/pkg rm -rf $startdir/pkg
fi fi
mkdir -p $startdir/pkg mkdir -p $startdir/pkg
# build # build
msg "==> Starting build()..." msg "Starting build()..."
build 2>&1 build 2>&1
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
msg "==> Build Failed. Aborting..." error "Build Failed. Aborting..."
exit 2 exit 2
fi fi
@ -514,7 +552,7 @@ fi
# compress man pages # compress man pages
if [ -d pkg/usr/man ]; then if [ -d pkg/usr/man ]; then
msg "==> Compressing man pages..." msg "Compressing man pages..."
for i in `find pkg/usr/man -type f`; do for i in `find pkg/usr/man -type f`; do
ext=`echo $i | sed 's|.*\.||g'` ext=`echo $i | sed 's|.*\.||g'`
fn=`echo $i | sed 's|.*/||g'` fn=`echo $i | sed 's|.*/||g'`
@ -534,9 +572,9 @@ cd $startdir
# strip binaries # strip binaries
if [ "$NOSTRIP" = "0" ]; then if [ "$NOSTRIP" = "0" ]; then
msg "==> Stripping debugging symbols from libraries..." msg "Stripping debugging symbols from libraries..."
find pkg/{,usr,usr/local,opt/*}/lib -type f -exec /usr/bin/strip --strip-debug '{}' \; 2>&1 find pkg/{,usr,usr/local,opt/*}/lib -type f -exec /usr/bin/strip --strip-debug '{}' \; 2>&1
msg "==> Stripping symbols from binaries..." msg "Stripping symbols from binaries..."
find pkg/{,usr,usr/local,opt/*}/{bin,sbin} -type f -exec /usr/bin/strip '{}' \; 2>&1 find pkg/{,usr,usr/local,opt/*}/{bin,sbin} -type f -exec /usr/bin/strip '{}' \; 2>&1
fi fi
@ -550,7 +588,7 @@ fi
size=`du -cb $startdir/pkg | tail -1 | awk '{print $1}'` size=`du -cb $startdir/pkg | tail -1 | awk '{print $1}'`
# write the .PKGINFO file # write the .PKGINFO file
msg "==> Generating .PKGINFO file..." msg "Generating .PKGINFO file..."
cd $startdir/pkg cd $startdir/pkg
echo "# Generated by makepkg $myver" >.PKGINFO echo "# Generated by makepkg $myver" >.PKGINFO
echo -n "# " >>.PKGINFO echo -n "# " >>.PKGINFO
@ -584,17 +622,17 @@ done
# check for an install script # check for an install script
if [ "$install" != "" ]; then if [ "$install" != "" ]; then
msg "==> Copying install script..." msg "Copying install script..."
cp $startdir/$install $startdir/pkg/.INSTALL cp $startdir/$install $startdir/pkg/.INSTALL
fi fi
# build a filelist # build a filelist
msg "==> Generating .FILELIST file..." msg "Generating .FILELIST file..."
cd $startdir/pkg cd $startdir/pkg
tar cvf /dev/null * | sort >.FILELIST tar cvf /dev/null * | sort >.FILELIST
# tar it up # tar it up
msg "==> Compressing package..." msg "Compressing package..."
cd $startdir/pkg cd $startdir/pkg
if [ -f $startdir/pkg/.INSTALL ]; then if [ -f $startdir/pkg/.INSTALL ]; then
cmd="tar czvf $PKGDEST/$pkgname-$pkgver-$pkgrel.pkg.tar.gz .PKGINFO .FILELIST .INSTALL *" cmd="tar czvf $PKGDEST/$pkgname-$pkgver-$pkgrel.pkg.tar.gz .PKGINFO .FILELIST .INSTALL *"
@ -605,19 +643,19 @@ $cmd | sort >../filelist
cd $startdir cd $startdir
if [ "$CLEANUP" = "1" ]; then if [ "$CLEANUP" = "1" ]; then
msg "==> Cleaning up..." msg "Cleaning up..."
rm -rf src pkg filelist rm -rf src pkg filelist
fi fi
if [ "$RMDEPS" = "1" -a "`id -u`" = "0" -a "$INFAKEROOT" != "1" ]; then if [ "$RMDEPS" = "1" -a "`id -u`" = "0" -a "$INFAKEROOT" != "1" ]; then
msg "==> Removing installed dependencies..." msg "Removing installed dependencies..."
pacman -R $makedeplist $deplist pacman -R $makedeplist $deplist
fi 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 "Running pacman --upgrade..."
pacman --upgrade $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz pacman --upgrade $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
exit $? exit $?
fi fi

View file

@ -21,7 +21,7 @@
# #
toplevel=`pwd` toplevel=`pwd`
version="2.7" version="2.7.1"
usage() { usage() {
echo "makeworld version $version" echo "makeworld version $version"
@ -117,7 +117,7 @@ for category in $*; do
. PKGBUILD . PKGBUILD
buildstatus=0 buildstatus=0
if [ ! -f $dest/$pkgname-$pkgver-$pkgrel.pkg.tar.gz ]; then if [ ! -f $dest/$pkgname-$pkgver-$pkgrel.pkg.tar.gz ]; then
makepkg $MAKEPKG_OPTS -w $dest 2>>$toplevel/makepkg.log makepkg $MAKEPKG_OPTS -m -w $dest 2>>$toplevel/makepkg.log
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
buildstatus=2 buildstatus=2
else else

View file

@ -941,56 +941,57 @@ int pacman_sync(pacdb_t *db, PMList *targets)
/* double-check */ /* double-check */
FREELIST(files); FREELIST(files);
/* Check integrity of files */
printf("checking package integrity... ");
fflush(stdout);
for(i = final; i; i = i->next) {
syncpkg_t *sync;
char str[PATH_MAX], pkgname[PATH_MAX];
char *md5sum1, *md5sum2;
sync = (syncpkg_t*)i->data;
snprintf(pkgname, PATH_MAX, "%s-%s.pkg.tar.gz", sync->pkg->name, sync->pkg->version);
md5sum1 = sync->pkg->md5sum;
if(md5sum1 == NULL || md5sum1[0] == '\0') {
if(allgood) {
printf("\n");
}
fprintf(stderr, "error: can't get md5 checksum for package %s\n", pkgname);
allgood = 0;
continue;
}
snprintf(str, PATH_MAX, "%s/%s", ldir, pkgname);
md5sum2 = MDFile(str);
if(md5sum2 == NULL || md5sum2[0] == '\0') {
if(allgood) {
printf("\n");
}
fprintf(stderr, "error: can't get md5 checksum for archive %s\n", pkgname);
FREE(md5sum1);
allgood = 0;
continue;
}
if(strcmp(md5sum1, md5sum2) != 0) {
if(allgood) {
printf("\n");
}
fprintf(stderr, "error: archive %s is corrupted\n", pkgname);
allgood = 0;
}
FREE(md5sum2);
}
if(allgood) { if(allgood) {
printf("done.\n"); /* Check integrity of files */
} else { printf("checking package integrity... ");
fprintf(stderr, "\n"); fflush(stdout);
for(i = final; i; i = i->next) {
syncpkg_t *sync;
char str[PATH_MAX], pkgname[PATH_MAX];
char *md5sum1, *md5sum2;
sync = (syncpkg_t*)i->data;
snprintf(pkgname, PATH_MAX, "%s-%s.pkg.tar.gz", sync->pkg->name, sync->pkg->version);
md5sum1 = sync->pkg->md5sum;
if(md5sum1 == NULL || md5sum1[0] == '\0') {
if(allgood) {
printf("\n");
}
fprintf(stderr, "error: can't get md5 checksum for package %s\n", pkgname);
allgood = 0;
continue;
}
snprintf(str, PATH_MAX, "%s/%s", ldir, pkgname);
md5sum2 = MDFile(str);
if(md5sum2 == NULL || md5sum2[0] == '\0') {
if(allgood) {
printf("\n");
}
fprintf(stderr, "error: can't get md5 checksum for archive %s\n", pkgname);
allgood = 0;
continue;
}
if(strcmp(md5sum1, md5sum2) != 0) {
if(allgood) {
printf("\n");
}
fprintf(stderr, "error: archive %s is corrupted\n", pkgname);
allgood = 0;
}
FREE(md5sum2);
}
if(allgood) {
printf("done.\n");
} else {
fprintf(stderr, "\n");
}
} }
if(!pmo_s_downloadonly) { if(!pmo_s_downloadonly && allgood) {
/* remove any conflicting packages (WITH dep checks) */ /* remove any conflicting packages (WITH dep checks) */
if(rmtargs) { if(rmtargs) {
int retcode; int retcode;
@ -1067,7 +1068,7 @@ int pacman_sync(pacdb_t *db, PMList *targets)
} }
} }
if(!varcache && !pmo_s_downloadonly) { if(!varcache && !pmo_s_downloadonly && allgood) {
/* delete packages */ /* delete packages */
for(i = files; i; i = i->next) { for(i = files; i; i = i->next) {
unlink(i->data); unlink(i->data);
@ -3029,7 +3030,7 @@ void logaction(FILE *fp, char *fmt, ...)
t = time(NULL); t = time(NULL);
tm = localtime(&t); tm = localtime(&t);
fprintf(logfd, "[%02d/%02d/%02d %02d:%02d] %s\n", tm->tm_mon, tm->tm_mday, fprintf(logfd, "[%02d/%02d/%02d %02d:%02d] %s\n", tm->tm_mon+1, tm->tm_mday,
tm->tm_year-100, tm->tm_hour, tm->tm_min, msg); tm->tm_year-100, tm->tm_hour, tm->tm_min, msg);
} }
} }

View file

@ -22,7 +22,7 @@
#define _PAC_PACMAN_H #define _PAC_PACMAN_H
#ifndef PACVER #ifndef PACVER
#define PACVER "2.7" #define PACVER "2.7.1"
#endif #endif
#ifndef PKGDIR #ifndef PKGDIR