xbps-src: improve msg_* funcs and update all callers.

This commit is contained in:
Juan RP 2010-12-20 00:22:12 +01:00
parent 24c7ac6808
commit 3da3783333
27 changed files with 184 additions and 173 deletions

View file

@ -46,13 +46,13 @@ pre_configure()
cd ${XBPS_SRCDISTDIR} || return 1
for p in $(seq -w 001 ${_bash_patchlevel}); do
[ -f ${XBPS_SRCDISTDIR}/bash41-${p} ] && continue
msg_normal " Fetching ${url}/bash41-$p ..."
msg_normal " Fetching ${url}/bash41-$p ...\n"
$XBPS_FETCH_CMD ${url}/bash41-$p
done
fi
cd ${wrksrc}
for p in $(seq -w 001 ${_bash_patchlevel}); do
patch -s -Np0 -i ${XBPS_SRCDISTDIR}/bash41-${p} && \
msg_normal "Applying patch bash41-$p."
msg_normal " Applying patch bash41-$p.\n"
done
}

View file

@ -20,7 +20,7 @@ Add_dependency full ccsm
do_fetch()
{
msg_normal "Fetching source from master GIT repository..."
msg_normal " Fetching source from master GIT repository...\n"
git clone git://anongit.opencompositing.org/users/crdlb/fusion-icon \
${pkgname}-${version} || return 1
}

View file

@ -42,7 +42,7 @@ do_build()
# Configure
if [ -f ${FILESDIR}/$arch-dotconfig ]; then
msg_normal "Detected a .config file for your arch, using it."
msg_normal " Detected a .config file for your arch, using it.\n"
cp -f ${FILESDIR}/$arch-dotconfig ${wrksrc}/.config
make ${makejobs} oldconfig
else

View file

@ -35,13 +35,14 @@ pre_configure()
for p in $(seq -w 001 ${_patch_ver}); do
cd ${XBPS_SRCDISTDIR} || return 1
[ -f ${XBPS_SRCDISTDIR}/readline61-${p} ] && continue
msg_normal " Fetching $url/readline61-$p ...\n"
$XBPS_FETCH_CMD ${url}/readline61-$p
done
fi
cd ${wrksrc}
for p in $(seq -w 001 ${_patch_ver}); do
patch -s -Np0 -i ${XBPS_SRCDISTDIR}/readline61-${p} && \
msg_normal "Applying patch readline61-$p."
msg_normal " Applying patch readline61-$p.\n"
done
sed -i 's|-Wl,-rpath,$(libdir) ||g' support/shobj-conf
}

View file

@ -35,13 +35,13 @@ pre_configure()
cd ${XBPS_SRCDISTDIR} || return 1
for p in $(seq -w 001 ${_patchver}); do
[ -f ${XBPS_SRCDISTDIR}/${_distver}.${p} ] && continue
msg_normal " Fetching ${url}/${_distver}-$p patch..."
msg_normal " Fetching ${url}/${_distver}-$p patch...\n"
$XBPS_FETCH_CMD ${url}/${_distver}.$p 2>&1
done
fi
cd ${wrksrc}
for p in $(seq -w 001 ${_patchver}); do
patch -s -Np0 -i ${XBPS_SRCDISTDIR}/${_distver}.${p} && \
msg_normal "Applied patch ${_distver}.$p."
msg_normal " Applied patch ${_distver}.$p.\n"
done
}

View file

@ -27,7 +27,7 @@ Add_dependency build openssl-devel
do_fetch()
{
msg_normal "Fetching source from http://xbps.googlecode.com/hg..."
hg clone http://xbps.googlecode.com/hg \
${pkgname}-${version} 2>/dev/null || return 1
local url="http://xbps.googlecode.com/hg"
msg_normal " Fetching source from $url ...\n"
hg clone $url ${pkgname}-${version} 2>/dev/null
}

View file

@ -27,9 +27,9 @@ Add_dependency full xorg-server
do_fetch()
{
msg_normal "Fetching from master git repository..."
msg_normal " Fetching from master git repository...\n"
git clone git://anongit.freedesktop.org/xorg/driver/xf86-video-ati \
${pkgname}-${version} || return 1
${pkgname}-${version}
}
pre_configure()

View file

@ -39,8 +39,8 @@ replace_interpreter()
if [ -f $file ]; then
sed -i -e "1s|^#![[:space:]]*${orsb}|#!${trpath}|" $file && \
msg_normal "Transformed $lang script: ${file##$wrksrc}."
msg_normal "Transformed $lang script: ${file##$wrksrc}.\n"
else
msg_warn "Ignoring unexistent $lang script: ${file##$wrksrc}."
msg_warn "Ignoring unexistent $lang script: ${file##$wrksrc}.\n"
fi
}

View file

