From: "Christian Ruppert" <idl0r@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc:master commit in: init.d/, sh/
Date: Sat, 28 Jan 2012 18:32:26 +0000 (UTC) [thread overview]
Message-ID: <fb4aa20d053d055a83cf25f07f4185ea79cb7b30.idl0r@gentoo> (raw)
commit: fb4aa20d053d055a83cf25f07f4185ea79cb7b30
Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 28 18:32:05 2012 +0000
Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
CommitDate: Sat Jan 28 18:32:05 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=fb4aa20d
Use "checkpath -W" instead of dir_writable()
---
init.d/bootmisc.in | 8 ++++----
init.d/consolefont.in | 2 +-
init.d/keymaps.in | 2 +-
init.d/termencoding.in | 2 +-
sh/runscript.sh.in | 5 -----
5 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in
index d75cb6e..a2afbf9 100644
--- a/init.d/bootmisc.in
+++ b/init.d/bootmisc.in
@@ -20,7 +20,7 @@ cleanup_tmp_dir()
if ! [ -d "$dir" ]; then
mkdir -p "$dir" || return $?
fi
- dir_writable "$dir" || return 1
+ checkpath -W "$dir" || return 1
chmod a+rwt "$dir" 2> /dev/null
cd "$dir" || return 1
if yesno $wipe_tmp; then
@@ -117,7 +117,7 @@ start()
migrate_to_run /var/run /run
fi
- if dir_writable /var/run; then
+ if checkpath -W /var/run; then
ebegin "Creating user login records"
local xtra=
[ "$RC_UNAME" = NetBSD ] && xtra=x
@@ -159,7 +159,7 @@ start()
cleanup_tmp_dir "$tmp"
done
- if dir_writable /tmp; then
+ if checkpath -W /tmp; then
# Make sure our X11 stuff have the correct permissions
# Omit the chown as bootmisc is run before network is up
# and users may be using lame LDAP auth #139411
@@ -172,7 +172,7 @@ start()
fi
if yesno $log_dmesg; then
- if $logw || dir_writable /var/log; then
+ if $logw || checkpath -W /var/log; then
# Create an 'after-boot' dmesg log
if [ "$RC_SYS" != VSERVER -a "$RC_SYS" != OPENVZ ]; then
dmesg > /var/log/dmesg
diff --git a/init.d/consolefont.in b/init.d/consolefont.in
index 2f046d8..66b780d 100644
--- a/init.d/consolefont.in
+++ b/init.d/consolefont.in
@@ -54,7 +54,7 @@ start()
eend $retval
# Store the last font so we can use it ASAP on boot
- if [ $retval -eq 0 ] && dir_writable "$RC_LIBEXECDIR"; then
+ if [ $retval -eq 0 ] && checkpath -W "$RC_LIBEXECDIR"; then
mkdir -p "$RC_LIBEXECDIR"/console
for font in /usr/share/consolefonts/"$consolefont".*; do
:
diff --git a/init.d/keymaps.in b/init.d/keymaps.in
index 851af5e..a55a0e0 100644
--- a/init.d/keymaps.in
+++ b/init.d/keymaps.in
@@ -63,7 +63,7 @@ start()
fi
# Save the keymapping for use immediately at boot
- if dir_writable "$RC_LIBEXECDIR"; then
+ if checkpath -W "$RC_LIBEXECDIR"; then
mkdir -p "$RC_LIBEXECDIR"/console
dumpkeys >"$RC_LIBEXECDIR"/console/keymap
fi
diff --git a/init.d/termencoding.in b/init.d/termencoding.in
index b421898..af4ed15 100644
--- a/init.d/termencoding.in
+++ b/init.d/termencoding.in
@@ -35,7 +35,7 @@ start()
done
# Save the encoding for use immediately at boot
- if dir_writable "$RC_LIBEXECDIR"; then
+ if checkpath -W "$RC_LIBEXECDIR"; then
mkdir -p "$RC_LIBEXECDIR"/console
if yesno ${unicode:-${UNICODE}}; then
echo "" > "$RC_LIBEXECDIR"/console/unicode
diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index faa85cc..18bf4c3 100644
--- a/sh/runscript.sh.in
+++ b/sh/runscript.sh.in
@@ -4,11 +4,6 @@
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
-dir_writable()
-{
- mkdir "$1"/.test.$$ 2>/dev/null && rmdir "$1"/.test.$$
-}
-
sourcex()
{
if [ "$1" = "-e" ]; then
next reply other threads:[~2012-01-28 18:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-28 18:32 Christian Ruppert [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-04-03 18:05 [gentoo-commits] proj/openrc:master commit in: init.d/, sh/ William Hubbs
2013-02-17 2:49 William Hubbs
2012-02-20 23:11 William Hubbs
2012-01-22 18:00 William Hubbs
2011-12-20 4:01 William Hubbs
2011-11-19 0:05 William Hubbs
2011-10-16 23:02 Mike Frysinger
2011-07-05 23:42 William Hubbs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fb4aa20d053d055a83cf25f07f4185ea79cb7b30.idl0r@gentoo \
--to=idl0r@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox