rcsvi - держать конфиги под rcs (rcs config)
Ключевые слова: rcs, config, (найти похожие документы)
_ RU.LINUX (2:5077/15.22) ___________________________________________ RU.LINUX _
From : Yuriy Kaminskiy 2:5020/517.21 10 Dec 99 03:00:04
Subj : rcsvi - держать конфиги под rcs
________________________________________________________________________________
--Multipart_Fri_Dec_10_03:00:04_1999-1
Content-Type: text/plain; charset=KOI8-R
Hello, Ivan!
>>>>> On 16:45 09/12/1999, Ivan Tihonov <2:5080/140> writes:
DZ> При таком подходе можно и не знать, где чего поправил...
IT> Это наводит на мысль: и когда же люди будут держать конфиги под
IT> rcs...
Угу. Hint:
--Multipart_Fri_Dec_10_03:00:04_1999-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="rcsvi"
Content-Transfer-Encoding: 7bit
#!/bin/bash
warning=0
skip=0
prog="${0##*/}"
vi="${prog#rcs}"
[ -z "$vi" -o "$vi" == "$prog" ] && vi=vi
rcsfiles=""
for f in "$@";do
if [ $skip != 0 ]; then
skip=$[$skip-1]
continue
fi
case "$f" in
-[cswWui])
skip=1
continue ;;
-*) continue ;;
esac
if [ -e "$f" ]; then
d="${f%/*}"
[ "$d" == "$f" ] && d="."
if [ \! -w "$d" ]; then
echo "$prog: Warning: directory $d read-only,\
skipping file $f" >&2
warning=$[$warning+1]
continue
elif [ -d "$d/RCS" -a \! -w "$d/RCS" ]; then
echo "$prog: Warning: directory $d/RCS read-only,\
skipping file $f" >&2
warning=$[$warning+1]
continue
fi
rf="$f,v"
[ -e "$rf" -o \! -d "$d/RCS" ] || rf="$d/RCS/$f,v"
if [ -e "$rf" ]; then
#if [ -z "`rcslog -L -R $rf`" ]; then
#fi
co -l "$f"
else
ci -u -nORIG -k -d "$f" || ci -l -nORIG -d "$f"
rcs -ko -l "$f" && chmod u+w "$f"
fi
rcsfiles="$rcsfiles $f"
else
echo "$prog: Warning: file $f does not exists" >&2
warning=$[$warning+1]
fi
done
[ $warning == 0 ] || { echo "[$warning warning(s)]" >&2; sleep 3s; }
$vi "$@"
rc=$?
[ -z "$rcsfiles" ] && exit $rc
for f in $rcsfiles; do
ci -u $f
done
--Multipart_Fri_Dec_10_03:00:04_1999-1
Content-Type: text/plain; charset=US-ASCII
--
Yuriy Kaminskiy.
--Multipart_Fri_Dec_10_03:00:04_1999-1--
--- Gnus v5.2.25/XEmacs 19.14
* Origin: Kyle Katan's station (2:5020/517.21@fidonet)