ulm         15/02/04 09:44:24

  Modified:             git-r3.eclass ChangeLog
  Log:
  Respect the EVCS_UMASK variable to override the default umask when writing to 
the repository.

Revision  Changes    Path
1.48                 eclass/git-r3.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/git-r3.eclass?rev=1.48&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/git-r3.eclass?rev=1.48&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/git-r3.eclass?r1=1.47&r2=1.48

Index: git-r3.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- git-r3.eclass       28 Jul 2014 14:13:50 -0000      1.47
+++ git-r3.eclass       4 Feb 2015 09:44:24 -0000       1.48
@@ -1,6 +1,6 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.47 2014/07/28 
14:13:50 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.48 2015/02/04 
09:44:24 ulm Exp $
 
 # @ECLASS: git-r3.eclass
 # @MAINTAINER:
@@ -131,6 +131,17 @@
 # @DESCRIPTION:
 # If non-empty, this variable prevents any online operations.
 
+# @ECLASS-VARIABLE: EVCS_UMASK
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Set this variable to a custom umask. This is intended to be set by
+# users. By setting this to something like 002, it can make life easier
+# for people who do development as non-root (but are in the portage
+# group), and then switch over to building with FEATURES=userpriv.
+# Or vice-versa. Shouldn't be a security issue here as anyone who has
+# portage group write access already can screw the system over in more
+# creative ways.
+
 # @ECLASS-VARIABLE: EGIT_BRANCH
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -309,8 +320,16 @@
 
        addwrite "${EGIT3_STORE_DIR}"
        if [[ ! -d ${GIT_DIR} ]]; then
+               local saved_umask
+               if [[ ${EVCS_UMASK} ]]; then
+                       saved_umask=$(umask)
+                       umask "${EVCS_UMASK}" || die "Bad options to umask: 
${EVCS_UMASK}"
+               fi
                mkdir "${GIT_DIR}" || die
                git init --bare || die
+               if [[ ${saved_umask} ]]; then
+                       umask "${saved_umask}" || die
+               fi
        fi
 }
 
@@ -507,7 +526,11 @@
        fi
 
        # try to fetch from the remote
-       local r success
+       local r success saved_umask
+       if [[ ${EVCS_UMASK} ]]; then
+               saved_umask=$(umask)
+               umask "${EVCS_UMASK}" || die "Bad options to umask: 
${EVCS_UMASK}"
+       fi
        for r in "${repos[@]}"; do
                einfo "Fetching ${r} ..."
 
@@ -668,6 +691,9 @@
                        break
                fi
        done
+       if [[ ${saved_umask} ]]; then
+               umask "${saved_umask}" || die
+       fi
        [[ ${success} ]] || die "Unable to fetch from any of EGIT_REPO_URI"
 
        # submodules can reference commits in any branch



1.1521               eclass/ChangeLog

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1521&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1521&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1520&r2=1.1521

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1520
retrieving revision 1.1521
diff -u -r1.1520 -r1.1521
--- ChangeLog   1 Feb 2015 12:01:06 -0000       1.1520
+++ ChangeLog   4 Feb 2015 09:44:24 -0000       1.1521
@@ -1,6 +1,10 @@
 # ChangeLog for eclass directory
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1520 2015/02/01 
12:01:06 dilfridge Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1521 2015/02/04 
09:44:24 ulm Exp $
+
+  04 Feb 2015; Ulrich Müller <[email protected]> git-r3.eclass:
+  Respect the EVCS_UMASK variable to override the default umask when writing
+  to the repository.
 
   01 Feb 2015; Andreas K. Huettel <[email protected]> perl-module.eclass:
   Drop support for EAPI=4




Reply via email to