From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc:openrc-0.13.x commit in: sh/
Date: Thu, 16 Oct 2014 17:41:32 +0000 (UTC) [thread overview]
Message-ID: <1413232776.43d727dc3f17bc9a1d020ed2a5684d4a26bb620a.williamh@OpenRC> (raw)
commit: 43d727dc3f17bc9a1d020ed2a5684d4a26bb620a
Author: Andrew Gregory <andrew.gregory.8 <AT> gmail <DOT> com>
AuthorDate: Mon Aug 25 19:46:28 2014 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Oct 13 20:39:36 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=43d727dc
tmpfiles.sh: add support for C action
Recursively copies files or directories. Added by systemd in 849958d1.
---
sh/tmpfiles.sh.in | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in
index 41f86cf..6e7be42 100755
--- a/sh/tmpfiles.sh.in
+++ b/sh/tmpfiles.sh.in
@@ -80,6 +80,17 @@ _c() {
fi
}
+_C() {
+ # recursively copy a file or directory
+ local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6
+ if [ ! -e "$path" ]; then
+ dryrun_or_real cp -r "$arg" "$path"
+ _restorecon "$path"
+ [ $uid != '-' ] && dryrun_or_real chown "$uid" "$path"
+ [ $gid != '-' ] && dryrun_or_real chgrp "$gid" "$path"
+ [ $mode != '-' ] && dryrun_or_real chmod "$mode" "$path"
+ fi
+}
_f() {
# Create a file if it doesn't exist yet
@@ -325,7 +336,7 @@ for FILE in $tmpfiles_d ; do
# whine about invalid entries
case $cmd in
- f|F|w|d|D|p|L|c|b|x|X|r|R|z|Z) ;;
+ f|F|w|d|D|p|L|c|C|b|x|X|r|R|z|Z) ;;
*) warninvalid ; continue ;;
esac
@@ -334,7 +345,7 @@ for FILE in $tmpfiles_d ; do
case "$cmd" in
p|f|F) mode=0644 ;;
d|D) mode=0755 ;;
- z|Z|x|r|R|L) ;;
+ C|z|Z|x|r|R|L) ;;
esac
fi
next reply other threads:[~2014-10-16 17:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-16 17:41 William Hubbs [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-01-15 16:01 [gentoo-commits] proj/openrc:openrc-0.13.x commit in: sh/ William Hubbs
2014-10-16 17:41 William Hubbs
2014-10-16 17:41 William Hubbs
2014-10-16 17:41 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=1413232776.43d727dc3f17bc9a1d020ed2a5684d4a26bb620a.williamh@OpenRC \
--to=williamh@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