Index: ossp-pkg/svs/.cvsignore RCS File: /v/ossp/cvs/ossp-pkg/svs/.cvsignore,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/svs/.cvsignore,v' | diff -u /dev/null - -L'ossp-pkg/svs/.cvsignore' 2>/dev/null --- ossp-pkg/svs/.cvsignore +++ - 2024-05-02 23:46:31.536890147 +0200 @@ -0,0 +1,5 @@ +configure +shtool +Makefile +svs +svs.1 Index: ossp-pkg/svs/AUTHORS RCS File: /v/ossp/cvs/ossp-pkg/svs/AUTHORS,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/svs/AUTHORS,v' | diff -u /dev/null - -L'ossp-pkg/svs/AUTHORS' 2>/dev/null --- ossp-pkg/svs/AUTHORS +++ - 2024-05-02 23:46:31.539473884 +0200 @@ -0,0 +1,15 @@ + _ ___ ____ ____ ____ + |_|_ _ / _ \/ ___/ ___|| _ \ _____ _____ + _|_||_| | | | \___ \___ \| |_) | / __\ \ / / __| + |_||_|_| | |_| |___) |__) | __/ \__ \\ V /\__ \ + |_|_|_| \___/|____/____/|_| |___/ \_/ |___/ + + OSSP svs - Stupid/Silly/Simple Versioning System + + This is a list of authors who have written + or edited parts of the OSSP svs sources. + + o OSSP svs (as a whole) + Written by: Ralf S. Engelschall + Edited by: Ralf S. Engelschall + Index: ossp-pkg/svs/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/svs/ChangeLog,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/svs/ChangeLog,v' | diff -u /dev/null - -L'ossp-pkg/svs/ChangeLog' 2>/dev/null --- ossp-pkg/svs/ChangeLog +++ - 2024-05-02 23:46:31.542012102 +0200 @@ -0,0 +1,15 @@ + _ ___ ____ ____ ____ + |_|_ _ / _ \/ ___/ ___|| _ \ _____ _____ + _|_||_| | | | \___ \___ \| |_) | / __\ \ / / __| + |_||_|_| | |_| |___) |__) | __/ \__ \\ V /\__ \ + |_|_|_| \___/|____/____/|_| |___/ \_/ |___/ + + OSSP svs - Stupid/Silly/Simple Versioning System + + ChangeLog + + Changes between *GENESIS* and 1.0.0 (xx-Jun-2003 to 14-Dec-2004): + + *) Created the initial version of OSSP svs. + [Ralf S. Engelschall] + Index: ossp-pkg/svs/Makefile.in RCS File: /v/ossp/cvs/ossp-pkg/svs/Makefile.in,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/svs/Makefile.in,v' | diff -u /dev/null - -L'ossp-pkg/svs/Makefile.in' 2>/dev/null --- ossp-pkg/svs/Makefile.in +++ - 2024-05-02 23:46:31.544595975 +0200 @@ -0,0 +1,87 @@ +## +## OSSP svs -- Stupid/Silly/Simple Versioning System +## Copyright (c) 2003-2004 Ralf S. Engelschall +## Copyright (c) 2003-2004 The OSSP Project +## +## This file is part of OSSP svs, a stupid/silly/simple versioning +## system which can found at http://www.ossp.org/pkg/tool/svs/ +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## +## Makefile.in: make(1) build procedure +## + +@SET_MAKE@ + +# installation paths +DESTDIR = +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +includedir = @includedir@ +mandir = @mandir@ + +# build tools +RM = rm -f +RMDIR = rmdir +SHTOOL = ./shtool +TRUE = true +POD2MAN = pod2man + +# default target +all: svs.1 + +svs.1: svs.pod + V1=`$(SHTOOL) version -l txt -d short VERSION`; \ + V2=`$(SHTOOL) version -l txt -d long VERSION`; \ + D=`$(SHTOOL) version -l txt -d long VERSION | sed -e 's;.*(;;' -e 's;).*;;'`; \ + $(POD2MAN) --quotes=none \ + --section=1 --center="Stupid/Silly/Simple Versioning System" \ + --release="$$D" --date="OSSP svs $$V1" svs.pod | \ + sed -e "s;SVS_VERSION_STR;$$V2;" >svs.1 + +# perform installation procedure +install: + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(prefix) + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir) + $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1 + $(SHTOOL) install -c -m 755 svs.sh $(DESTDIR)$(bindir)/svs + $(SHTOOL) install -c -m 644 svs.1 $(DESTDIR)$(mandir)/man1/svs.1 + +# perform uninstallation procedure +uninstall: + -$(RM) $(DESTDIR)$(mandir)/bin/svs + -$(RM) $(DESTDIR)$(mandir)/man1/svs.1 + -$(RMDIR) $(DESTDIR)$(mandir)/man1 >/dev/null 2>&1 || $(TRUE) + -$(RMDIR) $(DESTDIR)$(bindir) >/dev/null 2>&1 || $(TRUE) + -$(RMDIR) $(DESTDIR)$(prefix) >/dev/null 2>&1 || $(TRUE) + +# perform build clean up procedure +clean: + +# perform distribution clean up procedure +distclean: clean + -$(RM) config.log config.status config.cache + -$(RM) Makefile + +# perform developer clean up procedure +realclean: distclean + -$(RM) svs.1 + Index: ossp-pkg/svs/README RCS File: /v/ossp/cvs/ossp-pkg/svs/README,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/svs/README,v' | diff -u /dev/null - -L'ossp-pkg/svs/README' 2>/dev/null --- ossp-pkg/svs/README +++ - 2024-05-02 23:46:31.547186541 +0200 @@ -0,0 +1,50 @@ + _ ___ ____ ____ ____ + |_|_ _ / _ \/ ___/ ___|| _ \ _____ _____ + _|_||_| | | | \___ \___ \| |_) | / __\ \ / / __| + |_||_|_| | |_| |___) |__) | __/ \__ \\ V /\__ \ + |_|_|_| \___/|____/____/|_| |___/ \_/ |___/ + + OSSP svs - Stupid/Silly/Simple Versioning System + Version 1.0.0 + + ABSTRACT + + OSSP svs is a simple frontend to diff(1) and patch(1). It provides a + convenient way for working with changes on textual files if no history + tracking and version control is necessary. This is especially the + case when having to patch pristine vendor sources for portability or + bugfixing reasons. + + COPYRIGHT AND LICENSE + + Copyright (c) 2003-2004 Ralf S. Engelschall + Copyright (c) 2003-2004 The OSSP Project + + This file is part of OSSP svs, a stupid/silly/simple versioning + system which can found at http://www.ossp.org/pkg/tool/svs/ + + Permission to use, copy, modify, and distribute this software for + any purpose with or without fee is hereby granted, provided that + the above copyright notice and this permission notice appear in all + copies. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + HOME AND DOCUMENTATION + + The documentation and latest release can be found on + + o http://www.ossp.org/pkg/tool/svs/ + o ftp://ftp.ossp.org/pkg/tool/svs/ + Index: ossp-pkg/svs/THANKS RCS File: /v/ossp/cvs/ossp-pkg/svs/THANKS,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/svs/THANKS,v' | diff -u /dev/null - -L'ossp-pkg/svs/THANKS' 2>/dev/null --- ossp-pkg/svs/THANKS +++ - 2024-05-02 23:46:31.549749855 +0200 @@ -0,0 +1,17 @@ + _ ___ ____ ____ ____ + |_|_ _ / _ \/ ___/ ___|| _ \ _____ _____ + _|_||_| | | | \___ \___ \| |_) | / __\ \ / / __| + |_||_|_| | |_| |___) |__) | __/ \__ \\ V /\__ \ + |_|_|_| \___/|____/____/|_| |___/ \_/ |___/ + + OSSP svs - Stupid/Silly/Simple Versioning System + + THANKS + + Credit has to be given to the following people who contributed ideas, + stuff, bugfixes, hints etc. (in alphabetical order): + + o Thomas Lotterer + + ...and all other OSSP svs users who gave me feedback but I've forgot. + Index: ossp-pkg/svs/VERSION RCS File: /v/ossp/cvs/ossp-pkg/svs/VERSION,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/svs/VERSION,v' | diff -u /dev/null - -L'ossp-pkg/svs/VERSION' 2>/dev/null --- ossp-pkg/svs/VERSION +++ - 2024-05-02 23:46:31.552272268 +0200 @@ -0,0 +1,6 @@ + + VERSION -- Version Information for OSSP svs (syntax: Text) + [automatically generated and maintained by GNU shtool] + + This is OSSP svs, Version 1.0.0 (14-Dec-2004) + Index: ossp-pkg/svs/configure.ac RCS File: /v/ossp/cvs/ossp-pkg/svs/configure.ac,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/svs/configure.ac,v' | diff -u /dev/null - -L'ossp-pkg/svs/configure.ac' 2>/dev/null --- ossp-pkg/svs/configure.ac +++ - 2024-05-02 23:46:31.554816125 +0200 @@ -0,0 +1,46 @@ +dnl ## +dnl ## OSSP svs -- Stupid/Silly/Simple Versioning System +dnl ## Copyright (c) 2003-2004 Ralf S. Engelschall +dnl ## Copyright (c) 2003-2004 The OSSP Project +dnl ## +dnl ## This file is part of OSSP svs, a stupid/silly/simple versioning +dnl ## system which can found at http://www.ossp.org/pkg/tool/svs/ +dnl ## +dnl ## Permission to use, copy, modify, and distribute this software for +dnl ## any purpose with or without fee is hereby granted, provided that +dnl ## the above copyright notice and this permission notice appear in all +dnl ## copies. +dnl ## +dnl ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +dnl ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +dnl ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +dnl ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +dnl ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +dnl ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +dnl ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +dnl ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +dnl ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +dnl ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +dnl ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +dnl ## SUCH DAMAGE. +dnl ## +dnl ## +dnl ## configure.ac: GNU autoconf specification +dnl ## + +AC_PREREQ(2.53) +AC_REVISION($1.0$) +AC_INIT(README) + +SVS_VERSION_STR="`./shtool version -l txt -d long VERSION`" +./shtool echo -e "Configuring %BOSSP svs%b (Stupid/Silly/Simple Versioning System), version %B${SVS_VERSION_STR}%b" +echo "Copyright (c) 2003-2004 Ralf S. Engelschall " +echo "Copyright (c) 2003-2004 The OSSP Project " +AC_SUBST(SVS_VERSION_STR) + +AC_PREFIX_DEFAULT(/usr/local) +AC_SET_MAKE + +AC_CONFIG_FILES(Makefile) +AC_OUTPUT + Index: ossp-pkg/svs/devtool RCS File: /v/ossp/cvs/ossp-pkg/svs/devtool,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/svs/devtool,v' | diff -u /dev/null - -L'ossp-pkg/svs/devtool' 2>/dev/null --- ossp-pkg/svs/devtool +++ - 2024-05-02 23:46:31.557729318 +0200 @@ -0,0 +1,47 @@ +#!/bin/sh +## +## devtool -- Development Tool +## Copyright (c) 2001 Ralf S. Engelschall +## + +if [ $# -eq 0 ]; then + echo "devtool:USAGE: devtool [ ...]" 1>&2 + exit 1 +fi + +cmd="$1" +shift + +devtoolfunc="./devtool.func" + +if [ ! -f devtool.conf ]; then + echo "devtool:ERROR: no devtool.conf in current directory" 1>&2 + exit 1 +fi + +cmdline=`grep "^%$cmd" devtool.conf` +if [ ".$cmdline" = . ]; then + echo "devtool:ERROR: command $cmd not found in devtool.conf" 1>&2 + exit 1 +fi + +if [ ".$TMPDIR" != . ]; then + tmpdir="$TMPDIR" +elif [ ".$TEMPDIR" != . ]; then + tmpdir="$TEMPDIR" +else + tmpdir="/tmp" +fi +tmpfile="$tmpdir/rc.$$.tmp" + +rm -f $tmpfile +touch $tmpfile +echo ". $devtoolfunc" >>$tmpfile +( sed >$tmpfile + +sh $tmpfile "$@" + +rm -f $tmpfile >/dev/null 2>&1 || true + Index: ossp-pkg/svs/devtool.conf RCS File: /v/ossp/cvs/ossp-pkg/svs/devtool.conf,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/svs/devtool.conf,v' | diff -u /dev/null - -L'ossp-pkg/svs/devtool.conf' 2>/dev/null --- ossp-pkg/svs/devtool.conf +++ - 2024-05-02 23:46:31.560306943 +0200 @@ -0,0 +1,41 @@ +## +## devtool.conf -- Development Tool Configuration +## + +%autogen + @autogen autoconf 2.59 "2.5*" + @autogen shtool 2.0.1 "2.0.*" all + +%autoclean + @autoclean autoconf + @autoclean shtool + +%configure + ./configure --prefix=/tmp/svs "$@" + +%version + ./shtool version -l txt -n "OSSP svs" -e VERSION + V=`./shtool version -l txt -d long VERSION` + sed -e "s/Version .*(.*)/Version $V/g" README.n + mv README.n README + +%dist + echo "+++ generating" + ./devtool autoclean + ./devtool autogen + echo "+++ configuring" + ./configure + echo "+++ building" + make clean all + echo "+++ cleaning" + make distclean + echo "+++ fixing" + ./shtool fixperm -v . + echo "+++ rolling" + V=`./shtool version -l txt -d short VERSION` + ./shtool tarball -o svs-${V}.tar.gz -d svs-${V} -u ossp -g svs \ + -e 'CVS,\.cvsignore,\.[ao]$,^\.,devtool*,*.tar.gz' -c 'gzip --best' . + ls -l svs-${V}.tar.gz + echo "+++ testing" + gunzip /dev/null --- ossp-pkg/svs/devtool.func +++ - 2024-05-02 23:46:31.562850887 +0200 @@ -0,0 +1,73 @@ +## +## devtool.func -- Development Tool Functions +## Copyright (c) 2001-2004 Ralf S. Engelschall +## + +devtool_require () { + t="$1"; o="$2"; p="$3"; e="$4"; a="$5" + v=`($t $o | head -1 | awk "{ print \\\$$p; }") 2>/dev/null` + if [ ".$v" = . ]; then + echo "devtool:ERROR: unable to determine version of $t" 1>&2 + exit 1 + fi + case "$v" in + $e ) + ;; + $a ) + echo "devtool:WARNING: $t version $v still accepted, although expected $e." 1>&2 + ;; + * ) + echo "devtool:ERROR: $t version $e expected, but found $v." 1>&2 + exit 1 + ;; + esac + echo "$v" +} + +devtool_autogen () { + tool=$1 + shift + case $tool in + autoconf ) + autoconf_version=`devtool_require autoconf --version 4 "$1" "$2"` + echo "generating (GNU Autoconf $autoconf_version): configure config.h.in" + autoconf + #autoheader 2>&1 | grep -v "is unchanged" + rm -rf autom4te.cache >/dev/null 2>&1 + ;; + libtool ) + libtoolize_version=`devtool_require libtoolize --version 4 "$1" "$2"` + echo "generating (GNU Libtool $libtoolize_version): ltmain.sh, libtool.m4, config.guess, config.sub" + libtoolize --force --copy >/dev/null 2>&1 + cp `libtoolize --force --copy --dry-run | grep "add the contents of" |\ + sed -e 's;^[^\`]*\`;;' -e "s;'.*;;"` libtool.m4 + ;; + shtool ) + shtoolize_version=`devtool_require shtoolize -v 3 "$1" "$2"` + echo "generating (GNU Shtool $shtoolize_version): shtool" + shift + shift + shtoolize -q "$@" + ;; + esac +} + +devtool_autoclean () { + tool=$1 + shift + case $tool in + autoconf ) + echo "removing: configure config.h.in" + rm -f configure config.h.in + ;; + libtool ) + echo "removing: ltmain.sh libtool.m4 config.guess config.sub" + rm -f ltmain.sh libtool.m4 config.guess config.sub + ;; + shtool ) + echo "removing: shtool" + rm -f shtool + ;; + esac +} + Index: ossp-pkg/svs/svs.pod RCS File: /v/ossp/cvs/ossp-pkg/svs/svs.pod,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/svs/svs.pod,v' | diff -u /dev/null - -L'ossp-pkg/svs/svs.pod' 2>/dev/null --- ossp-pkg/svs/svs.pod +++ - 2024-05-02 23:46:31.565411792 +0200 @@ -0,0 +1,131 @@ +## +## OSSP svs -- Stupid/Silly/Simple Versioning System +## Copyright (c) 2003-2004 Ralf S. Engelschall +## Copyright (c) 2003-2004 The OSSP Project +## +## This file is part of OSSP svs, a stupid/silly/simple versioning +## system which can found at http://www.ossp.org/pkg/tool/svs/ +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## +## svs.pod: manual page (language: POD) +## + +=pod + +=head1 NAME + +B - B + +=head1 VERSION + +B SVS_VERSION_STR + +=head1 SYNOPSIS + +=over 0 + +=item B vi I [...] + +=item B diff I|I [...] + +=item B backout I|I [...] + +=back + +=head1 DESCRIPTION + +B is a simple frontend to diff(1) and patch(1). It provides a +convenient way for working with changes on textual files if no history +tracking and version control is necessary. This is especially the +case when having to patch pristine vendor sources for portability or +bugfixing reasons. + +B solves the following primary issues: + +=over 4 + +=item Writable and preserved files + +It is often the case that one enters the editor for editing a file, just +to have to recognized that it is not writable ("CI) +or the original content was not (or not correctly) preserved before +("C I IC<.orig>"). Simply running "C" instead +of "C" and not having to remember those subtle problems is both +convenient and leads to consistent results. + +=item Re-editing of files + +Usually the patching of vendor sources is an iterative process where one +has to both re-edit files and even perform the whole edit/diff/patch +cycle multiple times. Here it is important that no already applied +changes are lost (overwritten C<*.orig> files, etc) and that the changes +can be correctly backed out again. + +=item Index style + +For portability and consistency reasons it is good if all patches use +the same style. This means that all hunks should be preceeded by an +C header and that the change is represented with the concise +I format with at least 3 lines of context. + +=item New or removed files + +While patch files for changed vendor files are harmless, added or +removed vendor files are special cases both for the patch application +and removal. B and C correctly handle those +special cases. + +=back + +=head2 COMMANDS + +The following commands are provided: + +=over 4 + +=item B vi I [...] + +This potentially edits I by preserving the original contents in +IC<.orig> (if still not existing) and running the C<$EDITOR> (or +"C") on I. On leaving the editor, the original and current +contents is compared. If there is no difference the IC<.orig> is +removed again, else it is kept. + +=item B diff [I|I [...]] + +This generates a "patch file" summarizing all changes made to files +where an IC<.orig> exists. + +=item B backout [I|I [...]] + +This backouts all changes made to files where an IC<.orig> exists. +The IC<.orig> files are removed, too. + +=back + +=head1 HISTORY + +The B tool was implemented in 2003 by Ralf S. Engelschall +Erse@engelschall.comE. It was prompted by the need for a +frontend to diff(1) and patch(1) to generate patches in the B +Ehttp://www.openpkg.org/E project. + +=cut + Index: ossp-pkg/svs/svs.sh RCS File: /v/ossp/cvs/ossp-pkg/svs/svs.sh,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/svs/svs.sh,v' | diff -u /dev/null - -L'ossp-pkg/svs/svs.sh' 2>/dev/null --- ossp-pkg/svs/svs.sh +++ - 2024-05-02 23:46:31.568013557 +0200 @@ -0,0 +1,181 @@ +#!/bin/sh +## +## OSSP svs -- Stupid/Silly/Simple Versioning System +## Copyright (c) 2003-2004 Ralf S. Engelschall +## Copyright (c) 2003-2004 The OSSP Project +## +## This file is part of OSSP svs, a stupid/silly/simple versioning +## system which can found at http://www.ossp.org/pkg/tool/svs/ +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## +## svs.sh: program (language: Bourne Shell) +## + +# check command line +if [ $# -eq 0 ]; then + echo "Usage: svs vi [...]" + echo "Usage: svs diff [| [...]]" + echo "Usage: svs backout [| [...]]" + exit 1 +fi + +# dispatch into commands +cmd="$1" +shift +case "$cmd" in + v|vi|vim | e|em|ema|emac|emacs ) + ## + ## EDIT ONE OR MORE FILES + ## + + # iterate over all files + for file in "$@"; do + # preserve original file + if [ ! -f $file.orig ]; then + cp -p $file $file.orig + orig=new + else + orig=old + fi + + # edit file + chmod u+w $file + ${EDITOR-vi} $file + + # check for editing results + if cmp $file.orig $file >/dev/null 2>&1; then + if [ ".$orig" = .new ]; then + echo "svs: no changes made (keeping original)" + else + echo "svs: changes reversed (restoring original)" + fi + cp -p $file.orig $file + rm -f $file.orig + else + echo "svs: changes made (preserving original)" + fi + done + ;; + + d|di|dif|diff ) + ## + ## GENERATE PATCHING DIFFERENCE + ## + + # determine file list + if [ $# -eq 0 ]; then + set -- . + fi + files="" + for file in "$@"; do + if [ -d $file ]; then + for f in `find $file -type f -name "*.orig" -print`; do + files="$files $f" + done + elif [ -f $file ]; then + files="$files $file" + else + echo "svs:ERROR: \"$file\" neither regular file nor directory" 1>&2 + exit 1 + fi + done + + # generate patch + for file in $files; do + file=`echo "$file" | sed -e 's;^\./;;' -e 's;/\./;/;g' -e 's;\([^/][^/]*\)/\.\.;;g' -e 's;//*;/;g'` + orig=`echo "$file" | sed -e 's;\.orig$;;' -e 's;$;.orig;'` + edit=`echo "$file" | sed -e 's;\.orig$;;'` + if [ ! -f $orig ]; then + echo "svs:WARNING: original file \"$orig\" not found" 1>&2 + continue + fi + if [ ! -f $edit ]; then + # special case: removed file + echo "Index: $edit" + diff -u3 $orig /dev/null | sed -e "1s/^--- $orig/--- $edit/" + elif [ ! -r $orig ] && [ ! -s $orig ]; then + # special case: new file + echo "Index: $edit" + diff -u3 /dev/null $edit + else + # regular case: edited file + if ! cmp $orig $edit >/dev/null 2>&1; then + echo "Index: $edit" + diff -u3 $orig $edit + fi + fi + done + ;; + + b|ba|bac|back|backo|backou|backout ) + ## + ## BACKOUT EDITING CHANGES + ## + + # determine file list + if [ $# -eq 0 ]; then + set -- . + fi + files="" + for file in "$@"; do + if [ -d $file ]; then + for f in `find $file -type f -name "*.orig" -print`; do + files="$files $f" + done + elif [ -f $file ]; then + files="$files $file" + else + echo "svs:ERROR: \"$file\" neither regular file nor directory" 1>&2 + exit 1 + fi + done + + # backout changes + for file in $files; do + file=`echo "$file" | sed -e 's;^\./;;' -e 's;/\./;/;g' -e 's;\([^/][^/]*\)/\.\.;;g' -e 's;//*;/;g'` + orig=`echo "$file" | sed -e 's;\.orig$;;' -e 's;$;.orig;'` + edit=`echo "$file" | sed -e 's;\.orig$;;'` + if [ ! -f $orig ]; then + echo "svs:WARNING: original file \"$orig\" not found" 1>&2 + continue + fi + echo "svs: backing out changes to \"$edit\"" + if [ ! -f $edit ]; then + # special case: removed file + cp -p $orig $edit + rm -f $orig + elif [ ! -r $orig ] && [ ! -s $orig ]; then + # special case: new file + chmod u+w $orig + rm -f $orig + rm -f $edit + else + # regular case: edited file + cp -p $orig $edit + rm -f $orig + fi + done + ;; + * ) + echo "svs:ERROR: invalid command \"$cmd\"" 1>&2 + exit 1 + ;; +esac +