From 27870b10e8c7870427190f7016214d1c97dadad3 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 7 Oct 2008 02:55:37 +0200 Subject: [PATCH] Introduce the concept of "meta-templates". meta-templates are just packages that do not install or remove stuff but only have dependencies. For testing this, I added the xorg-fonts-0.1 template; it just depends in some of all X.org fonts packages. --HG-- extra : convert_revision : c19e937dfd34eb8f0a0cedd4cba1297be765a253 --- dependencies/build-depends.db | Bin 11264 -> 11776 bytes pkgfs.sh | 53 +++++++++++++++++++++++++++++++--- templates/xorg-fonts.tmpl | 9 ++++++ 3 files changed, 58 insertions(+), 4 deletions(-) create mode 100755 templates/xorg-fonts.tmpl diff --git a/dependencies/build-depends.db b/dependencies/build-depends.db index bccfd057d4ef45271a8a843d91deae1422b1f214..8531b2ea24516da0861e152cedf43404f04f823d 100644 GIT binary patch delta 368 zcmZpOXo%S$ASSHFV8gJ7v4zoxQGzjo;S0k82Aj!>Vv>^+1X#p47#J8BEAordb<^_m zN{Si8fc$pG&0%7zL>a{1*W%}o))lNseD z*uhE+6($=p3r{|v%mU{JDvLWpXDrV w)KOBBhAvWBkZOn`mRV9 Extracting \`$pkgname-$version' into $PKGFS_BUILDDIR." $extract_cmd @@ -506,6 +519,10 @@ build_tmpl_sources() local pkg="$pkgname-$version" [ -z "$pkgname" -o -z "$version" ] && return 1 + # + # There's nothing of interest if we are a meta template. + # + [ "$build_style" = "meta-template" ] && return 0 if [ -n "$distfiles" -a -z "$wrksrc" ]; then wrksrc=$PKGFS_BUILDDIR/$distfiles @@ -722,6 +739,10 @@ stow_tmpl() pkg=$PKGFS_TEMPLATESDIR/$pkg.tmpl run_file $pkg pkg=$pkgname-$version + # + # You cannot stow a meta-template. + # + [ "$build_style" = "meta-template" ] && return 0 fi if [ -r "$PKGFS_DESTDIR/$pkg/$infodir_pkg" ]; then @@ -787,6 +808,11 @@ unstow_tmpl() run_file $PKGFS_TEMPLATESDIR/$pkg.tmpl + # + # You cannot unstow a meta-template. + # + [ "$build_style" = "meta-template" ] && return 0 + if [ -n "$ignore_files" ]; then xstow_ignore_files="$xstow_ignore_files $ignore_files" fi @@ -964,16 +990,16 @@ installed_tmpl_handler() [ -z "$action" -o -z "$pkg" -o -z "$version" ] && return 1 if [ "$action" = "register" ]; then - $db_cmd -w btree $PKGFS_REGPKG_DB $pkg $version + $db_cmd -w btree $PKGFS_REGPKG_DB $pkg $version 2>&1 >/dev/null if [ "$?" -ne 0 ]; then - echo -n "*** ERROR: couldn't register stowned \`$pkg'" + echo -n "*** ERROR: couldn't register \`$pkg'" echo " in db file ***" exit 1 fi elif [ "$action" = "unregister" ]; then - $db_cmd -d btree $PKGFS_REGPKG_DB $pkg + $db_cmd -d btree $PKGFS_REGPKG_DB $pkg 2>&1 >/dev/null if [ "$?" -ne 0 ]; then - echo -n "*** ERROR: \`$pkg' stowned not registered " + echo -n "*** ERROR: \`$pkg' not registered " echo "in db file? ***" exit 1 fi @@ -1100,6 +1126,15 @@ install_tmpl() extract_tmpl_sources build_tmpl_sources + # + # Just announce that meta-template is installed and exit. + # + if [ "$build_style" = "meta-template" ]; then + installed_tmpl_handler register $pkgname $version + echo "==> Installed meta-template \`$pkg'." + return 0 + fi + # # Do not stow the pkg if requested. # @@ -1143,6 +1178,16 @@ remove_tmpl() run_file $PKGFS_TEMPLATESDIR/$pkg.tmpl + # + # If it's a meta-template, just unregister it from the db. + # + if [ "$build_style" = "meta-template" ]; then + installed_tmpl_handler unregister $pkgname $version + [ "$?" -eq 0 ] && \ + echo "=> Removed meta-template \`$pkg'." + return $? + fi + if [ ! -d "$PKGFS_DESTDIR/$pkg-$version" ]; then echo "*** ERROR: cannot find package on $PKGFS_DESTDIR ***" exit 1 diff --git a/templates/xorg-fonts.tmpl b/templates/xorg-fonts.tmpl new file mode 100755 index 00000000000..490aba8df7a --- /dev/null +++ b/templates/xorg-fonts.tmpl @@ -0,0 +1,9 @@ +# Template file for 'xorg-fonts' +pkgname=xorg-fonts +version=0.1 +build_style=meta-template +short_desc="Some fonts from the X.org project" +maintainer="Juan RP " +long_desc=" + This package will install almost all required font packages from + the X.org project, required to visualize them."