From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9CE6513877A for ; Thu, 28 Aug 2014 14:49:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 317E0E07F7; Thu, 28 Aug 2014 14:49:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C725AE07F7 for ; Thu, 28 Aug 2014 14:49:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F39C333FFF7 for ; Thu, 28 Aug 2014 14:49:57 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9D2744193 for ; Thu, 28 Aug 2014 14:49:56 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1409179740.d4204a97a2410fcf37a64385204e6452c6958e8d.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: sh/ X-VCS-Repository: proj/openrc X-VCS-Files: sh/tmpfiles.sh.in X-VCS-Directories: sh/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: d4204a97a2410fcf37a64385204e6452c6958e8d X-VCS-Branch: master Date: Thu, 28 Aug 2014 14:49:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 621cb645-762e-407d-b198-2e70e6af6c7a X-Archives-Hash: 5296f04238a39d07c560c5474d620f62 commit: d4204a97a2410fcf37a64385204e6452c6958e8d Author: Andrew Gregory gmail com> AuthorDate: Mon Aug 25 19:46:28 2014 +0000 Commit: William Hubbs gentoo org> CommitDate: Wed Aug 27 22:49:00 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=d4204a97 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