Gentoo Archives: gentoo-commits

From: "Christian Ruppert (idl0r)" <idl0r@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-vcs/gitolite-gentoo/files: gl-setup-tempfile.patch
Date: Thu, 04 Nov 2010 18:15:30
Message-Id: 20101104181527.2E03A20054@flycatcher.gentoo.org
1 idl0r 10/11/04 18:15:27
2
3 Added: gl-setup-tempfile.patch
4 Log:
5 Revision bump. HOMEPAGE and DESCRIPTION fixed. Added a patch to fix tempfile creation in gl-setup.
6
7 (Portage version: 2.2.0_alpha3/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 dev-vcs/gitolite-gentoo/files/gl-setup-tempfile.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-vcs/gitolite-gentoo/files/gl-setup-tempfile.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-vcs/gitolite-gentoo/files/gl-setup-tempfile.patch?rev=1.1&content-type=text/plain
14
15 Index: gl-setup-tempfile.patch
16 ===================================================================
17 diff --git a/src/gl-setup b/src/gl-setup
18 index e72ebc6..f9f50a2 100755
19 --- a/src/gl-setup
20 +++ b/src/gl-setup
21 @@ -21,6 +21,9 @@ GL_PACKAGE_CONF=/tmp/share/gitolite/conf
22
23 die() { echo "$@"; exit 1; }
24
25 +TEMPDIR=$(mktemp -d)
26 +export TEMPDIR
27 +trap "/bin/rm -rf $TEMPDIR" 0
28
29 if [ -n "$GITOLITE_HTTP_HOME" ]
30 then
31 @@ -40,10 +43,10 @@ fi
32
33 if [ -f $HOME/.gitolite.rc ]
34 then
35 - perl -ne 's/^\s+//; s/[\s=].*//; print if /^\$/;' < $GL_PACKAGE_CONF/example.gitolite.rc | sort > .newvars
36 - perl -ne 's/^\s+//; s/[\s=].*//; print if /^\$/;' < $HOME/.gitolite.rc | sort > .oldvars
37 - comm -23 .newvars .oldvars > .diffvars
38 - if [ -s .diffvars ]
39 + perl -ne 's/^\s+//; s/[\s=].*//; print if /^\$/;' < $GL_PACKAGE_CONF/example.gitolite.rc | sort > $TEMPDIR/.newvars
40 + perl -ne 's/^\s+//; s/[\s=].*//; print if /^\$/;' < $HOME/.gitolite.rc | sort > $TEMPDIR/.oldvars
41 + comm -23 $TEMPDIR/.newvars $TEMPDIR/.oldvars > $TEMPDIR/.diffvars
42 + if [ -s $TEMPDIR/.diffvars ]
43 then
44 cp $GL_PACKAGE_CONF/example.gitolite.rc $HOME/.gitolite.rc.new
45 echo new version of the rc file saved in $HOME/.gitolite.rc.new
46 @@ -51,10 +54,9 @@ then
47 echo please update $HOME/.gitolite.rc manually if you need features
48 echo controlled by any of the following variables:
49 echo ----
50 - sed -e 's/^/ /' < .diffvars
51 + sed -e 's/^/ /' < $TEMPDIR/.diffvars
52 echo ----
53 fi
54 - rm -f .newvars .oldvars .diffvars
55 else
56 [ -n "$GITOLITE_HTTP_HOME" ] || [ -n "$pubkey_file" ] || die "looks like first run -- I need a pubkey file"
57 [ -z "$GITOLITE_HTTP_HOME" ] || [ -n "$admin_name" ] || die "looks like first run -- I need an admin name"