Changeset View
Standalone View
libexec/rc/rc.subr
Show First 20 Lines • Show All 2,077 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
find_local_scripts_new() { | find_local_scripts_new() { | ||||
local_rc='' | local_rc='' | ||||
for dir in ${local_startup}; do | for dir in ${local_startup}; do | ||||
if [ -d "${dir}" ]; then | if [ -d "${dir}" ]; then | ||||
for file in `grep -l '^# PROVIDE:' ${dir}/* 2>/dev/null`; do | for file in `grep -l '^# PROVIDE:' ${dir}/* 2>/dev/null`; do | ||||
case "$file" in | case "$file" in | ||||
*.sample) ;; | *.sample|*.pkgsave) ;; | ||||
kevans: I don't think we want this part, though. If you end up with .pkgnew or .pkgsave in the local… | |||||
Done Inline Actionswe could move this to the part that has a *warning* about a bunch fragments: run_rc_script() … *[~#]|*.OLD|*.bak|*.orig|*,v) # scratch file; skip warn "Ignoring scratch file $_file" ;; freebsd_igalic.co: we could move this to the part that has a *warning* about a bunch fragments:
```
run_rc_script… | |||||
Not Done Inline ActionsIf you did this, add *~ to the list too... emacs backup files should be ignored too. imp: If you did this, add *~ to the list too... emacs backup files should be ignored too. | |||||
*) if [ -x "$file" ]; then | *) if [ -x "$file" ]; then | ||||
local_rc="${local_rc} ${file}" | local_rc="${local_rc} ${file}" | ||||
fi | fi | ||||
;; | ;; | ||||
esac | esac | ||||
done | done | ||||
fi | fi | ||||
done | |||||
} | |||||
find_system_scripts() { | |||||
system_rc='' | |||||
for file in /etc/rc.d/*; do | |||||
case "${file##*/}" in | |||||
*.pkgsave) ;; | |||||
Done Inline ActionsSkipping any file with "." in it seems a bit harsh. rc.subr is used by the scripts in /usr/local/etc/rc.d too, including anything users might write for local things. You're basically deciding that people can't have scripts named "mything.dev" "mything.test" "mything.prod" etc. without any way of knowing why this one case silently breaks. Seems not ideal to me. swills: Skipping any file with "." in it seems a bit harsh. rc.subr is used by the scripts in… | |||||
Done Inline Actionsas you can see from the function name, this is restricted to /etc/rc.d /usr/local/etc/rc.d has other restrictions, which we only extended however, we could log this skip case, so people know what's up freebsd_igalic.co: as you can see from the function name, this is restricted to `/etc/rc.d`
`/usr/local/etc/rc.d`… | |||||
Done Inline ActionsAh, right. Still, might be better to only skip the things we know need to be skipped, IMHO. swills: Ah, right. Still, might be better to only skip the things we know need to be skipped, IMHO. | |||||
Not Done Inline ActionsWe should also skip *.pkgnew here kevans: We should also skip *.pkgnew here | |||||
*) if [ -x "$file" ]; then | |||||
system_rc="${system_rc} ${file}" | |||||
fi | |||||
;; | |||||
esac | |||||
done | done | ||||
} | } | ||||
# check_required_{before|after} command | # check_required_{before|after} command | ||||
# Check for things required by the command before and after its precmd, | # Check for things required by the command before and after its precmd, | ||||
# respectively. The two separate functions are needed because some | # respectively. The two separate functions are needed because some | ||||
# conditions should prevent precmd from being run while other things | # conditions should prevent precmd from being run while other things | ||||
# depend on precmd having already been run. | # depend on precmd having already been run. | ||||
▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines |
I don't think we want this part, though. If you end up with .pkgnew or .pkgsave in the local scripts, then that's indicative of a real problem -- this is based on a vague recollection of a remark by @bapt that ports trying to mark anything as config file rather than using the sample mechanism should be smacked with an oversized broomstick.