xbps-src: cleanup version/revision mess.

This commit is contained in:
Juan RP 2011-07-18 16:25:18 +02:00
parent ac7c66d00a
commit 07db31cb54
15 changed files with 80 additions and 154 deletions

View file

@ -42,16 +42,10 @@ done
install_src_phase()
{
local f i subpkg lver spkgrev
local f i subpkg spkgrev
[ -z $pkgname ] && return 2
if [ -n "$revision" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
#
# There's nothing we can do if we are a meta template.
# Just creating the dir is enough to write the package metadata.
@ -70,7 +64,7 @@ install_src_phase()
# Run pre_install func.
if [ ! -f $XBPS_PRE_INSTALL_DONE ]; then
run_func pre_install
msg_normal "'$pkgname-$lver': pre_install (destdir) phase done.\n"
msg_normal "$pkgver: pre_install (destdir) phase done.\n"
touch -f $XBPS_PRE_INSTALL_DONE
fi
@ -85,18 +79,18 @@ install_src_phase()
esac
cd ${wrksrc} || msg_error "can't change cwd to wrksrc!\n"
msg_normal "'$pkgname-$lver': install (destdir) phase done.\n"
msg_normal "$pkgver: install (destdir) phase done.\n"
# Run post_install func.
if [ ! -f $XBPS_POST_INSTALL_DONE ]; then
run_func post_install
msg_normal "'$pkgname-$lver': post_install (destdir) phase done.\n"
msg_normal "$pkgver: post_install (destdir) phase done.\n"
touch -f $XBPS_POST_INSTALL_DONE
fi
# Remove libtool archives by default.
if [ -z "$keep_libtool_archives" ]; then
msg_normal "'$pkgname-$lver': removing libtool archives...\n"
msg_normal "$pkgver: removing libtool archives...\n"
find ${DESTDIR} -type f -name \*.la -delete
fi
# Always remove perllocal.pod and .packlist files.
@ -106,10 +100,10 @@ install_src_phase()
fi
# Remove empty directories by default.
if [ -z "$keep_empty_dirs" ]; then
msg_normal "'$pkgname-$lver': removing empty dirs...\n"
msg_normal "$pkgver: removing empty dirs...\n"
find ${DESTDIR} -depth -type d -exec rmdir 2>/dev/null {} \;
fi
msg_normal "'$pkgname-$lver': installed into destdir.\n"
msg_normal "$pkgver: installed into destdir.\n"
if [ "$build_style" != "custom-install" -a -z "$distfiles" ]; then
touch -f $XBPS_INSTALL_DONE
@ -128,7 +122,7 @@ install_src_phase()
if [ $? -eq 0 -a -z "$BOOTSTRAP_PKG_REBUILD" ]; then
continue
fi
msg_normal "'${sourcepkg}-$lver': preparing subpackage '${subpkg}'...\n"
msg_normal "$pkgver: preparing subpackage '${subpkg}'...\n"
if [ ! -f $XBPS_SRCPKGDIR/${sourcepkg}/${subpkg}.template ]; then
msg_error "Cannot find '${subpkg}' subpkg build template!\n"
fi
@ -139,7 +133,7 @@ install_src_phase()
run_func do_install
touch -f ${wrksrc}/.xbps_do_install_${pkgname}_done
else
msg_warn "'$sourcepkg-$lver': skipping '$pkgname' subpkg, already installed into destdir.\n"
msg_warn "$pkgver: skipping '$pkgname' subpkg, already installed into destdir.\n"
fi
done
}