From de800de41f4bc36c274e60f18b7f52b1ba4d2d2d Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 27 Jan 2009 13:35:41 +0100 Subject: [PATCH] initng-ifiles: add a prepost-action script to generate required files. --HG-- extra : convert_revision : 376e924f763c342b0d0ad19895f0241475e18eec --- templates/initng-ifiles.prepost-action | 25 +++++++++++++++++++++++++ templates/initng-ifiles.tmpl | 3 +-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 templates/initng-ifiles.prepost-action diff --git a/templates/initng-ifiles.prepost-action b/templates/initng-ifiles.prepost-action new file mode 100644 index 00000000000..31772ed49ef --- /dev/null +++ b/templates/initng-ifiles.prepost-action @@ -0,0 +1,25 @@ +#!/bin/sh -e + +export PATH="/bin:/sbin:/usr/bin:/usr/sbin" + +# $1 = chrootdir +# $2 = action +# $3 = pkgname +# $4 = version + +case "$2" in +preinst) + ;; +postinst) + echo "Running $3-$4 post-installation command..." + if [ "$1" = "NOTSET" ]; then + run_cmd="/sbin/genrunlevel --all" + else + run_cmd="chroot $1 /sbin/genrunlevel --all" + fi + + ${run_cmd} + ;; +esac + +exit 0 diff --git a/templates/initng-ifiles.tmpl b/templates/initng-ifiles.tmpl index 017a334dee2..484c092010e 100644 --- a/templates/initng-ifiles.tmpl +++ b/templates/initng-ifiles.tmpl @@ -28,6 +28,5 @@ run_depends="glibc-2.8 initng-0.6.10.2" pre_install() { # Replace hardcoded prefix. - sed -i -e "s|@LIB_INSTALL_DIR@|/lib|g" \ - $wrksrc/genrunlevel.in + sed -i -e "s|@LIB_INSTALL_DIR@|/lib|g" $wrksrc/genrunlevel.in }