From: Petr Baudis Date: Tue, 26 Apr 2005 20:25:19 GMT Subject: Re: [PATCH] cogito - split out cg-X* to prefix/lib/cogito Message-ID: <20050426202518.GK13224@pasky.ji.cz> In-Reply-To: <200504260053.33506.jcorbin@wunjo.org> Dear diary, on Tue, Apr 26, 2005 at 06:53:33AM CEST, I got a letter where "Joshua T. Corbin" told me that... > The following patch does the following: > * Change the Makefile to install all cg-X* to $(prefix)/lib/cogito > * Modify all cg-* to use this lib prefix. > > Basically the cg-* script looks at $0, if it appears to be in a prefix/bin > directory that also has a prefix/lib/cogito directory, look for the cg-X* > there; otherwise things will work as in old. > > Signed-off-by: Joshua T. Corbin > > Index: cg-Xdiffdo > =================================================================== > --- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-Xdiffdo (mode:100755 > sha1:e3907b39ea105acb2f2ac3659f16898604b72d09) > +++ bb131a04832677b22959ffe47f68900b94accc0c/cg-Xdiffdo (mode:100755 > sha1:832fd2c2a09274b5279327e1c31b99afc04fa7f1) > @@ -12,7 +12,16 @@ > # > # Outputs a diff converting the first tree to the second one. > > -. cg-Xlib > +if [ -z "$COGITO_LIB" ]; then > + COGITO_LIB=$(dirname $(dirname $0))/lib/cogito > + if [ -d $COGITO_LIB ]; then > + COGITO_LIB=$COGITO_LIB/ > + else > + COGITO_LIB= > + fi > +fi > + > +. ${COGITO_LIB}cg-Xlib > > > id1=$1; shift I think this is wrong, stuffing too much redundant logic to all those files. I'm fine with the last added line, but nothing more. What about rewriting the scripts during make install, doing something like s/\${COGITO_LIB}/\${COGITO_LIB:-$(libdir)}/ ? -- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor