chiark
/
gitweb
/
~ian
/
ian-dotfiles.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6948b0b
)
infra/substitute: do individual files
author
Ian Jackson
<ian.jackson@eu.citrix.com>
Mon, 13 Jun 2016 11:03:27 +0000
(12:03 +0100)
committer
Ian Jackson
<Ian.Jackson@eu.citrix.com>
Mon, 13 Jun 2016 11:04:07 +0000
(12:04 +0100)
infra/substitute
patch
|
blob
|
history
diff --git
a/infra/substitute
b/infra/substitute
index 112e0467055d83b131daa92ef3140239d54b8827..7ceafb3c6995459194c4cce403f2bd4f6f0af757 100755
(executable)
--- a/
infra/substitute
+++ b/
infra/substitute
@@
-6,10
+6,12
@@
mode_subst () {
}
mode_diff () {
+ mode_subst
diff -u $dot $bfn.new || test $? = 1
}
mode_install () {
+ mode_subst
mv -f $bfn.new $dot
}
@@
-20,8
+22,16
@@
subst|diff|install) ;;
esac
shift
-for fn in templates/*.in; do
+if [ $# = 0 ]; then
+ set templates/*.in
+fi
+
+for fn in "$@"; do
bfn=${fn%.in}
+ bfn=${bfn##*/}
+ bfn=${bfn#.}
+ bfn=templates/$bfn
+ fn=${bfn}.in
dot=$HOME/.${bfn#*/}
mode_$mode
done