summaryrefslogtreecommitdiff
path: root/pre-commit.d
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-03 00:47:22 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-03 00:47:22 -0400
commit682dca8fd09fd2fec335dc98f2cd4279c56f65b2 (patch)
tree2de1d85aa936802d943d6469682b4e9853176cb1 /pre-commit.d
parentc61e40582a5016963ad8ed0b06cfee3d8cb66a34 (diff)
Don't allow LC_COLLATE to reorder the .etckeeper file. Closes: #489057
Diffstat (limited to 'pre-commit.d')
-rwxr-xr-xpre-commit.d/30store-metadata7
1 files changed, 4 insertions, 3 deletions
diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata
index bed2d89..243e019 100755
--- a/pre-commit.d/30store-metadata
+++ b/pre-commit.d/30store-metadata
@@ -1,7 +1,6 @@
#!/bin/sh
set -e
-
# Filters out UNKNOWN users and groups, prints a warning on stderr.
filter_unknown() {
CMD=$1
@@ -15,7 +14,6 @@ filter_unknown() {
done
}
-
generate_metadata() {
# This function generates the script commands to fix any files
# that aren't owner=root, group=root, or mode=0644 or 0755.
@@ -25,6 +23,10 @@ generate_metadata() {
# but we want find to ignore the VCS files themselves.
NOVCS='. -wholename ./.git -prune -o -wholename ./.bzr -prune -o -wholename ./.hg -prune -o'
+ # Keep the sort order the same at all times.
+ LC_COLLATE=C
+ export LC_COLLATE
+
if [ "$VCS" = git ] || [ "$VCS" = hg ]; then
# These version control systems do not track directories,
# so empty directories must be stored specially.
@@ -52,7 +54,6 @@ generate_metadata() {
# Maybe check for getfattr/setfattr and use them if they're available?
}
-
if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ]; then
if [ -f .metadata ]; then
# remove obsolete .metadata file