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

Diff of /eclass/cron.eclass

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

Revision 1.3 Revision 1.6
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 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.3 2005/03/04 23:25:25 ciaranm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cron.eclass,v 1.6 2005/07/06 20:20:03 agriffis Exp $
4 4
5# Original Author: Aaron Walker <ka0ttic@gentoo.org> 5# Original Author: Aaron Walker <ka0ttic@gentoo.org>
6# 6#
7# Purpose: The main motivation for this eclass was to simplify 7# Purpose: The main motivation for this eclass was to simplify
8# the jungle known as src_install() in cron ebuilds. Using these 8# the jungle known as src_install() in cron ebuilds. Using these
14# 14#
15# Please assign any bugs regarding this eclass to cron-bugs@gentoo.org. 15# Please assign any bugs regarding this eclass to cron-bugs@gentoo.org.
16 16
17inherit eutils flag-o-matic 17inherit eutils flag-o-matic
18 18
19ECLASS="cron"
20INHERITED="$INHERITED $ECLASS" 19INHERITED="$INHERITED $ECLASS"
21EXPORT_FUNCTIONS pkg_postinst 20EXPORT_FUNCTIONS pkg_postinst
22 21
23SLOT="0" 22SLOT="0"
24 23
45# docrondir -m0700 (uses default dir) 44# docrondir -m0700 (uses default dir)
46 45
47docrondir() { 46docrondir() {
48 # defaults 47 # defaults
49 local perms="-m0750 -o root -g cron" dir="/var/spool/cron/crontabs" 48 local perms="-m0750 -o root -g cron" dir="/var/spool/cron/crontabs"
50 49
51 if [[ -n "$1" ]] ; then 50 if [[ -n "$1" ]] ; then
52 case "$1" in 51 case "$1" in
53 */*) 52 */*)
54 dir="$1" 53 dir="$1"
55 shift 54 shift
76# 75#
77# ex: docron -m 0700 -o root -g root ('exe' defaults to "cron") 76# ex: docron -m 0700 -o root -g root ('exe' defaults to "cron")
78# docron crond -m 0110 77# docron crond -m 0110
79 78
80docron() { 79docron() {
81 local cron="cron" perms="-m 0750 -o root -g root" 80 local cron="cron" perms="-m 0750 -o root -g wheel"
82 81
83 if [[ -n "$1" ]] ; then 82 if [[ -n "$1" ]] ; then
84 case "$1" in 83 case "$1" in
85 -*) 84 -*)
86 perms="$@" 85 perms="$@"
135 dosym ${crontab##*/} /usr/bin/crontab || \ 134 dosym ${crontab##*/} /usr/bin/crontab || \
136 die "failed to create /usr/bin/crontab symlink" 135 die "failed to create /usr/bin/crontab symlink"
137 fi 136 fi
138} 137}
139 138
140cron-pkg_postinst() { 139cron_pkg_postinst() {
141 echo 140 echo
142 # vixie is the only daemon that has a true system crontab 141 # vixie is the only daemon that has a true system crontab
143 if [[ "${PN}" != "vixie-cron" ]] ; then 142 if [[ "${PN}" != "vixie-cron" ]] ; then
144 einfo "To activate /etc/cron.{hourly|daily|weekly|monthly} please run:" 143 einfo "To activate /etc/cron.{hourly|daily|weekly|monthly} please run:"
145 einfo " crontab /etc/crontab" 144 einfo " crontab /etc/crontab"
146 einfo 145 einfo
147 einfo "!!! That will replace root's current crontab !!!" 146 einfo "!!! That will replace root's current crontab !!!"
148 einfo 147 einfo
149 fi 148 fi
150 149
151 einfo "You may wish to read the Gentoo Linux Cron Guide, which can be" 150 einfo "You may wish to read the Gentoo Linux Cron Guide, which can be"
152 einfo "found online at:" 151 einfo "found online at:"
153 einfo " http://www.gentoo.org/doc/en/cron-guide.xml" 152 einfo " http://www.gentoo.org/doc/en/cron-guide.xml"
154 echo 153 echo
155} 154}

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20