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

Diff of /eclass/cron.eclass

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

Revision 1.8 Revision 1.9
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.8 2005/07/11 15:08:06 swegener Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cron.eclass,v 1.9 2005/09/06 04:20:02 vapier 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
18 18
19EXPORT_FUNCTIONS pkg_postinst 19EXPORT_FUNCTIONS pkg_postinst
20 20
21SLOT="0" 21SLOT="0"
22 22
23DEPEND="virtual/libc
24 >=sys-apps/sed-4.0.5" 23DEPEND=">=sys-apps/sed-4.0.5"
25 24
26RDEPEND="!virtual/cron 25RDEPEND="!virtual/cron
27 virtual/mta 26 virtual/mta
28 >=sys-process/cronbase-0.2.1-r3" 27 >=sys-process/cronbase-0.2.1-r3"
29 28
42 41
43docrondir() { 42docrondir() {
44 # defaults 43 # defaults
45 local perms="-m0750 -o root -g cron" dir="/var/spool/cron/crontabs" 44 local perms="-m0750 -o root -g cron" dir="/var/spool/cron/crontabs"
46 45
47 if [[ -n "$1" ]] ; then 46 if [[ -n $1 ]] ; then
48 case "$1" in 47 case "$1" in
49 */*) 48 */*)
50 dir="$1" 49 dir=$1
51 shift 50 shift
52 [[ -n "$1" ]] && perms="$@" 51 [[ -n $1 ]] && perms="$@"
53 ;; 52 ;;
54 *) 53 *)
55 perms="$@" 54 perms="$@"
56 ;; 55 ;;
57 esac 56 esac
74# docron crond -m 0110 73# docron crond -m 0110
75 74
76docron() { 75docron() {
77 local cron="cron" perms="-m 0750 -o root -g wheel" 76 local cron="cron" perms="-m 0750 -o root -g wheel"
78 77
79 if [[ -n "$1" ]] ; then 78 if [[ -n $1 ]] ; then
80 case "$1" in 79 case "$1" in
81 -*) 80 -*)
82 perms="$@" 81 perms="$@"
83 ;; 82 ;;
84 *) 83 *)
85 cron="$1" 84 cron=$1
86 shift 85 shift
87 [[ -n "$1" ]] && perms="$@" 86 [[ -n $1 ]] && perms="$@"
88 ;; 87 ;;
89 esac 88 esac
90 fi 89 fi
91 90
92 exeopts ${perms} 91 exeopts ${perms}
104# Uses same semantics as docron. 103# Uses same semantics as docron.
105 104
106docrontab() { 105docrontab() {
107 local crontab="crontab" perms="-m 4750 -o root -g cron" 106 local crontab="crontab" perms="-m 4750 -o root -g cron"
108 107
109 if [[ -n "$1" ]] ; then 108 if [[ -n $1 ]] ; then
110 case "$1" in 109 case "$1" in
111 -*) 110 -*)
112 perms="$@" 111 perms="$@"
113 ;; 112 ;;
114 *) 113 *)
115 crontab="$1" 114 crontab=$1
116 shift 115 shift
117 [[ -n "$1" ]] && perms="$@" 116 [[ -n $1 ]] && perms="$@"
118 ;; 117 ;;
119 esac 118 esac
120 fi 119 fi
121 120
122 exeopts ${perms} 121 exeopts ${perms}

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.20