Major infrastructure changes, part 2.

* Moved helpers, common and triggers dirs into xbps-src, where
  they belong.
* Renamed the templates dir to srcpkgs, it was so redundant before.
* Make it possible to add subpkgs with no restriction in names, for
  example udev now has a subpkgs called "libgudev". Previously
  subpkgs were named "${sourcepkg}-${pkgname}".
* xbps-src: changed to look for template files in current directory.
  That means that most arguments from the targets have been removed.
* xbps-src: added a reinstall target, to remove + install.
* xbps-src: do not overwrite binpkgs by default, skip them.

And more that I forgot because it's a mega-commit that I've been
working for some days already...

--HG--
extra : convert_revision : 0f466878584d1e6895d2a234f07ea1b2d1e61b3e
This commit is contained in:
Juan RP 2009-11-22 08:31:44 +01:00
parent 3c58e3ad40
commit 85cc462e1d
1305 changed files with 719 additions and 654 deletions

View file

@ -50,10 +50,9 @@ strip_files()
install_src_phase()
{
local pkg="$1"
local f i subpkg lver spkgrev
local f i subpkg lver spkgrev saved_wrksrc
[ -z $pkg ] && [ -z $pkgname ] && return 1
[ -z $pkgname ] && return 1
if [ -n "$revision" ]; then
lver="${version}_${revision}"
@ -70,6 +69,7 @@ install_src_phase()
return 0
fi
saved_wrksrc=$wrksrc
cd $wrksrc || msg_error "can't change cwd to wrksrc!"
# Run pre_install func.
@ -131,38 +131,31 @@ install_src_phase()
# Build subpackages if found.
#
for subpkg in ${subpackages}; do
if [ "${pkg}" != "${sourcepkg}" ] && \
[ "${pkg}" != "${sourcepkg}-${subpkg}" ]; then
continue
fi
if [ -n "$revision" ]; then
spkgrev="${sourcepkg}-${subpkg}-${version}_${revision}"
spkgrev="${subpkg}-${version}_${revision}"
else
spkgrev="${sourcepkg}-${subpkg}-${version}"
spkgrev="${subpkg}-${version}"
fi
check_installed_pkg ${spkgrev}
[ $? -eq 0 ] && continue
msg_normal "Preparing $sourcepkg subpackage: $sourcepkg-$subpkg"
if [ ! -f $XBPS_TEMPLATESDIR/$pkgname/$subpkg.template ]; then
msg_error "Cannot find subpackage template!"
msg_normal "Preparing ${sourcepkg} subpackage: ${subpkg}"
if [ ! -f $XBPS_SRCPKGDIR/${sourcepkg}/${subpkg}.template ]; then
msg_error "Cannot find ${subpkg} subpkg build template!"
fi
. $XBPS_TEMPLATESDIR/$pkgname/$subpkg.template
pkgname=${sourcepkg}-${subpkg}
. $XBPS_SRCPKGDIR/${sourcepkg}/${subpkg}.template
pkgname=${subpkg}
set_tmpl_common_vars
run_func do_install || \
msg_error "$pkgname do_install stage failed!"
run_template ${sourcepkg}
[ "$pkg" = "${sourcepkg}-${subpkg}" ] && break
done
[ -n "$subpackages" ] && setup_tmpl ${sourcepkg}
#
# Remove $wrksrc if -C not specified.
#
if [ -d "$wrksrc" -a -z "$dontrm_builddir" ]; then
rm -rf $wrksrc && \
msg_normal "Removed $pkgname-$lver build directory."
if [ -d "$saved_wrksrc" -a -z "$dontrm_builddir" ]; then
rm -rf $saved_wrksrc && \
msg_normal "Removed $sourcepkg-$lver build directory."
fi
}