@ -61,23 +61,21 @@ install_src_phase()
return 0
fi
cd $wrksrc || msg_error "can't change cwd to wrksrc!"
cd $wrksrc || msg_error "can't change cwd to wrksrc!\n"
if [ -n "$build_wrksrc" ]; then
cd $build_wrksrc \
|| msg_error "can't change cwd to build_wrksrc!"
|| msg_error "can't change cwd to build_wrksrc!\n"
fi
# Run pre_install func.
if [ ! -f $XBPS_PRE_INSTALL_DONE ]; then
run_func pre_install
if [ $? -eq 0 ]; then
msg_normal "Package '$pkgname': pre_install (destdir) phase done."
msg_normal "'$pkgname-$lver': pre_install (destdir) phase done.\n"
touch -f $XBPS_PRE_INSTALL_DONE
fi
fi
msg_normal "Package '$pkgname ($lver)': running install (destdir) phase."
# Type of installation: custom, make or python.
case "$build_style" in
custom-install) run_func do_install;;
@ -87,22 +85,22 @@ install_src_phase()
;;
*) run_func make_install;;
esac
cd ${wrksrc} || msg_error "can't change cwd to wrksrc!"
cd ${wrksrc} || msg_error "can't change cwd to wrksrc!\n"
msg_normal "Package '$pkgname ($lver)': install (destdir) phase done."
msg_normal "'$pkgname-$lver': install (destdir) phase done.\n"
# Run post_install func.
if [ ! -f $XBPS_POST_INSTALL_DONE ]; then
run_func post_install
if [ $? -eq 0 ]; then
msg_normal "Package '$pkgname': post_install (destdir) phase done."
msg_normal "'$pkgname-$lver': post_install (destdir) phase done.\n"
touch -f $XBPS_POST_INSTALL_DONE
fi
fi
# Remove libtool archives by default.
if [ -z "$keep_libtool_archives" ]; then
msg_normal "Package '$pkgname ($lver)': removing libtool archives..."
msg_normal "'$pkgname-$lver': removing libtool archives...\n"
find ${DESTDIR} -type f -name \*.la -delete
fi
# Always remove perllocal.pod and .packlist files.
@ -112,10 +110,10 @@ install_src_phase()
fi
# Remove empty directories by default.
if [ -z "$keep_empty_dirs" ]; then
msg_normal "Package '$pkgname ($lver)': removing empty dirs..."
msg_normal "'$pkgname-$lver': removing empty dirs...\n"
find ${DESTDIR} -depth -type d -exec rmdir 2>/dev/null {} \;
fi
msg_normal "Package '$pkgname ($lver)': installed into destdir."
msg_normal "'$pkgname-$lver': installed into destdir.\n"
if [ "$build_style" != "custom-install" -a -z "$distfiles" ]; then
touch -f $XBPS_INSTALL_DONE
@ -133,9 +131,9 @@ install_src_phase()
check_installed_pkg ${spkgrev}
[ $? -eq 0 ] && continue
msg_normal "Package '${sourcepkg} ($lver)': preparing subpackage '${subpkg}'."
msg_normal "'${sourcepkg}-$lver': preparing subpackage '${subpkg}'...\n"
if [ ! -f $XBPS_SRCPKGDIR/${sourcepkg}/${subpkg}.template ]; then
msg_error "Cannot find '${subpkg}' subpkg build template!"
msg_error "Cannot find '${subpkg}' subpkg build template!\n"
fi
. $XBPS_SRCPKGDIR/${sourcepkg}/${subpkg}.template
pkgname=${subpkg}
@ -146,7 +144,7 @@ install_src_phase()
touch -f ${wrksrc}/.xbps_do_install_${pkgname}_done
fi
else
msg_normal "Package '$sourcepkg ($lver)': skipping '$pkgname' subpkg, already installed into destdir."
msg_warn "'$sourcepkg-$lver': skipping '$pkgname' subpkg, already installed into destdir.\n"
fi
done
}

View file

@ -54,7 +54,7 @@ build_src_phase()
[ "$build_style" = "meta-template" -o \
"$build_style" = "only-install" ] && return 0
[ ! -d $wrksrc ] && msg_error "unexistent build directory [$wrksrc]"
[ ! -d $wrksrc ] && msg_error "unexistent build directory [$wrksrc]\n"
cd $wrksrc || return 1
if [ -n "$build_wrksrc" ]; then
@ -80,13 +80,11 @@ build_src_phase()
if [ ! -f $XBPS_PRE_BUILD_DONE ]; then
run_func pre_build
if [ $? -eq 0 ]; then
msg_normal "$pkgname: pre_build phase done."
msg_normal "'$pkgname-$lver': pre_build phase done.\n"
touch -f $XBPS_PRE_BUILD_DONE
fi
fi
msg_normal "Package '$pkgname ($lver)': running build phase."
if [ "$build_style" = "custom-install" ]; then
[ -n "$XBPS_LDFLAGS" ] && export LDFLAGS="$XBPS_LDFLAGS"
run_func do_build
@ -94,13 +92,13 @@ build_src_phase()
run_func do_make_build
fi
msg_normal "Package '$pkgname ($lver)': build phase done."
msg_normal "'$pkgname-$lver': build phase done.\n"
# Run post_build func.
if [ ! -f $XBPS_POST_BUILD_DONE ]; then
run_func post_build
if [ $? -eq 0 ]; then
msg_normal "Package '$pkgname': post_build phase done."
msg_normal "'$pkgname-l$ver': post_build phase done.\n"
touch -f $XBPS_POST_BUILD_DONE
fi
fi

View file

@ -44,15 +44,15 @@ install_pkg_deps()
fi
if [ -z "$saved_prevpkg" -a -n "${_ORIGINPKG}" ]; then
msg_normal "Installing '${_ORIGINPKG}' dependency: '$curpkg'."
msg_normal "Installing '${_ORIGINPKG}' dependency: '$curpkg'.\n"
else
msg_normal "Installing '$saved_prevpkg' dependency: '$curpkg'."
msg_normal "Installing '$saved_prevpkg' dependency: '$curpkg'.\n"
fi
setup_tmpl "$curpkgname"
check_build_depends_pkg
if [ $? -eq 0 ]; then
msg_normal "Package dependency '$curpkgname' requires:"
msg_normal "Package dependency '$curpkgname' requires:\n"
for j in ${build_depends}; do
jname="$(${XBPS_PKGDB_CMD} getpkgdepname ${j})"
jver="$($XBPS_PKGDB_CMD version ${jname})"
@ -79,7 +79,7 @@ install_pkg_deps()
prev_pkg="$j"
install_pkg_deps "${j}" "${curpkg}"
if [ $? -eq 1 ]; then
msg_red "install_pkg_deps: cannot install '$curpkg' ($j)."
msg_red "install_pkg_deps: cannot install '$curpkg' ($j).\n"
return 1
fi
done
@ -93,19 +93,19 @@ install_pkg_deps()
# Package not found, build from source.
install_pkg "${curpkgname}"
if [ $? -eq 1 ]; then
msg_red "cannot install '$curpkgname'!"
msg_red "cannot install '$curpkgname'!\n"
return 1
fi
fi
else
if [ -n "$saved_prevpkg" ]; then
msg_normal "Installing package '${curpkgname}' required by '${saved_prevpkg}'."
msg_normal "Installing package '${curpkgname}' required by '${saved_prevpkg}'.\n"
else
msg_normal "Installing package: '${curpkg}'."
msg_normal "Installing package: '${curpkg}'.\n"
fi
install_pkg "${curpkgname}"
if [ $? -eq 1 ]; then
msg_red "install_pkg_deps: cannot install '$curpkgname'!"
msg_red "install_pkg_deps: cannot install '$curpkgname'!\n"
return 1
fi
fi
@ -132,7 +132,7 @@ install_dependencies_pkg()
fi
if [ -n "$build_depends" ]; then
msg_normal "$pkgname: installing required package dependencies..."
msg_normal "'$pkgname-$lver': required package build dependencies...\n"
fi
for i in ${build_depends}; do
pkgn="$($XBPS_PKGDB_CMD getpkgdepname ${i})"
@ -140,7 +140,6 @@ install_dependencies_pkg()
check_pkgdep_matched "${i}"
if [ $? -eq 0 ]; then
echo " ${i}: found '$pkgn-$iver'."
continue
else
echo " ${i}: not found."
notinstalled_deps="$notinstalled_deps $i"
@ -153,7 +152,7 @@ install_dependencies_pkg()
for i in ${notinstalled_deps}; do
pkgdeplist="${pkgdeplist} \"${i}\" "
done
msg_normal "$pkgname: installing required dependencies from binpkgs..."
msg_normal "$pkgname-$lver: installing build dependencies from binpkgs...\n"
${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} \
-y install ${pkgdeplist}
rval=$?
@ -186,7 +185,7 @@ install_dependencies_pkg()
setup_tmpl "$pkgn"
check_build_depends_pkg
if [ $? -eq 1 ]; then
msg_normal "Installing '$lpkgname' dependency: '$pkgn'."
msg_normal "Installing '$lpkgname' dependency: '$pkgn'.\n"
if [ -n "$XBPS_PREFER_BINPKG_DEPS" ]; then
install_pkg_with_binpkg "${j}"
rval=$?
@ -200,21 +199,21 @@ install_dependencies_pkg()
# package not found, build source.
install_pkg "${pkgn}"
if [ $? -eq 1 ]; then
msg_red "cannot install '$pkgn'!"
msg_red "cannot install '$pkgn'!\n"
return 1
fi
fi
else
install_pkg "${pkgn}"
if [ $? -eq 1 ]; then
msg_red "cannot install '$pkgn'!"
msg_red "cannot install '$pkgn'!\n"
return 1
fi
fi
else
install_pkg_deps "${j}" "${pkg}"
if [ $? -eq 1 ]; then
msg_red "install_dependencies_pkg: cannot install pkgdeps required by $pkg ($j)."
msg_red "cannot install pkgdeps required by $pkg ($j).\n"
return 1
fi
fi

View file

@ -29,13 +29,13 @@ check_installed_packages()
{
local f lpkgn lpkgver rv srcpkgver
msg_normal "Checking for newer packages from srcpkgs, please wait..."
msg_normal "Checking for newer packages from srcpkgs, please wait...\n"
for f in $(${XBPS_BIN_CMD} list|awk '{print $1}'); do
lpkgn=$(${XBPS_PKGDB_CMD} getpkgname ${f})
lpkgver=$(${XBPS_PKGDB_CMD} getpkgversion ${f})
if [ ! -r ${XBPS_SRCPKGDIR}/${lpkgn}/template ]; then
msg_warn "Installed package ${f} not available as source pkg, skipping."
msg_warn "Installed package ${f} not available as source pkg, skipping.\n"
continue
fi
. ${XBPS_SRCPKGDIR}/${lpkgn}/template
@ -59,5 +59,5 @@ check_installed_packages()
fi
reset_tmpl_vars
done
msg_normal "done."
msg_normal "done.\n"
}

View file

