git.samba.org
/
jelmer
/
etckeeper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ff7971
)
Turns out dash doesn't support ${string:substibution}. Use printf instead.
author
Scott Bronson
<b.git@u32.net>
Thu, 20 Mar 2008 08:49:26 +0000
(
01:49
-0700)
committer
Scott Bronson
<b.git@u32.net>
Thu, 20 Mar 2008 08:49:26 +0000
(
01:49
-0700)
pre-commit.d/30store-metadata
patch
|
blob
|
history
diff --git
a/pre-commit.d/30store-metadata
b/pre-commit.d/30store-metadata
index 5190a2c5c691428c7144fc8060f0266e1f654896..fbd9096fdc070e91baf153db2c5199e2e1e4341b 100755
(executable)
--- a/
pre-commit.d/30store-metadata
+++ b/
pre-commit.d/30store-metadata
@@
-6,9
+6,9
@@
set -e
filter_unknown() {
CMD=$1
while read line; do
- if [ "${line:0:8+${#CMD}}" = "$CMD UNKNOWN" ]; then
- # error message like "Bad owner for ./ppp/peers"
- echo Bad "$2" for "$
{line:9+${#CMD}}
" >&2
+ # if the first n chars of $line equal "$CMD UNKNOWN "...
+ if [ "$(printf %.$((9+${#CMD}))s "$line")" = "$CMD UNKNOWN " ]; then
+ echo Bad "$2" for "$
line
" >&2
else
echo "$line"
fi