From ceefb18bff423656eeeecd4008bbcba64ddd8fe8 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 14 May 2010 00:07:47 +0200 Subject: [PATCH] xbps-src: multiple improvements to messages and phases. - Prefix all messages with 'Package 'pkgname (version)': ..." to really understand what's going on. Add more messages in some stages... - Do not run pre/post_{configure,build,install} or do_{build,install} stages if they were executed successfully in the past. --- xbps-src/libexec/xbps-src-doinst-helper.sh.in | 89 +++++++++++++------ xbps-src/shutils/build_funcs.sh | 51 +++++++---- xbps-src/shutils/builddep_funcs.sh | 22 +++-- xbps-src/shutils/chroot.sh.in | 2 +- xbps-src/shutils/common_funcs.sh | 1 + xbps-src/shutils/configure_funcs.sh | 37 +++++--- xbps-src/shutils/extract_funcs.sh | 2 +- xbps-src/shutils/fetch_funcs.sh | 27 +++--- xbps-src/shutils/metadata.sh | 10 ++- xbps-src/shutils/stow_funcs.sh | 34 ++++--- xbps-src/shutils/tmpl_funcs.sh.in | 6 ++ xbps-src/shutils/verify_rundeps.sh | 18 ++-- xbps-src/xbps-src.sh.in | 15 ++-- 13 files changed, 203 insertions(+), 111 deletions(-) diff --git a/xbps-src/libexec/xbps-src-doinst-helper.sh.in b/xbps-src/libexec/xbps-src-doinst-helper.sh.in index ae79fabce0a..1ad86ad2ede 100644 --- a/xbps-src/libexec/xbps-src-doinst-helper.sh.in +++ b/xbps-src/libexec/xbps-src-doinst-helper.sh.in @@ -42,20 +42,22 @@ set_defvars strip_files() { + local lver="$1" + if [ ! -x /usr/bin/strip ]; then return 0 fi [ -n "$nostrip" ] && return 0 - msg_normal "Finding binaries/libraries to strip..." + msg_normal "Package '$pkgname ($lver)': stripping files, please wait..." for f in $(find ${DESTDIR} -type f); do case "$(file -biz $f)" in application/x-executable*) /usr/bin/strip $f && \ - echo "=> Stripped executable: $(basename $f)";; + echo " Stripped executable: $(basename $f)";; application/x-sharedlib*|application/x-archive*) /usr/bin/strip -S $f && \ - echo "=> Stripped library: $(basename $f)";; + echo " Stripped library: $(basename $f)";; esac done } @@ -89,25 +91,38 @@ install_src_phase() fi # Run pre_install func. - run_func pre_install 2>${wrksrc}/.xbps_pre_install.log - if [ $? -ne 0 ]; then - msg_red "$pkgname: pre_install() failed:" - cat $wrksrc/.xbps_pre_install.log - exit 1 + if [ ! -f $XBPS_PRE_INSTALL_DONE ]; then + run_func pre_install 2>${wrksrc}/.xbps_pre_install.log + if [ $? -ne 0 -a $? -ne 255 ]; then + msg_red "Package '$pkgname': pre_install phase failed! errors below" + cat $wrksrc/.xbps_pre_install.log + exit 1 + elif [ $? -eq 0 ]; then + msg_normal "Package '$pkgname': pre_install (destdir) phase done." + touch -f $XBPS_PRE_INSTALL_DONE + fi fi - msg_normal "Running install phase for $pkgname-$lver." + 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 2>${wrksrc}/.xbps_do_install.log \ - || msg_error "$pkgname: do_install() failed! check $wrksrc/.xbps_do_install.log" + run_func do_install 2>${wrksrc}/.xbps_do_install.log + if [ $? -ne 0 -a $? -ne 255 ]; then + msg_red "Package '$pkgname': do_install phase failed! errors below:" + cat $wrksrc/.xbps_do_install.log + exit 1 + fi ;; python-module) . $XBPS_HELPERSDIR/python-module.sh - run_func do_install 2>${wrksrc}/.xbps_do_install.log \ - || msg_error "$pkgname: install failed! check $wrksrc/.xbps_do_install.log" + run_func do_install 2>${wrksrc}/.xbps_do_install.log + if [ $? -ne 0 -a $? -ne 255 ]; then + msg_red "Package '$pkgname': install phase failed! errors below:" + cat $wrksrc/.xbps_do_install.log + exit 1 + fi ;; *) make_install $lver 2>${wrksrc}/.xbps_make_install.log @@ -115,16 +130,24 @@ install_src_phase() esac cd ${wrksrc} || msg_error "can't change cwd to wrksrc!" + msg_normal "Package '$pkgname ($lver)': install (destdir) phase done." + # Run post_install func. - run_func post_install 2>${wrksrc}/.xbps_post_install.log - if [ $? -ne 0 ]; then - msg_red "$pkgname: post_install() failed:" - cat ${wrksrc}/.xbps_post_install.log - exit 1 + if [ ! -f $XBPS_POST_INSTALL_DONE ]; then + run_func post_install 2>${wrksrc}/.xbps_post_install.log + if [ $? -ne 0 -a $? -ne 255 ]; then + msg_red "Package '$pkgname': post_install phase failed! errors below:" + cat ${wrksrc}/.xbps_post_install.log + exit 1 + elif [ $? -eq 0 ]; then + msg_normal "Package '$pkgname': post_install (destdir) phase done." + 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..." find ${DESTDIR} -type f -name \*.la -delete fi # Always remove perllocal.pod and .packlist files. @@ -134,14 +157,15 @@ install_src_phase() fi # Remove empty directories by default. if [ -z "$keep_empty_dirs" ]; then + msg_normal "Package '$pkgname ($lver)': removing empty dirs..." find ${DESTDIR} -depth -type d -exec rmdir 2>/dev/null {} \; fi # Strip bins/libs. if [ -z "$noarch" ]; then - strip_files + strip_files "$lver" fi - msg_normal "Installed $pkgname-$lver into $XBPS_DESTDIR." + msg_normal "Package '$pkgname ($lver)': installed into destdir." if [ "$build_style" != "custom-install" -a -z "$distfiles" ]; then touch -f $XBPS_INSTALL_DONE @@ -159,18 +183,25 @@ install_src_phase() check_installed_pkg ${spkgrev} [ $? -eq 0 ] && continue - msg_normal "Preparing ${sourcepkg} subpackage: ${subpkg}" + msg_normal "Package '${sourcepkg} ($lver)': preparing subpackage '${subpkg}'." if [ ! -f $XBPS_SRCPKGDIR/${sourcepkg}/${subpkg}.template ]; then - msg_error "Cannot find ${subpkg} subpkg build template!" + msg_error "Cannot find '${subpkg}' subpkg build template!" fi . $XBPS_SRCPKGDIR/${sourcepkg}/${subpkg}.template pkgname=${subpkg} set_tmpl_common_vars - run_func do_install 2>${wrksrc}/.xbps_do_install_${pkgname}.log - if [ $? -ne 0 ]; then - msg_red "$pkgname: do_install() failed:" - cat ${wrksrc}/.xbps_do_install_${pkgname}.log - exit 1 + if [ ! -f ${wrksrc}/.xbps_do_install_${pkgname}_done ]; then + run_func do_install \ + 2>${wrksrc}/.xbps_do_install_${pkgname}.log + if [ $? -ne 0 -a $? -eq 255 ]; then + msg_red "Package '$pkgname': do_install phase failed! errors below:" + cat ${wrksrc}/.xbps_do_install_${pkgname}.log + exit 1 + elif [ $? -eq 0 ]; then + touch -f ${wrksrc}/.xbps_do_install_${pkgname}_done + fi + else + msg_normal "Package '$sourcepkg ($lver)': skipping '$pkgname' subpkg, already installed into destdir." fi done @@ -179,7 +210,7 @@ install_src_phase() # if [ -d "$saved_wrksrc" -a "$dontrm_builddir" = "no" ]; then rm -rf $saved_wrksrc && \ - msg_normal "Removed $sourcepkg-$lver build directory." + msg_normal "Package '$sourcepkg ($lver)': removed build directory." fi } @@ -202,7 +233,7 @@ make_install() # Install package via make. # ${make_cmd} ${make_install_target} ${make_install_args} \ - || msg_error "$pkgname: make install failed!" + || msg_error "Package '$pkgname ($lver)': make install failed!" } [ -z "$PKG_TMPLNAME" ] && exit 2 diff --git a/xbps-src/shutils/build_funcs.sh b/xbps-src/shutils/build_funcs.sh index c0c30a7fc38..687eed96d9e 100644 --- a/xbps-src/shutils/build_funcs.sh +++ b/xbps-src/shutils/build_funcs.sh @@ -29,7 +29,7 @@ # build_src_phase() { - local pkg="$pkgname-$version" pkgparam="$1" f + local pkg="$pkgname-$version" pkgparam="$1" f lver [ -z $pkgparam ] && [ -z $pkgname -o -z $version ] && return 1 @@ -46,7 +46,12 @@ build_src_phase() cd $build_wrksrc || return 1 fi - [ -n "$revision" ] && pkg="${pkg}_${revision}" + if [ -n "$revision" ]; then + lver="${version}_${revision}" + pkg="${pkg}_${revision}" + else + lver="${version}" + fi if [ "$build_style" = "python-module" ]; then make_cmd="python" @@ -57,36 +62,50 @@ build_src_phase() makejobs="-j$XBPS_MAKEJOBS" fi # Run pre_build func. - run_func pre_build 2>${wrksrc}/.xbps_pre_build.log - if [ $? -ne 0 ]; then - msg_red "$pkgname: pre_build() failed:" - cat $wrksrc/.xbps_pre_build.log - exit 1 + if [ ! -f $XBPS_PRE_BUILD_DONE ]; then + run_func pre_build 2>${wrksrc}/.xbps_pre_build.log + if [ $? -ne 0 -a $? -ne 255 ]; then + msg_red "$pkgname: pre_build phase failed! errors below:" + cat $wrksrc/.xbps_pre_build.log + exit 1 + elif [ $? -eq 0 ]; then + msg_normal "$pkgname: pre_build phase done." + touch -f $XBPS_PRE_BUILD_DONE + fi fi . $XBPS_SHUTILSDIR/buildvars_funcs.sh set_build_vars - msg_normal "Running build phase for $pkg." + msg_normal "Package '$pkgname ($lver)': running build phase." if [ "$build_style" = "custom-install" ]; then - run_func do_build 2>${wrksrc}/.xbps_do_build.log \ - || msg_error "do_build stage failed!" + run_func do_build 2>${wrksrc}/.xbps_do_build.log + if [ $? -ne 0 -a $? -ne 255 ]; then + msg_error "Package '$pkgname': do_build phase failed!" + fi else # # Build package via make. # ${make_cmd} ${makejobs} ${make_build_args} \ ${make_build_target} || - msg_error "$pkgname: build phase failed!" + msg_error "Package '$pkgname': build phase failed!" fi + msg_normal "Package '$pkgname ($lver)': build phase done." + # Run post_build func. - run_func post_build 2>${wrksrc}/.xbps_post_build.log - if [ $? -ne 0 ]; then - msg_red "$pkgname: post_build() failed:" - cat $wrksrc/.xbps_post_build.log - exit 1 + if [ ! -f $XBPS_POST_BUILD_DONE ]; then + run_func post_build 2>${wrksrc}/.xbps_post_build.log + if [ $? -ne 0 -a $? -ne 255 ]; then + msg_red "Package '$pkgname': post_build phase failed! errors below:" + cat $wrksrc/.xbps_post_build.log + exit 1 + elif [ $? -eq 0 ]; then + msg_normal "Package '$pkgname': post_build phase done." + touch -f $XBPS_POST_BUILD_DONE + fi fi unset makejobs diff --git a/xbps-src/shutils/builddep_funcs.sh b/xbps-src/shutils/builddep_funcs.sh index 5d899539de6..e6819baeb4c 100644 --- a/xbps-src/shutils/builddep_funcs.sh +++ b/xbps-src/shutils/builddep_funcs.sh @@ -43,18 +43,22 @@ install_pkg_deps() curpkgname="$(${XBPS_PKGDB_CMD} getpkgdepname ${curpkg})" fi - msg_normal "Installing $saved_prevpkg dependency: $curpkgname." + if [ -z "$saved_prevpkg" -a -n "${_ORIGINPKG}" ]; then + msg_normal "Installing '${_ORIGINPKG}' dependency: '$curpkg'." + else + msg_normal "Installing '$saved_prevpkg' dependency: '$curpkg'." + fi setup_tmpl "$curpkgname" check_build_depends_pkg if [ $? -eq 0 ]; then - msg_normal "Dependency $curpkgname requires:" + msg_normal "Package dependency '$curpkgname' requires:" for j in ${build_depends}; do jname="$(${XBPS_PKGDB_CMD} getpkgdepname ${j})" jver="$($XBPS_PKGDB_CMD version ${jname})" check_pkgdep_matched "${j}" if [ $? -eq 0 ]; then - echo " ${j}: found $jname-$jver." + echo " ${j}: found '$jname-$jver'." else echo " ${j}: not found." fi @@ -95,9 +99,9 @@ install_pkg_deps() fi else if [ -n "$saved_prevpkg" ]; then - msg_normal "Installing ${curpkgname} required by ${saved_prevpkg}." + msg_normal "Installing package '${curpkgname}' required by '${saved_prevpkg}'." else - msg_normal "Installing ${curpkgname}." + msg_normal "Installing package: '${curpkg}'." fi install_pkg "${curpkgname}" if [ $? -eq 1 ]; then @@ -128,14 +132,14 @@ install_dependencies_pkg() fi if [ -n "$build_depends" -o -n "$run_depends" ]; then - msg_normal "Required dependencies for $pkgname-$lver... " + msg_normal "$pkgname: installing required package dependencies..." fi for i in ${build_depends}; do pkgn="$($XBPS_PKGDB_CMD getpkgdepname ${i})" iver="$($XBPS_PKGDB_CMD version $pkgn)" check_pkgdep_matched "${i}" if [ $? -eq 0 ]; then - echo " ${i}: found $pkgn-$iver." + echo " ${i}: found '$pkgn-$iver'." continue else echo " ${i}: not found." @@ -149,7 +153,7 @@ install_dependencies_pkg() for i in ${notinstalled_deps}; do pkgdeplist="${pkgdeplist} \"${i}\" " done - msg_normal "Installing required build dependencies from binpkgs..." + msg_normal "$pkgname: installing required dependencies from binpkgs..." ${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} \ -y install ${pkgdeplist} rval=$? @@ -182,7 +186,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'." if [ -n "$XBPS_PREFER_BINPKG_DEPS" ]; then install_pkg_with_binpkg "${j}" rval=$? diff --git a/xbps-src/shutils/chroot.sh.in b/xbps-src/shutils/chroot.sh.in index 6ac0466a807..523af3f8ae6 100644 --- a/xbps-src/shutils/chroot.sh.in +++ b/xbps-src/shutils/chroot.sh.in @@ -272,7 +272,7 @@ xbps_chroot_handler() else [ "$norm_builddir" = "yes" ] && \ action="-C $action" - env in_chroot=yes LANG=C PATH=$path \ + env in_chroot=yes LANG=C PATH=$path _ORIGINPKG="$pkg" \ ${chroot_cmd} $XBPS_MASTERDIR sh -c \ "cd /xbps/srcpkgs/$pkg && xbps-src $action" || \ rv=$? && _umount && return $rv diff --git a/xbps-src/shutils/common_funcs.sh b/xbps-src/shutils/common_funcs.sh index ee255633f49..b210a6964a2 100644 --- a/xbps-src/shutils/common_funcs.sh +++ b/xbps-src/shutils/common_funcs.sh @@ -36,6 +36,7 @@ run_func() $func return $? fi + return 255 # function not found. } msg_red() diff --git a/xbps-src/shutils/configure_funcs.sh b/xbps-src/shutils/configure_funcs.sh index 382397ed5e0..698a7795103 100644 --- a/xbps-src/shutils/configure_funcs.sh +++ b/xbps-src/shutils/configure_funcs.sh @@ -58,11 +58,16 @@ configure_src_phase() cd $wrksrc || msg_error "unexistent build directory [$wrksrc]." # Run pre_configure func. - run_func pre_configure 2>${wrksrc}/.xbps_pre_configure.log - if [ $? -ne 0 ]; then - msg_red "$pkgname: pre_configure() failed:" - cat $wrksrc/.xbps_pre_configure.log - exit 1 + if [ ! -f $XBPS_PRECONFIGURE_DONE ]; then + run_func pre_configure 2>${wrksrc}/.xbps_pre_configure.log + if [ $? -ne 0 -a $? -ne 255 ]; then + msg_red "Package '$pkgname': pre_configure phase failed! errors below:" + cat $wrksrc/.xbps_pre_configure.log + exit 1 + elif [ $? -eq 0 ]; then + msg_normal "Package '$pkgname': pre_configure phase done." + touch -f $XBPS_PRECONFIGURE_DONE + fi fi # Export configure_env vars. @@ -70,7 +75,7 @@ configure_src_phase() export "$f" done - msg_normal "Running configure phase for $pkgname-$lver." + msg_normal "Package '$pkgname ($lver)': running configure phase." [ -z "$configure_script" ] && configure_script="./configure" @@ -109,21 +114,27 @@ configure_src_phase() # # Unknown build_style type won't work :-) # - msg_error "unknown build_style [$build_style]" + msg_error "package '$pkgname': unknown build_style [$build_style]" exit 1 ;; esac if [ "$build_style" != "perl_module" -a "$error" -ne 0 ]; then - msg_error "$pkgname: configure stage failed!" + msg_error "package '$pkgname': configure stage failed!" fi + msg_normal "Package '$pkgname ($lver)': configure phase done." # Run post_configure func. - run_func post_configure 2>${wrksrc}/.xbps_post_configure.log - if [ $? -ne 0 ]; then - msg_red "$pkgname: post_configure() failed:" - cat $wrksrc/.xbps_post_configure.log - exit 1 + if [ ! -f $XBPS_POSTCONFIGURE_DONE ]; then + run_func post_configure 2>${wrksrc}/.xbps_post_configure.log + if [ $? -ne 0 -a $? -ne 255 ]; then + msg_red "Package '$pkgname': post_configure phase failed! errors below:" + cat $wrksrc/.xbps_post_configure.log + exit 1 + elif [ $? -eq 0 ]; then + msg_normal "Package '$pkgname': post_configure phase done." + touch -f $XBPS_POSTCONFIGURE_DONE + fi fi # unset configure_env vars. diff --git a/xbps-src/shutils/extract_funcs.sh b/xbps-src/shutils/extract_funcs.sh index 607678c77d3..23c4f8f1e6b 100644 --- a/xbps-src/shutils/extract_funcs.sh +++ b/xbps-src/shutils/extract_funcs.sh @@ -71,7 +71,7 @@ extract_distfiles() mkdir -p ${wrksrc} || return 1 fi - msg_normal "Extracting $pkgname-$lver distfile(s)." + msg_normal "Package '$pkgname ($lver)': extracting distfile(s), please wait..." for f in ${distfiles}; do curfile=$(basename $f) diff --git a/xbps-src/shutils/fetch_funcs.sh b/xbps-src/shutils/fetch_funcs.sh index 02eda19abfe..8f6a033cc07 100644 --- a/xbps-src/shutils/fetch_funcs.sh +++ b/xbps-src/shutils/fetch_funcs.sh @@ -39,7 +39,7 @@ verify_sha256_cksum() msg_error "SHA256 checksum doesn't match for $file." fi - msg_normal "SHA256 checksum OK for $file." + msg_normal "Package '$pkgname ($lver)': SHA256 checksum OK for $file." } # @@ -47,15 +47,9 @@ verify_sha256_cksum() # fetch_distfiles() { - local pkg="$1" - local upcksum="$2" - local dfiles= - local localurl= - local dfcount=0 - local ckcount=0 - local f= + local pkg="$1" upcksum="$2" dfiles localurl dfcount=0 ckcount=0 f - [ -z $pkgname ] && exit 1 + [ -z $pkgname ] && return 1 # # There's nothing of interest if we are a meta template. @@ -70,10 +64,18 @@ fetch_distfiles() # if [ -n "$nofetch" ]; then cd ${XBPS_BUILDDIR} && run_func do_fetch 2>/dev/null - return $? + if [ $? -ne 0 && $? -ne 255 ]; then + return $? + fi fi cd $XBPS_SRCDISTDIR || return 1 + if [ -n "$revision" ]; then + lver="${version}_${revision}" + else + lver="${version}" + fi + for f in ${distfiles}; do curfile=$(basename $f) if [ -f "$XBPS_SRCDISTDIR/$curfile" ]; then @@ -91,6 +93,7 @@ fetch_distfiles() msg_error "cannot find checksum for $curfile." fi + msg_normal "Package '$pkgname ($lver)': verifying checksum for $curfile..." verify_sha256_cksum $curfile $cksum if [ $? -eq 0 ]; then unset cksum found @@ -100,7 +103,7 @@ fetch_distfiles() fi fi - msg_normal "Fetching distfile: $curfile." + msg_normal "Package '$pkgname ($lver)': fetching distfile $curfile." if [ -n "$distfiles" ]; then localurl="$f" @@ -145,5 +148,5 @@ fetch_distfiles() dfcount=$(($dfcount + 1)) done - unset cksum found + unset lver cksum found } diff --git a/xbps-src/shutils/metadata.sh b/xbps-src/shutils/metadata.sh index 34ddb0dd0d0..33c69f3b19e 100644 --- a/xbps-src/shutils/metadata.sh +++ b/xbps-src/shutils/metadata.sh @@ -125,6 +125,7 @@ xbps_write_metadata_pkg_real() fi # Add info-files trigger. triggers="info-files $triggers" + msg_normal "Package '$pkgname ($lver)': processing info(1) files..." for f in $(find ${DESTDIR}/usr/share/info -type f -follow); do j=$(echo $f|sed -e "$fpattern") @@ -148,7 +149,7 @@ xbps_write_metadata_pkg_real() ln -s ${lnkat}.gz ${newlnk}.gz continue fi - echo "===> Compressing info file: $j..." + echo " Compressing info file: $j..." gzip -q9 ${DESTDIR}/$j done fi @@ -158,6 +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..." for f in $(find ${DESTDIR}/usr/share/man -type f -follow); do j=$(echo $f|sed -e "$fpattern") [ "$j" = "" ] && continue @@ -173,13 +175,13 @@ xbps_write_metadata_pkg_real() ln -s ${lnkat}.gz ${newlnk}.gz continue fi - echo "===> Compressing manpage: $j..." + echo " Compressing manpage: $j..." gzip -q9 ${DESTDIR}/$j done fi cd ${DESTDIR} - msg_normal "Writing package metadata for $pkgname-$lver..." + msg_normal "Package '$pkgname ($lver)': creating package metadata..." write_metadata_flist_header $TMPFPLIST @@ -378,4 +380,6 @@ _EOF xbps_write_metadata_scripts_pkg install; \ xbps_write_metadata_scripts_pkg remove; \ } || return $? + + msg_normal "Package '$pkgname ($lver)': successfully created package metadata." } diff --git a/xbps-src/shutils/stow_funcs.sh b/xbps-src/shutils/stow_funcs.sh index 514c8767e89..8dcd1a16a86 100644 --- a/xbps-src/shutils/stow_funcs.sh +++ b/xbps-src/shutils/stow_funcs.sh @@ -85,7 +85,12 @@ stow_pkg_real() cd ${DESTDIR} || return 1 - msg_normal "Stowning '${pkgname}' into masterdir..." + if [ -n "$revision" ]; then + lver="${version}_${revision}" + else + lver="${version}" + fi + msg_normal "Package '${pkgname} ($lver)': stowning files into masterdir, please wait..." # Copy files into masterdir. for i in $(find -print); do @@ -96,10 +101,10 @@ stow_pkg_real() continue # Skip files that are already in masterdir. elif [ -f "$XBPS_MASTERDIR/$lfile" ]; then - echo "=> Skipping $lfile file, already exists!" + echo " Skipping $lfile file, already exists!" continue elif [ -h "$XBPS_MASTERDIR/$lfile" ]; then - echo "=> Skipping $lfile link, already exists!" + echo " Skipping $lfile link, already exists!" continue elif [ -d "$XBPS_MASTERDIR/$lfile" ]; then continue @@ -145,16 +150,12 @@ stow_pkg_real() # # Register pkg in plist file. # - if [ -n "$revision" ]; then - lver="${version}_${revision}" - else - lver="${version}" - fi $XBPS_PKGDB_CMD register $pkgname $lver "$short_desc" || return $? - run_func post_stow 2>/dev/null || msg_error "post_stow failed!" - - return $? + run_func post_stow 2>/dev/null + if [ $? -ne 0 -a $? -ne 255 ]; then + msg_error "Package '$pkgname': post_stow phase failed!" + fi } # @@ -188,8 +189,10 @@ unstow_pkg_real() elif [ ! -w ${XBPS_PKGMETADIR}/${pkgname}/flist ]; then msg_error "$pkgname cannot be removed (permission denied)." elif [ -s ${XBPS_PKGMETADIR}/${pkgname}/flist ]; then - run_func pre_remove 2>/dev/null || \ - msg_error "pre_remove stage failed!" + run_func pre_remove 2>/dev/null + if [ $? -ne 0 -a $? -ne 255 ]; then + msg_error "Package '$pkgname': pre_remove stage failed!" + fi # Remove installed files. for f in $(cat ${XBPS_PKGMETADIR}/${pkgname}/flist); do @@ -211,7 +214,10 @@ unstow_pkg_real() done fi - run_func post_remove 2>/dev/null || msg_error "post_remove failed!" + run_func post_remove 2>/dev/null + if [ $? -ne 0 -a $? -ne 255 ]; then + msg_error "Package '$pkgname': post_remove phase failed!" + fi # Remove metadata dir. rm -rf $XBPS_PKGMETADIR/$pkgname diff --git a/xbps-src/shutils/tmpl_funcs.sh.in b/xbps-src/shutils/tmpl_funcs.sh.in index 3453b5ec51b..f98f2687df1 100644 --- a/xbps-src/shutils/tmpl_funcs.sh.in +++ b/xbps-src/shutils/tmpl_funcs.sh.in @@ -232,8 +232,14 @@ prepare_tmpl() XBPS_EXTRACT_DONE="$wrksrc/.xbps_extract_done" XBPS_APPLYPATCHES_DONE="$wrksrc/.xbps_applypatches_done" XBPS_CONFIGURE_DONE="$wrksrc/.xbps_configure_done" + XBPS_PRECONFIGURE_DONE="$wrksrc/.xbps_pre_configure_done" + XBPS_POSTCONFIGURE_DONE="$wrksrc/.xbps_post_configure_done" XBPS_BUILD_DONE="$wrksrc/.xbps_build_done" + XBPS_PRE_BUILD_DONE="$wrksrc/.xbps_pre_build_done" + XBPS_POST_BUILD_DONE="$wrksrc/.xbps_post_build_done" XBPS_INSTALL_DONE="$wrksrc/.xbps_install_done" + XBPS_PRE_INSTALL_DONE="$wrksrc/.xbps_pre_install_done" + XBPS_POST_INSTALL_DONE="$wrksrc/.xbps_post_install_done" set_tmpl_common_vars diff --git a/xbps-src/shutils/verify_rundeps.sh b/xbps-src/shutils/verify_rundeps.sh index 3d06e5f014f..71f5ee71e04 100644 --- a/xbps-src/shutils/verify_rundeps.sh +++ b/xbps-src/shutils/verify_rundeps.sh @@ -44,14 +44,20 @@ find_rundep() verify_rundeps() { - local j i f nlib verify_deps maplib found_dup igndir + local j i f nlib verify_deps maplib found_dup igndir lver local missing missing_libs rdep builddep rdep_list builddep_list PKG_DESTDIR="$1" maplib="$XBPS_COMMONVARSDIR/mapping_shlib_binpkg.txt" + if [ -n "$revision" ]; then + lver="${version}_${revision}" + else + lver="${version}" + fi + [ -n "$noarch" -o "$nostrip" -o "$noverifyrdeps" ] && return 0 - msg_normal "Verifying required $pkgname run dependencies..." + msg_normal "Package '$pkgname ($lver)': verifying required run dependencies, please wait..." for f in $(find ${PKG_DESTDIR} -type f); do # Don't check dirs specified in ignore_vdeps_dir. @@ -94,14 +100,14 @@ verify_rundeps() rdep="$(grep "$f" $maplib|awk '{print $2}')" rdepcnt="$(grep "$f" $maplib|awk '{print $2}'|wc -l)" if [ -z "$rdep" ]; then - msg_error_nochroot "unknown rundep for $f" + echo " UNKNOWN PACKAGE FOR SHLIB DEPENDENCY '$f', PLEASE FIX!" fi # Ignore libs by current pkg [ "$rdep" = "$pkgname" ] && continue # Check if shlib is provided by multiple pkgs. if [ "$rdepcnt" -gt 1 ]; then - echo "=> Required $f is provided by these pkgs: " + echo " shlib dependency '$f' is provided by these pkgs: " for j in ${rdep}; do printf "\t$j\n" done @@ -109,7 +115,7 @@ verify_rundeps() fi # Warn if rundep is not in template. if find_rundep "$rdep"; then - msg_warn_nochroot "required $f from $rdep (MISSING)" + echo " REQUIRED SHLIB DEPENDENCY '$f' FROM PACKAGE '$rdep' MISSING, PLEASE FIX!" missing=1 if [ -z "$missing_libs" ]; then missing_libs="$f" @@ -126,7 +132,7 @@ verify_rundeps() unset found_dup continue fi - echo "=> Requires $f from $rdep (OK)" + echo " shlib dependency '$f' provided by the '$rdep' package (OK)." unset rdep done diff --git a/xbps-src/xbps-src.sh.in b/xbps-src/xbps-src.sh.in index e61ca608b64..df9d979553c 100644 --- a/xbps-src/xbps-src.sh.in +++ b/xbps-src/xbps-src.sh.in @@ -203,8 +203,8 @@ bootstrap) . $XBPS_SHUTILSDIR/pkgtarget_funcs.sh [ ! -d $XBPS_SRCPKGDIR/xbps-base-chroot ] && \ msg_error "Cannot find $XBPS_SRCPKGDIR/xbps-base-chroot directory!" - cd $XBPS_SRCPKGDIR/xbps-base-chroot && setup_tmpl $(basename_cwd) - install_pkg $pkgname + cd $XBPS_SRCPKGDIR/xbps-base-chroot && _ORIGINPKG="$(basename_cwd)" + setup_tmpl ${_ORIGINPKG} && install_pkg $pkgname ;; build|configure) . $XBPS_SHUTILSDIR/tmpl_funcs.sh @@ -215,8 +215,8 @@ build|configure) . $XBPS_SHUTILSDIR/chroot.sh xbps_chroot_handler $target $(basename_cwd) else - originpkg="$(basename_cwd)" - setup_tmpl $originpkg + _ORIGINPKG="$(basename_cwd)" + setup_tmpl ${_ORIGINPKG} # If pkg has dependencies, install them first. . $XBPS_SHUTILSDIR/pkgtarget_funcs.sh . $XBPS_SHUTILSDIR/builddep_funcs.sh @@ -226,7 +226,7 @@ build|configure) exit 1 fi # All deps were installed, continue with the origin pkg... - setup_tmpl $originpkg + setup_tmpl ${_ORIGINPKG} . $XBPS_SHUTILSDIR/fetch_funcs.sh fetch_distfiles if [ ! -f "$XBPS_EXTRACT_DONE" ]; then @@ -293,12 +293,13 @@ install|install-destdir) install_destdir_target=no [ "$target" = "install-destdir" ] && install_destdir_target=yes + _ORIGINPKG="$(basename_cwd)" if [ -z "$in_chroot" -a -z "$base_chroot" ]; then . $XBPS_SHUTILSDIR/chroot.sh - xbps_chroot_handler $target $(basename_cwd) $dontrm_builddir + xbps_chroot_handler $target ${_ORIGINPKG} $dontrm_builddir else . $XBPS_SHUTILSDIR/pkgtarget_funcs.sh - setup_tmpl $(basename_cwd) + setup_tmpl ${_ORIGINPKG} install_pkg $pkgname fi ;;