From f45ff34100d7e3302ced6a3bdf46c15b5a1ac3b4 Mon Sep 17 00:00:00 2001 From: Scott Bronson Date: Thu, 20 Mar 2008 02:37:26 -0700 Subject: Simplify the store-metadata script by calling chmod every time. --- pre-commit.d/30store-metadata | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'pre-commit.d/30store-metadata') diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata index c3927e0..93e1202 100755 --- a/pre-commit.d/30store-metadata +++ b/pre-commit.d/30store-metadata @@ -54,16 +54,13 @@ generate_metadata() { if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ]; then - # ensure the file exists so that it will list its own metadata - if [ ! -e .etckeeper ]; then - touch .etckeeper - # Make sure the file is not readable by others, since it can leak - # information about contents of non-readable directories in /etc. - chmod 700 .etckeeper - fi - echo "# Generated by etckeeper. Do not edit." > .etckeeper echo >> .etckeeper + + # Make sure the file is not readable by others, since it can leak + # information about contents of non-readable directories in /etc. + chmod 700 .etckeeper + generate_metadata >> .etckeeper # stage the file as part of the current commit -- cgit v1.2.3