@ -47,7 +47,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
msg_normal "Entering into the chroot on $XBPS_MASTERDIR."
msg_normal "Entering into the chroot on $XBPS_MASTERDIR.\n"
if [ ! -d $XBPS_MASTERDIR/usr/local/etc ]; then
mkdir -p $XBPS_MASTERDIR/usr/local/etc
@ -77,7 +77,7 @@ if [ -n "$XBPS_COMPRESS_LEVEL" ]; then
fi
echo "# End of configuration file." >> $XBPSSRC_CF
msg_normal "Cleaning up /tmp..."
msg_normal "Cleaning up /tmp...\n"
if [ -d $XBPS_MASTERDIR/tmp ]; then
rm -rf $XBPS_MASTERDIR/tmp/*
fi
@ -166,7 +166,7 @@ prepare_binpkg_repos()
if [ ! -f ${XBPS_PACKAGESDIR}/${xbps_machine}/pkg-index.plist ]; then
:
else
msg_normal "Registering local repository..."
msg_normal "Registering local repository...\n"
${chroot_cmd} $XBPS_MASTERDIR \
${XBPS_REPO_CMD} add /xbps_packagesdir 2>/dev/null
[ $? -eq 0 ] && touch -f \
@ -176,7 +176,7 @@ prepare_binpkg_repos()
for repo in ${XBPS_REPO_LIST}; do
${chroot_cmd} ${XBPS_MASTERDIR} ${XBPS_REPO_CMD} \
add ${repo} 2>/dev/null
[ $? -ne 0 ] && msg_warn "Failed to sync pkg-index from ${repo}"
[ $? -ne 0 ] && msg_warn "Failed to sync pkg-index from ${repo}\n"
done
}
@ -268,7 +268,7 @@ xbps_chroot_handler()
fi
# Reinstall xbps-src in the chroot
msg_normal "Installing xbps-src in the masterdir..."
msg_normal "Installing xbps-src in the masterdir...\n"
env in_chroot=yes LANG=C PATH=$path \
${chroot_cmd} $XBPS_MASTERDIR sh -c \
"cd /xbps/xbps-src && make IN_CHROOT=1 install clean" \
@ -290,7 +290,7 @@ xbps_chroot_handler()
fi
rm -f ${XBPS_MASTERDIR}/.xbps_chroot_working
msg_normal "Exiting from the chroot on $XBPS_MASTERDIR."
msg_normal "Exiting from the chroot on $XBPS_MASTERDIR.\n"
return $rv
}

View file

@ -28,20 +28,32 @@
#
run_func_error()
{
local func="$1"
local lver func="$1"
remove_pkgdestdir_sighandler ${pkgname}
msg_error "${pkgname}-${version}: the $func function didn't complete due to errors or SIGINT!"
if [ -n "${revision}" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
msg_error "'${pkgname}-${lver}': '$func' phase didn't complete due to errors or SIGINT!\n"
}
remove_pkgdestdir_sighandler()
{
local subpkg _pkgname="$1"
local lver subpkg _pkgname="$1"
setup_tmpl ${_pkgname}
[ -z "$sourcepkg" ] && return 0
if [ -n "${revision}" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
# If there is any problem in the middle of writting the metadata,
# just remove all files from destdir of pkg.
@ -57,7 +69,7 @@ remove_pkgdestdir_sighandler()
if [ -d "$XBPS_DESTDIR/${sourcepkg}-${version%_*}" ]; then
rm -rf "$XBPS_DESTDIR/${sourcepkg}-${version%_*}"
fi
msg_red "Removed '${sourcepkg}-${version}' files from DESTDIR..."
msg_red "'${sourcepkg}-${lver}': removed files from DESTDIR...\n"
}
var_is_a_function()
@ -79,10 +91,16 @@ var_is_a_function()
run_func()
{
local func="$1"
local rval logpipe logfile
local lver rval logpipe logfile
[ -z "$func" ] && return 1
if [ -n "$revision" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
var_is_a_function $func
if [ $? -eq 1 ]; then
logpipe=/tmp/logpipe.$$
@ -97,6 +115,7 @@ run_func()
exec 1>"$logpipe" 2>"$logpipe"
set -e
trap "run_func_error $func" 0
msg_normal "'$pkgname-$lver': running $func phase...\n"
$func 2>&1
set +e
trap '' 0
@ -109,14 +128,12 @@ run_func()
msg_red()
{
[ -z "$1" ] && return 1
# error messages in bold/red
printf "\033[1m\033[31m"
if [ -n "$in_chroot" ]; then
echo "[chroot] => ERROR: $1"
printf "[chroot] => ERROR: $@"
else
echo "=> ERROR: $1"
printf "=> ERROR: $@"
fi
printf "\033[m"
}
@ -129,10 +146,8 @@ msg_error()
msg_error_nochroot()
{
[ -z "$1" ] && return 1
printf "\033[1m\033[31m"
echo "=> ERROR: $1"
printf "=> ERROR: $@"
printf "\033[m"
exit 1
@ -140,37 +155,36 @@ msg_error_nochroot()
msg_warn()
{
[ -z "$1" ] && return 1
# warn messages in bold/yellow
printf "\033[1m\033[33m"
if [ -n "$in_chroot" ]; then
echo "[chroot] => WARNING: $1"
printf "[chroot] => WARNING: $@"
else
echo "=> WARNING: $1"
printf "=> WARNING: $@"
fi
printf "\033[m"
}
msg_warn_nochroot()
{
[ -z "$1" ] && return 1
printf "\033[1m\033[33m"
echo "=> WARNING: $1"
printf "=> WARNING: $@"
printf "\033[m"
}
msg_normal()
{
[ -z "$1" ] && return 1
# normal messages in bold
printf "\033[1m"
if [ -n "$in_chroot" ]; then
echo "[chroot] => $1"
printf "[chroot] => $@"
else
echo "=> $1"
printf "=> $@"
fi
printf "\033[m"
}
msg_normal_append()
{
printf "\033[1m$@\033[m"
}

View file

@ -86,13 +86,13 @@ configure_src_phase()
lver="${version}"
fi
cd $wrksrc || msg_error "unexistent build directory [$wrksrc]."
cd $wrksrc || msg_error "unexistent build directory [$wrksrc].\n"
# Run pre_configure func.
if [ ! -f $XBPS_PRECONFIGURE_DONE ]; then
run_func pre_configure
if [ $? -eq 0 ]; then
msg_normal "Package '$pkgname': pre_configure phase done."
msg_normal "'$pkgname-$lver': pre_configure phase done.\n"
touch -f $XBPS_PRECONFIGURE_DONE
fi
fi
@ -102,8 +102,6 @@ configure_src_phase()
export "$f"
done
msg_normal "Package '$pkgname ($lver)': running configure phase."
[ -z "$configure_script" ] && configure_script="./configure"
cd $wrksrc || return 1
@ -123,17 +121,17 @@ configure_src_phase()
#
# Unknown build_style type won't work :-)
#
msg_error "package '$pkgname': unknown build_style [$build_style]"
msg_error "'$pkgname-$lver': unknown build_style [$build_style]\n"
;;
esac
msg_normal "Package '$pkgname ($lver)': configure phase done."
msg_normal "'$pkgname-$lver': configure phase done.\n"
# Run post_configure func.
if [ ! -f $XBPS_POSTCONFIGURE_DONE ]; then
run_func post_configure
if [ $? -eq 0 ]; then
msg_normal "Package '$pkgname': post_configure phase done."
msg_normal "'$pkgname-$lver': post_configure phase done."
touch -f $XBPS_POSTCONFIGURE_DONE
fi
fi

View file

@ -33,7 +33,7 @@ extract_distfiles()
[ -f $XBPS_EXTRACT_DONE ] && return 0
[ -z "$in_chroot" -a ! -w $XBPS_BUILDDIR ] && \
msg_error "can't extract distfile(s) (permission denied)"
msg_error "can't extract distfile(s) (permission denied)\n"
#
# If we are being called via the target, just extract and return.
@ -63,7 +63,7 @@ extract_distfiles()
for f in ${distfiles}; do
curfile=$(basename $f)
if [ ! -f ${XBPS_SRCDISTDIR}/${curfile} ]; then
msg_error "cannot find ${curfile}, use 'xbps-src fetch' first."
msg_error "cannot find ${curfile}, use 'xbps-src fetch' first.\n"
fi
done
@ -71,7 +71,7 @@ extract_distfiles()
mkdir -p ${wrksrc} || return 1
fi
msg_normal "Package '$pkgname ($lver)': extracting distfile(s), please wait..."
msg_normal "'$pkgname-$lver': extracting distfile(s), please wait...\n"
for f in ${distfiles}; do
curfile=$(basename $f)
@ -99,7 +99,7 @@ extract_distfiles()
elif $(echo $f|grep -q '.zip'); then
cursufx="zip"
else
msg_error "unknown distfile suffix for $curfile."
msg_error "unknown distfile suffix for $curfile.\n"
fi
if [ -n "$create_wrksrc" ]; then
@ -111,23 +111,23 @@ extract_distfiles()
case ${cursufx} in
txz)
if ! command -v xz 2>&1 >/dev/null; then
msg_error "cannot find xz for extraction."
msg_error "cannot find xz for extraction.\n"
fi
tar xfJ $XBPS_SRCDISTDIR/$curfile -C $extractdir
if [ $? -ne 0 ]; then
msg_error "extracting $curfile into $XBPS_BUILDDIR."
msg_error "extracting $curfile into $XBPS_BUILDDIR.\n"
fi
;;
tbz)
tar xfj $XBPS_SRCDISTDIR/$curfile -C $extractdir
if [ $? -ne 0 ]; then
msg_error "extracting $curfile into $XBPS_BUILDDIR."
msg_error "extracting $curfile into $XBPS_BUILDDIR.\n"
fi
;;
tgz)
tar xfz $XBPS_SRCDISTDIR/$curfile -C $extractdir
if [ $? -ne 0 ]; then
msg_error "extracting $curfile into $XBPS_BUILDDIR."
msg_error "extracting $curfile into $XBPS_BUILDDIR.\n"
fi
;;
gz|bz2)
@ -141,7 +141,7 @@ extract_distfiles()
tar)
tar xf $XBPS_SRCDISTDIR/$curfile -C $extractdir
if [ $? -ne 0 ]; then
msg_error "extracting $curfile into $XBPS_BUILDDIR."
msg_error "extracting $curfile into $XBPS_BUILDDIR.\n"
fi
;;
zip)
@ -149,14 +149,14 @@ extract_distfiles()
unzip -q -x $XBPS_SRCDISTDIR/$curfile \
-d $extractdir
if [ $? -ne 0 ]; then
msg_error "extracting $curfile into $XBPS_BUILDDIR."
msg_error "extracting $curfile into $XBPS_BUILDDIR.\n"
fi
else
msg_error "cannot find unzip bin for extraction"
msg_error "cannot find unzip bin for extraction.\n"
fi
;;
*)
msg_error "cannot guess $curfile extract suffix. ($cursufx)"
msg_error "cannot guess $curfile extract suffix. ($cursufx)\n"
;;
esac
done

View file

@ -34,12 +34,12 @@ verify_sha256_cksum()
[ -z "$file" -o -z "$cksum" ] && return 1
msg_normal "'$pkgname-$lver': verifying checksum for $file... "
filesum=$(${XBPS_DIGEST_CMD} $XBPS_SRCDISTDIR/$file)
if [ "$origsum" != "$filesum" ]; then
msg_error "SHA256 checksum doesn't match for $file."
msg_error "SHA256 checksum doesn't match for $file.\n"
fi
msg_normal "Package '$pkgname ($lver)': SHA256 checksum OK for $file."
msg_normal_append "OK.\n"
}
#
@ -69,7 +69,6 @@ fetch_distfiles()
fi
if [ -n "$nofetch" ]; then
msg_normal "Package '$pkgname ($lver)': running do_fetch phase."
cd ${XBPS_BUILDDIR} && run_func do_fetch && return $?
fi
@ -88,10 +87,9 @@ fetch_distfiles()
done
if [ -z $found ]; then
msg_error "cannot find checksum for $curfile."
msg_error "cannot find checksum for $curfile.\n"
fi
msg_normal "Package '$pkgname ($lver)': verifying checksum for $curfile..."
verify_sha256_cksum $curfile $cksum
if [ $? -eq 0 ]; then
unset cksum found
@ -101,7 +99,7 @@ fetch_distfiles()
fi
fi
msg_normal "Package '$pkgname ($lver)': fetching distfile $curfile."
msg_normal "'$pkgname-$lver': fetching distfile $curfile...\n"
if [ -n "$distfiles" ]; then
localurl="$f"
@ -113,9 +111,9 @@ fetch_distfiles()
if [ $? -ne 0 ]; then
unset localurl
if [ ! -f $XBPS_SRCDISTDIR/$curfile ]; then
msg_error "couldn't fetch $curfile."
msg_error "couldn't fetch $curfile.\n"
else
msg_error "there was an error fetching $curfile."
msg_error "there was an error fetching $curfile.\n"
fi
else
unset localurl
@ -133,7 +131,7 @@ fetch_distfiles()
done
if [ -z $found ]; then
msg_error "cannot find checksum for $curfile."
msg_error "cannot find checksum for $curfile.\n"
fi
verify_sha256_cksum $curfile $cksum

View file

@ -47,7 +47,7 @@ binpkg_cleanup()
{
local pkgdir="$1" binpkg="$2"
printf "\nInterrupted! removing $binpkg file!\n"
msg_red "\nInterrupted! removing $binpkg file!\n"
rm -f $pkgdir/$binpkg
exit 1
}
@ -61,7 +61,7 @@ xbps_make_binpkg_real()
local mfiles binpkg pkgdir arch lver dirs _dirs d clevel
if [ ! -d "${DESTDIR}" ]; then
msg_warn "cannot find destdir for $pkgname... skipping!"
msg_warn "cannot find destdir for $pkgname... skipping!\n"
return 0
fi
cd ${DESTDIR}
@ -82,7 +82,7 @@ xbps_make_binpkg_real()
# Don't overwrite existing binpkgs by default, skip them.
#
if [ -f $pkgdir/$binpkg ]; then
echo "=> Skipping existing $binpkg pkg..."
msg_normal "Skipping existing $binpkg pkg...\n"
return 0
fi
@ -112,16 +112,16 @@ xbps_make_binpkg_real()
# Remove binpkg if interrupted...
trap "binpkg_cleanup $pkgdir $binpkg" INT
echo -n "=> Building $binpkg... "
msg_normal "Building $binpkg... "
${fakeroot_cmd} ${fakeroot_cmd_args} \
tar --exclude "var/db/xbps/metadata/*/flist" \
-cpf - ${mfiles} ${dirs} | \
$XBPS_COMPRESS_CMD ${clevel} -qf > $pkgdir/$binpkg
if [ $? -eq 0 ]; then
echo "done."
msg_normal_append "done.\n"
else
rm -f $pkgdir/$binpkg
echo "failed!"
msg_normal_append "failed!\n"
fi
return $?

