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 380A31387D4 for ; Thu, 16 Oct 2014 17:41:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 47788E083E; Thu, 16 Oct 2014 17:41:37 +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 EFB29E083D for ; Thu, 16 Oct 2014 17:41:36 +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 213F634039B for ; Thu, 16 Oct 2014 17:41:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6A1F5809D for ; Thu, 16 Oct 2014 17:41:32 +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: <1413232776.43d727dc3f17bc9a1d020ed2a5684d4a26bb620a.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:openrc-0.13.x 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: 43d727dc3f17bc9a1d020ed2a5684d4a26bb620a X-VCS-Branch: openrc-0.13.x Date: Thu, 16 Oct 2014 17:41:32 +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: db92365d-b0f2-4884-9ad8-0cc026f1d4b1 X-Archives-Hash: 8e53cfcd986410f867c58e2cb3d884e4 commit: 43d727dc3f17bc9a1d020ed2a5684d4a26bb620a Author: Andrew Gregory gmail com> AuthorDate: Mon Aug 25 19:46:28 2014 +0000 Commit: William Hubbs gentoo 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