Changeset View
Standalone View
mail/mailman/files/pkg-install.in
Show All 24 Lines | |||||
# This and the next three lines added by FreeBSD's post-install script | # This and the next three lines added by FreeBSD's post-install script | ||||
DEFAULT_EMAIL_HOST="$(hostname -f)" | DEFAULT_EMAIL_HOST="$(hostname -f)" | ||||
DEFAULT_URL_HOST="$(hostname -f)" | DEFAULT_URL_HOST="$(hostname -f)" | ||||
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) | add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) | ||||
_EOF | _EOF | ||||
} | } | ||||
move_newsyslog_conf() { | |||||
oldfile=${PKG_PREFIX}/etc/newsyslog.conf.d/mailman.newsyslog | |||||
newfile=${PKG_PREFIX}/etc/newsyslog.conf.d/mailman.conf | |||||
if [ -f ${oldfile} ]; then | |||||
mandree: looks dangerous to me. what if both are present - which one should get precedence? Currently… | |||||
echo Migrating ${oldfile} to ${newfile} | |||||
mv -v ${oldfile} ${newfile} | |||||
fi | |||||
} | |||||
set -e | set -e | ||||
MYTMP="$(mktemp -d "${TMPDIR-/tmp}/mminstall.XXXXXXXXXX")" | MYTMP="$(mktemp -d "${TMPDIR-/tmp}/mminstall.XXXXXXXXXX")" | ||||
trap "rm -rf \"$MYTMP\"" EXIT | trap "rm -rf \"$MYTMP\"" EXIT | ||||
Not Done Inline ActionsThe logic is right, yet I would also like to see the location/name of $oldfile printed out. But that can happen later. Let's move. mandree: The logic is right, yet I would also like to see the location/name of $oldfile printed out. But… | |||||
case "$2" in | case "$2" in | ||||
Done Inline Actions2018-11-25: please remove this, and instead request that the user cleans up. mandree: 2018-11-25: please remove this, and instead request that the user cleans up. | |||||
Done Inline ActionsThis was discussed for the sysutils/munin-* phabricator review here: Your proposal to ask the user clean it up is essentially option 4 in my proposal. mat@ opted for option 3 which was to delete the old file. My understanding of the logic behind this is that if the file is the new location varies from the sample file, then the sysadmin must have modified it (knowing about the new location), and therefore the file in the old location is obsolete. woodsb02: This was discussed for the sysutils/munin-* phabricator review here:
https://reviews.freebsd. | |||||
POST-INSTALL) | POST-INSTALL) | ||||
echo "---> Starting post-install script" | echo "---> Starting post-install script" | ||||
LC_ALL=C | LC_ALL=C | ||||
export LC_ALL | export LC_ALL | ||||
move_newsyslog_conf | |||||
# fix up permissions - this is under investigation; pkg or libarchive | # fix up permissions - this is under investigation; pkg or libarchive | ||||
mandreeUnsubmitted Not Done Inline ActionsWhile at it, I am wondering if this is still needed, or if pkg has been fixed in the meanwhile. mandree: While at it, I am wondering if this is still needed, or if pkg has been fixed in the meanwhile. | |||||
# goof up the group writable and/or setgid bits | # goof up the group writable and/or setgid bits | ||||
/usr/bin/find "%%MAILMANDIR%%/qfiles" -maxdepth 1 -type d -exec \ | /usr/bin/find "%%MAILMANDIR%%/qfiles" -maxdepth 1 -type d -exec \ | ||||
/bin/chmod u+rwx,g+rwsx,o-w "{}" + | /bin/chmod u+rwx,g+rwsx,o-w "{}" + | ||||
/bin/chmod 02775 "%%MAILMANDIR%%" \ | /bin/chmod 02775 "%%MAILMANDIR%%" \ | ||||
"%%MAILMANDIR%%/Mailman" \ | "%%MAILMANDIR%%/Mailman" \ | ||||
"%%MAILMANDIR%%/bin" \ | "%%MAILMANDIR%%/bin" \ | ||||
"%%MAILMANDIR%%/cgi-bin" \ | "%%MAILMANDIR%%/cgi-bin" \ | ||||
"%%MAILMANDIR%%/icons" \ | "%%MAILMANDIR%%/icons" \ | ||||
▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines |
looks dangerous to me. what if both are present - which one should get precedence? Currently, the older will. The file should only be renamed if that renaming does not clobber the destination file.