View file

@ -50,7 +50,7 @@ xbps_write_metadata_pkg()
[ $? -eq 0 ] && continue
if [ ! -f $XBPS_SRCPKGDIR/${sourcepkg}/${subpkg}.template ]; then
msg_error "Cannot find subpkg '${subpkg}' build template!"
msg_error "Cannot find subpkg '${subpkg}' build template!\n"
fi
setup_tmpl ${sourcepkg}
unset run_depends conf_files noarch triggers replaces \
@ -94,8 +94,7 @@ xbps_write_metadata_pkg_real()
local fpattern="s|${DESTDIR}||g;s|^\./$||g;/^$/d"
if [ ! -d "${DESTDIR}" ]; then
echo "ERROR: $pkgname not installed into destdir."
exit 1
msg_error "$pkgname not installed into destdir.\n"
fi
if [ -n "$noarch" ]; then
@ -125,7 +124,7 @@ xbps_write_metadata_pkg_real()
fi
# Add info-files trigger.
triggers="info-files $triggers"
msg_normal "Package '$pkgname ($lver)': processing info(1) files..."
msg_normal "'$pkgname-$lver': processing info(1) files...\n"
find ${DESTDIR}/usr/share/info -type f -follow | while read f
do
@ -160,7 +159,7 @@ xbps_write_metadata_pkg_real()
# compress all them with gzip.
#
if [ -d "${DESTDIR}/usr/share/man" ]; then
msg_normal "Package '$pkgname ($lver)': processing manual pages..."
msg_normal "'$pkgname-$lver': processing manual pages...\n"
find ${DESTDIR}/usr/share/man -type f -follow | while read f
do
j=$(echo "$f"|sed -e "$fpattern")
@ -183,7 +182,7 @@ xbps_write_metadata_pkg_real()
fi
cd ${DESTDIR}
msg_normal "Package '$pkgname ($lver)': creating package metadata..."
msg_normal "'$pkgname-$lver': creating package metadata...\n"
write_metadata_flist_header $TMPFPLIST
@ -356,7 +355,7 @@ _EOF
if [ ! -d $metadir ]; then
mkdir -p $metadir >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "ERROR: you don't have enough perms for this."
msg_red "you don't have enough perms for this!\n"
rm -f $TMPFLIST $TMPFPROPS
exit 1
fi
@ -386,5 +385,5 @@ _EOF
xbps_write_metadata_scripts_pkg remove; \
} || return $?
msg_normal "Package '$pkgname ($lver)': successfully created package metadata."
msg_normal "'$pkgname-$lver': successfully created package metadata.\n"
}

