Reorganize the templates directory for possible future changes.

Now every template uses its own directory. Patches, prepost* files
and other related stuff are stored there.

--HG--
extra : convert_revision : bbc529ef161d9a59fe13a1d54ac058f77ea05845
This commit is contained in:
Juan RP 2009-02-03 21:35:57 +01:00
parent 6c252d43d4
commit fa2748d9b2
291 changed files with 25 additions and 24 deletions

View File

@ -125,13 +125,13 @@ _EOF
chmod 644 $metadir/*
rm -f $TMPFLIST $TMPFPROPS
if [ -f "$XBPS_TEMPLATESDIR/$pkgname.prepost-inst" ]; then
cp -f $XBPS_TEMPLATESDIR/$pkgname.prepost-inst \
if [ -f "$XBPS_TEMPLATESDIR/$pkgname/prepost-inst" ]; then
cp -f $XBPS_TEMPLATESDIR/$pkgname/prepost-inst \
$destdir/XBPS_PREPOST_INSTALL
chmod +x $destdir/XBPS_PREPOST_INSTALL
fi
if [ -f "$XBPS_TEMPLATESDIR/$pkgname.prepost-rm" ]; then
cp -f $XBPS_TEMPLATESDIR/$pkgname.prepost-rm \
if [ -f "$XBPS_TEMPLATESDIR/$pkgname/prepost-rm" ]; then
cp -f $XBPS_TEMPLATESDIR/$pkgname/prepost-rm \
$metadir/prepost-rm
chmod +x $metadir/prepost-rm
fi

View File

@ -39,7 +39,7 @@ add_dependency_tolist()
if [ "$pkgname" != "${curpkg%-[0-9]*.*}" ]; then
reset_tmpl_vars
. $XBPS_TEMPLATESDIR/${curpkg%-[0-9]*.*}.tmpl
. $XBPS_TEMPLATESDIR/${curpkg%-[0-9]*.*}/template
fi
for j in ${build_depends}; do
@ -175,7 +175,7 @@ install_builddeps_required_pkg()
[ -z "$pkg" ] && return 1
if [ "$pkgname" != "${pkg%-[0-9]*.*}" ]; then
. $XBPS_TEMPLATESDIR/${pkg%-[0-9]*.*}.tmpl
. $XBPS_TEMPLATESDIR/${pkg%-[0-9]*.*}/template
fi
for dep in ${build_depends}; do
@ -201,7 +201,7 @@ check_installed_pkg()
if [ "$pkgname" != "${pkg%-[0-9]*.*}" ]; then
reset_tmpl_vars
. $XBPS_TEMPLATESDIR/${pkg%-[0-9]*.*}.tmpl
. $XBPS_TEMPLATESDIR/${pkg%-[0-9]*.*}/template
fi
iver="$($XBPS_REGPKGDB_CMD version $pkgname)"
@ -225,7 +225,7 @@ check_build_depends_pkg()
if [ "$pkgname" != "${pkg%-[0-9]*.*}" ]; then
reset_tmpl_vars
. $XBPS_TEMPLATESDIR/${pkg%-[0-9]*.*}.tmpl
. $XBPS_TEMPLATESDIR/${pkg%-[0-9]*.*}/template
fi
if [ -n "$build_depends" ]; then

View File

@ -239,7 +239,7 @@ if [ "$(id -u)" -ne 0 ]; then
if [ -n "$origin_tmpl" ]; then
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
reset_tmpl_vars
run_file $XBPS_TEMPLATESDIR/$origin_tmpl.tmpl
run_file $XBPS_TEMPLATESDIR/$origin_tmpl/template
fi
echo "The '$pkgname' package requires to be installed in a chroot."
echo "You cannot do this as normal user, try again being root."

View File

@ -32,10 +32,10 @@ apply_tmpl_patches()
local i=
# Apply some build/install patches automatically.
if [ -f $XBPS_TEMPLATESDIR/$pkgname-fix-build.diff ]; then
if [ -f $XBPS_TEMPLATESDIR/$pkgname/$pkgname-fix-build.diff ]; then
patch_files="$pkgname-fix-build.diff $patch_files"
fi
if [ -f $XBPS_TEMPLATESDIR/$pkgname-fix-install.diff ]; then
if [ -f $XBPS_TEMPLATESDIR/$pkgname/$pkgname-fix-install.diff ]; then
patch_files="$pkgname-fix-install.diff $patch_files"
fi
@ -47,7 +47,7 @@ apply_tmpl_patches()
# apply them now.
#
for i in ${patch_files}; do
patch="$XBPS_TEMPLATESDIR/$i"
patch="$XBPS_TEMPLATESDIR/$pkgname/$i"
if [ ! -f "$patch" ]; then
msg_warn "unexistent patch: $i."
continue

View File

@ -31,7 +31,7 @@ install_pkg()
local pkg=
local curpkgn="$1"
local cdestdir=
local cur_tmpl="$XBPS_TEMPLATESDIR/$curpkgn.tmpl"
local cur_tmpl="$XBPS_TEMPLATESDIR/$curpkgn/template"
if [ -z $cur_tmpl -o ! -f $cur_tmpl ]; then
msg_error "cannot find $cur_tmpl template build file."
@ -147,11 +147,11 @@ remove_pkg()
[ -z $pkg ] && msg_error "unexistent package, aborting."
if [ ! -f "$XBPS_TEMPLATESDIR/$pkg.tmpl" ]; then
if [ ! -f "$XBPS_TEMPLATESDIR/$pkg/template" ]; then
msg_error "cannot find template build file."
fi
. $XBPS_TEMPLATESDIR/$pkg.tmpl
. $XBPS_TEMPLATESDIR/$pkg/template
ver=$($XBPS_REGPKGDB_CMD version $pkg)
[ -z "$ver" ] && msg_error "$pkg is not installed."

View File

@ -44,7 +44,7 @@ stow_pkg()
fi
if [ -n "$stow_flag" ]; then
pkg=$XBPS_TEMPLATESDIR/$pkg.tmpl
pkg=$XBPS_TEMPLATESDIR/$pkg/template
if [ "$pkgname" != "$pkg" ]; then
. $pkg
fi
@ -65,7 +65,7 @@ stow_pkg()
# Run template postinstall helpers if requested.
#
if [ "$pkgname" != "${pkg%%-$version}" ]; then
. $XBPS_TEMPLATESDIR/${pkg%%-$version}.tmpl
. $XBPS_TEMPLATESDIR/${pkg%%-$version}/template
fi
for i in ${postinstall_helpers}; do
@ -92,7 +92,7 @@ unstow_pkg()
fi
if [ "$pkgname" != "$pkg" ]; then
. $XBPS_TEMPLATESDIR/$pkg.tmpl
. $XBPS_TEMPLATESDIR/$pkg/template
fi
ver=$($XBPS_REGPKGDB_CMD version $pkg)

View File

@ -93,9 +93,9 @@ setup_tmpl()
. $XBPS_SHUTILSDIR/tmpl_vars.sh
if [ -f "$XBPS_TEMPLATESDIR/$pkg.tmpl" ]; then
if [ -f "$XBPS_TEMPLATESDIR/$pkg/template" ]; then
if [ "$pkgname" != "$pkg" ]; then
. $XBPS_TEMPLATESDIR/$pkg.tmpl
. $XBPS_TEMPLATESDIR/$pkg/template
fi
prepare_tmpl
else

View File

@ -23,7 +23,7 @@ do_install()
{
local bindir=$XBPS_DESTDIR/$pkgname-$version/usr/lib/initramfs-tools/bin
cp -v $XBPS_TEMPLATESDIR/$pkgname.config $wrksrc/.config
cp -v $XBPS_TEMPLATESDIR/$pkgname/dotconfig $wrksrc/.config
make || exit 1
install -v -d $bindir
install -v $wrksrc/busybox $bindir

Some files were not shown because too many files have changed in this diff Show More