Helper scripts for ccollect 0.4
Migrating to ccollect 0.4 is supported by the helper scripts.
This commit is contained in:
parent
50634eeac0
commit
83e8262e47
3 changed files with 63 additions and 0 deletions
24
tools/config-pre-0.4-to-0.4.BUGS
Normal file
24
tools/config-pre-0.4-to-0.4.BUGS
Normal file
|
@ -0,0 +1,24 @@
|
|||
The scripts are only for 'standard' configurations.
|
||||
|
||||
If you've multiple directories named 'intervalls', the
|
||||
scripts will try to replace _all_ instances of intervalls with
|
||||
"intervals".
|
||||
|
||||
This will fail:
|
||||
|
||||
intervalls/defaults/intervalls/ exists before.
|
||||
|
||||
Then we'll replace the first time:
|
||||
|
||||
intervals/defaults/intervalls/ exists now.
|
||||
|
||||
Then find will fail, as the first directory disappeared.
|
||||
|
||||
Also, if you have a source named 'intervalls'
|
||||
(why so ever you would want to have something like that) and
|
||||
a 'intervalls' directory below it, it will rename your source.
|
||||
|
||||
Yes this is a bug.
|
||||
|
||||
No, I do not care about it, this is just a dumb helper script which
|
||||
should be used once.
|
18
tools/config-pre-0.4-to-0.4.sh
Executable file
18
tools/config-pre-0.4-to-0.4.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
# Nico Schottelius
|
||||
# Do Apr 27 09:13:26 CEST 2006
|
||||
#
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "$0: ccollect-configuration directory"
|
||||
echo ""
|
||||
echo " Fix pre 0.4 configuration directories to match 0.4 style"
|
||||
echo ""
|
||||
exit 23
|
||||
fi
|
||||
|
||||
script=$(echo $0 | sed 's/\.sh/.sub.sh/')
|
||||
|
||||
find "$1" -type d -name intervalls -exec "$script" {} \;
|
||||
|
||||
|
21
tools/config-pre-0.4-to-0.4.sub.sh
Executable file
21
tools/config-pre-0.4-to-0.4.sub.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
# Nico Schottelius
|
||||
# Do Apr 27 09:13:26 CEST 2006
|
||||
#
|
||||
|
||||
master=$(echo $0 | sed 's/\.sub//')
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "$0: DO NOT CALL ME DIRECTLY"
|
||||
echo "$master calls me for moving"
|
||||
exit 23
|
||||
fi
|
||||
|
||||
# strip trailing /
|
||||
oldname=$(echo $1 | sed 's,/$,,')
|
||||
|
||||
# replace the last component of the path "intervalls"
|
||||
newname=$(echo $oldname | sed 's/intervalls$/intervals/')
|
||||
|
||||
echo mv "$oldname" "$newname"
|
||||
mv "$oldname" "$newname"
|
Loading…
Reference in a new issue