View file

@ -218,7 +218,7 @@ _EOF
for f in ${triggers}; do
if [ ! -f $XBPS_TRIGGERSDIR/$f ]; then
rm -f $tmpf
msg_error "$pkgname: unknown trigger $f, aborting!"
msg_error "$pkgname: unknown trigger $f, aborting!\n"
fi
done
for f in ${triggers}; do

View file

@ -1,5 +1,5 @@
#-
# Copyright (c) 2008-2009 Juan Romero Pardines.
# Copyright (c) 2008-2010 Juan Romero Pardines.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -29,7 +29,7 @@
#
_process_patch()
{
local args _patch i=$1
local lver args _patch i=$1
args="-Np0"
_patch=$(basename $i)
@ -40,6 +40,12 @@ _process_patch()
fi
cp -f $i $wrksrc
if [ -n "$revision" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
# Try to guess if its a compressed patch.
if $(echo $i|grep -q '.diff.gz'); then
gunzip $wrksrc/${_patch}
@ -58,15 +64,15 @@ _process_patch()
elif $(echo $i|grep -q '.patch'); then
:
else
msg_warn "unknown patch type: $i."
msg_warn "'$pkgname-$lver': unknown patch type: $i.\n"
continue
fi
cd $wrksrc && patch -s ${args} < ${_patch} 2>/dev/null
if [ $? -eq 0 ]; then
msg_normal "Patch applied: ${_patch}."
msg_normal "'$pkgname-$lver': Patch applied: ${_patch}.\n"
else
msg_error "couldn't apply patch: ${_patch}."
msg_error "'$pkgname-$lver': couldn't apply patch: ${_patch}.\n"
fi
}

View file

@ -70,7 +70,7 @@ install_pkg()
#
unset doing_deps
setup_tmpl $curpkgn
msg_normal "Installing '$pkgname'..."
msg_normal "Installing '$pkgname'...\n"
fi
#
@ -83,7 +83,7 @@ install_pkg()
. $XBPS_SHUTILSDIR/extract_funcs.sh
extract_distfiles
if [ $? -ne 0 ]; then
msg_red "cannot extract distfiles for '$pkgname'!"
msg_red "cannot extract distfiles for '$pkgname'!\n"
return 1
fi
fi
@ -92,7 +92,7 @@ install_pkg()
. $XBPS_SHUTILSDIR/configure_funcs.sh
configure_src_phase
if [ $? -ne 0 ]; then
msg_red "cannot configure '$pkgname'!"
msg_red "cannot configure '$pkgname'!\n"
return 1
fi
fi
@ -101,7 +101,7 @@ install_pkg()
. $XBPS_SHUTILSDIR/build_funcs.sh
build_src_phase
if [ $? -ne 0 ]; then
msg_red "cannot build '$pkgname'!"
msg_red "cannot build '$pkgname'!\n"
return 1
fi
fi
@ -112,7 +112,7 @@ install_pkg()
${fakeroot_cmd} ${fakeroot_cmd_args} \
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-doinst-helper ${curpkgn}
if [ $? -ne 0 ]; then
msg_red "xbps-src-doinst-helper failed for '$pkgname'!"
msg_red "xbps-src-doinst-helper failed for '$pkgname'!\n"
return 1
fi
@ -127,7 +127,7 @@ install_pkg()
trap 'remove_pkgdestdir_sighandler ${pkgname}' 0 INT
xbps_write_metadata_pkg
if [ $? -ne 0 ]; then
msg_red "cannot write package metadata for '$pkgname'!"
msg_red "cannot write package metadata for '$pkgname'!\n"
trap '' 0 INT
return 1
fi
@ -139,7 +139,7 @@ install_pkg()
. $XBPS_SHUTILSDIR/stow_funcs.sh
stow_pkg_handler stow
if [ $? -ne 0 ]; then
msg_red "cannot stow '$pkgname'!"
msg_red "cannot stow '$pkgname'!\n"
return 1
fi
@ -159,7 +159,7 @@ install_pkg_with_binpkg()
{
local pkgpattern="$1"
msg_normal "Installing binary pkg: $pkgpattern"
msg_normal "Installing binary pkg: $pkgpattern\n"
${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} \
-y install \""$pkgpattern\""
return $?
@ -172,10 +172,10 @@ list_pkg_files()
{
local pkg="$1" ver=
[ -z $pkg ] && msg_error "unexistent package, aborting."
[ -z $pkg ] && msg_error "unexistent package, aborting.\n"
ver=$($XBPS_PKGDB_CMD version $pkg)
[ -z "$ver" ] && msg_error "$pkg is not installed."
[ -z "$ver" ] && msg_error "$pkg is not installed.\n"
cat $XBPS_PKGMETADIR/$pkg/flist
}
@ -187,10 +187,10 @@ remove_pkg()
{
local subpkg ver
[ -z $pkgname ] && msg_error "unexistent package, aborting."
[ -z $pkgname ] && msg_error "unexistent package, aborting.\n"
ver=$($XBPS_PKGDB_CMD version $pkgname)
[ -z "$ver" ] && msg_error "$pkgname is not installed."
[ -z "$ver" ] && msg_error "$pkgname is not installed.\n"
. $XBPS_SHUTILSDIR/stow_funcs.sh
stow_pkg_handler unstow || return $?

View file

@ -40,7 +40,7 @@ stow_pkg_handler()
[ $? -eq 0 ] && continue
fi
if [ ! -f $XBPS_SRCPKGDIR/${sourcepkg}/${subpkg}.template ]; then
msg_error "Cannot find $subpkg subpkg build template!"
msg_error "Cannot find $subpkg subpkg build template!\n"
fi
unset revision pre_install pre_remove post_install \
post_remove post_stow
@ -74,7 +74,7 @@ stow_pkg_real()
[ -z "$pkgname" ] && return 2
if [ $(id -u) -ne 0 ] && [ ! -w $XBPS_MASTERDIR ]; then
msg_error "cannot stow $pkgname! (permission denied)"
msg_error "cannot stow $pkgname! (permission denied)\n"
fi
if [ "$build_style" = "meta-template" ]; then
@ -90,7 +90,7 @@ stow_pkg_real()
else
lver="${version}"
fi
msg_normal "Package '${pkgname} ($lver)': stowning files into masterdir, please wait..."
msg_normal "'${pkgname}-$lver': stowning files into masterdir, please wait...\n"
# Copy files into masterdir.
for i in $(find -print); do
@ -169,14 +169,14 @@ unstow_pkg_real()
if [ $(id -u) -ne 0 ] && \
[ ! -w $XBPS_MASTERDIR ]; then
msg_error "cannot unstow $pkgname! (permission denied)"
msg_error "cannot unstow $pkgname! (permission denied)\n"
fi
setup_tmpl $pkgname
ver=$($XBPS_PKGDB_CMD version $pkgname)
if [ -z "$ver" ]; then
msg_error "$pkgname is not installed."
msg_error "$pkgname is not installed.\n"
fi
cd $XBPS_PKGMETADIR/$pkgname || exit 1
@ -184,9 +184,9 @@ unstow_pkg_real()
# If it's a metapkg, do nothing.
:
elif [ ! -f ${XBPS_PKGMETADIR}/${pkgname}/flist ]; then
msg_error "$pkgname is incomplete, missing flist."
msg_error "$pkgname is incomplete, missing flist.\n"
elif [ ! -w ${XBPS_PKGMETADIR}/${pkgname}/flist ]; then
msg_error "$pkgname cannot be removed (permission denied)."
msg_error "$pkgname cannot be removed (permission denied).\n"
elif [ -s ${XBPS_PKGMETADIR}/${pkgname}/flist ]; then
run_func pre_remove
# Remove installed files.

View file

@ -55,7 +55,7 @@ strip_files_real()
lver="${version}"
fi
msg_normal "Package '$pkgname ($lver)': stripping files, please wait..."
msg_normal "'$pkgname-$lver': stripping files, please wait...\n"
find ${DESTDIR} -type f | while read f; do
case "$(file -bi "$f")" in
application/x-executable*)

View file

@ -107,7 +107,7 @@ setup_tmpl()
. $XBPS_SRCPKGDIR/${pkg}/template
prepare_tmpl
else
msg_error "Cannot find $pkg build template file."
msg_error "Cannot find $pkg build template file.\n"
fi
}
@ -138,10 +138,10 @@ Add_dependency()
case "$type" in
build|full|run) ;;
*) msg_error "Unknown dependency type for $pkgname." ;;
*) msg_error "Unknown dependency type for $pkgname.\n" ;;
esac
[ -z "$pkgname" ] && msg_error "Add_dependency: pkgname empty!"
[ -z "$pkgname" ] && msg_error "Add_dependency: pkgname empty!\n"
if [ -f $XBPS_SRCPKGDIR/${pkgname}/${pkgname}.depends ]; then
. $XBPS_SRCPKGDIR/${pkgname}/${pkgname}.depends
@ -205,7 +205,7 @@ prepare_tmpl()
for i in ${REQ_VARS}; do
eval val="\$$i"
if [ -z "$val" -o -z "$i" ]; then
msg_error "\"$i\" not set on $pkgname template."
msg_error "\"$i\" not set on $pkgname template.\n"
fi
done
@ -213,7 +213,7 @@ prepare_tmpl()
[ "$i" = "$xbps_machine" ] && found=si && break
done
if [ -n "${only_for_archs}" -a -z "$found" ]; then
msg_error "this package is only for: ${only_for_archs}."
msg_error "this package is only for: ${only_for_archs}.\n"
fi
unset XBPS_EXTRACT_DONE XBPS_APPLYPATCHES_DONE
@ -246,7 +246,7 @@ remove_tmpl_wrksrc()
return 1
fi
msg_normal "Cleaning '${sourcepkg}' build directory... "
msg_normal "Cleaning '${sourcepkg}' build directory...\n"
rm -rf $lwrksrc
return $?
}

