/[gentoo-x86]/eclass/cron.eclass
Gentoo

Diff of /eclass/cron.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.11 Revision 1.12
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2008 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/cron.eclass,v 1.11 2007/10/27 21:21:11 bangert Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cron.eclass,v 1.12 2008/06/26 10:51:41 bangert Exp $
4 4
5# @ECLASS: cron
6# @MAINTAINER:
7# cron-bugs@gentoo.org
8#
5# Original Author: Aaron Walker <ka0ttic@gentoo.org> 9# Original Author: Aaron Walker <ka0ttic@gentoo.org>
6# 10# @BLURB: Some functions for cron
11# @DESCRIPTION:
7# Purpose: The main motivation for this eclass was to simplify 12# Purpose: The main motivation for this eclass was to simplify
8# the jungle known as src_install() in cron ebuilds. Using these 13# the jungle known as src_install() in cron ebuilds. Using these
9# functions also ensures that permissions are *always* reset, 14# functions also ensures that permissions are *always* reset,
10# preventing the accidental installation of files with wrong perms. 15# preventing the accidental installation of files with wrong perms.
11# 16#
26 virtual/mta 31 virtual/mta
27 >=sys-process/cronbase-0.3.2" 32 >=sys-process/cronbase-0.3.2"
28 33
29PROVIDE="virtual/cron" 34PROVIDE="virtual/cron"
30 35
31# docrondir [ dir ] [ perms ] 36# @FUNCTION: docrondir
32# 37# @USAGE: [ dir ] [ perms ]
38# @DESCRIPTION:
33# Creates crontab directory 39# Creates crontab directory
34# 40#
35# Both arguments are optional. Everything after 'dir' is considered 41# Both arguments are optional. Everything after 'dir' is considered
36# the permissions (same format as insopts). 42# the permissions (same format as insopts).
37# 43#
61 67
62 # reset perms to default 68 # reset perms to default
63 diropts -m0755 69 diropts -m0755
64} 70}
65 71
72# @FUNCTION: docron
66# docron [ exe ] [ perms ] 73# @USAGE: [ exe ] [ perms ]
67# 74# @DESCRIPTION:
68# Install cron executable 75# Install cron executable
69# 76#
70# Both arguments are optional. 77# Both arguments are optional.
71# 78#
72# ex: docron -m 0700 -o root -g root ('exe' defaults to "cron") 79# ex: docron -m 0700 -o root -g root ('exe' defaults to "cron")
94 101
95 # reset perms to default 102 # reset perms to default
96 exeopts -m0755 103 exeopts -m0755
97} 104}
98 105
99# docrontab [ exe ] [ perms ] 106# @FUNCTION: docrontab
100# 107# @USAGE: [ exe ] [ perms ]
108# @DESCRIPTION:
101# Install crontab executable 109# Install crontab executable
102# 110#
103# Uses same semantics as docron. 111# Uses same semantics as docron.
104 112
105docrontab() { 113docrontab() {
130 dosym ${crontab##*/} /usr/bin/crontab || \ 138 dosym ${crontab##*/} /usr/bin/crontab || \
131 die "failed to create /usr/bin/crontab symlink" 139 die "failed to create /usr/bin/crontab symlink"
132 fi 140 fi
133} 141}
134 142
143# @FUNCTION: cron_pkg_postinst
144# @DESCRIPTION:
145# Outputs a message about system crontabs
146# daemons that have a true system crontab set CRON_SYSTEM_CRONTAB="yes"
135cron_pkg_postinst() { 147cron_pkg_postinst() {
136 echo 148 echo
137 # daemons that have a true system crontab set CRON_SYSTEM_CRONTAB="yes" 149 # daemons that have a true system crontab set CRON_SYSTEM_CRONTAB="yes"
138 if [ "${CRON_SYSTEM_CRONTAB:-no}" != "yes" ] ; then 150 if [ "${CRON_SYSTEM_CRONTAB:-no}" != "yes" ] ; then
139 einfo "To activate /etc/cron.{hourly|daily|weekly|monthly} please run:" 151 einfo "To activate /etc/cron.{hourly|daily|weekly|monthly} please run:"

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.20