View file

@ -57,7 +57,7 @@ verify_rundeps()
fi
[ -n "$noarch" -o -n "$noverifyrdeps" ] && return 0
msg_normal "Package '$pkgname ($lver)': verifying required run dependencies, please wait..."
msg_normal "'$pkgname-$lver': verifying required run dependencies, please wait...\n"
depsftmp=$(mktemp -t xbps_src_depstmp.XXXXXXXXXX) || exit 1
find ${PKG_DESTDIR} -type f -perm -u+w > $depsftmp 2>/dev/null
@ -148,7 +148,7 @@ verify_rundeps()
# Print an informative message suggesting what needs to be added
# into the build template.
msg_normal "The following code needs to be added into the build template:"
msg_normal "The following code needs to be added into the build template:\n"
echo "============ CUT HERE ==============="
for f in ${missing_libs}; do
@ -194,5 +194,5 @@ verify_rundeps()
done
echo "============ CUT HERE ==============="
msg_error "Package '${pkgname}-${version}' has wrong dependencies, won't continue..."
msg_error "'${pkgname}-${lver}': incorrect run dependencies, won't continue...\n"
}

View file

@ -149,26 +149,26 @@ check_config_vars()
break
fi
done
[ -z "$cffound" ] && msg_error "cannot find a config file"
[ -z "$cffound" ] && msg_error "cannot find a config file\n"
fi
run_file ${XBPS_CONFIG_FILE}
export XBPS_CONFIG_FILE=$path_fixed
if [ ! -f "$XBPS_CONFIG_FILE" ]; then
msg_error "cannot find configuration file: $XBPS_CONFIG_FILE"
msg_error "cannot find configuration file: $XBPS_CONFIG_FILE\n"
fi
for f in XBPS_DISTRIBUTIONDIR XBPS_MASTERDIR; do
eval val="\$${f}"
if [ -z "$val" ]; then
msg_error "'${f}' not set in configuration file!"
msg_error "'${f}' not set in configuration file!\n"
fi
done
if [ ! -d "$XBPS_MASTERDIR" ]; then
mkdir -p "$val"
if [ $? -ne 0 ]; then
msg_error "couldn't create 'XBPS_MASTERDIR' directory"
msg_error "couldn't create 'XBPS_MASTERDIR' directory\n"
fi
fi
[ -z "${_MASTERDIR_FLAG}" ] && export _MASTERDIR="$XBPS_MASTERDIR"
@ -274,13 +274,13 @@ bootstrap)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
. $XBPS_SHUTILSDIR/pkgtarget_funcs.sh
[ ! -d $XBPS_SRCPKGDIR/xbps-base-chroot ] && \
msg_error "Cannot find $XBPS_SRCPKGDIR/xbps-base-chroot directory!"
msg_error "Cannot find $XBPS_SRCPKGDIR/xbps-base-chroot directory!\n"
cd $XBPS_SRCPKGDIR/xbps-base-chroot && _ORIGINPKG="$(basename_cwd)"
setup_tmpl ${_ORIGINPKG} && install_pkg $pkgname
;;
build|configure)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
. ./template
if [ -z "$base_chroot" -a -z "$in_chroot" ]; then
@ -294,7 +294,7 @@ build|configure)
. $XBPS_SHUTILSDIR/builddep_funcs.sh
install_dependencies_pkg "$pkgname-$version"
if [ $? -ne 0 ]; then
msg_red "cannot install required deps for $pkgname."
msg_red "cannot install required deps for $pkgname.\n"
exit 1
fi
# All deps were installed, continue with the origin pkg...
@ -333,7 +333,7 @@ build-pkg)
fi
done
else
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
setup_tmpl $(basename_cwd)
xbps_make_binpkg
fi
@ -349,13 +349,13 @@ chroot)
;;
clean)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
setup_tmpl $(basename_cwd)
remove_tmpl_wrksrc $wrksrc
;;
extract|fetch|info)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
setup_tmpl $(basename_cwd)
if [ "$target" = "info" ]; then
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
@ -372,7 +372,7 @@ extract|fetch|info)
;;
install|install-destdir)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
. ./template
install_destdir_target=no
@ -407,21 +407,21 @@ make-repoidx)
;;
remove)
. $XBPS_SHUTILSDIR/pkgtarget_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
setup_tmpl $(basename_cwd)
remove_pkg
;;
stow)
stow_flag=yes
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
setup_tmpl $(basename_cwd)
. $XBPS_SHUTILSDIR/stow_funcs.sh
stow_pkg_handler stow
;;
unstow)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
setup_tmpl $(basename_cwd)
. $XBPS_SHUTILSDIR/stow_funcs.sh
stow_pkg_handler unstow