git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] cogito - split out cg-X* to prefix/lib/cogito

From
Petr Baudis <pasky@ucw.cz>
Date
Apr 26, 2005, 20:25 UTC
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" <jcorbin@wunjo.org> told me that...

Show 34 quoted lines
> 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 <jcorbin@wunjo.org>
> 
> 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
Previous: Joshua T. CorbinNext: Chris Wright
Message 2 of 3 in “cogito - split out cg-X* to prefix/lib/cogito”
  1. cogito - split out cg-X* to prefix/lib/cogitoJoshua T. Corbin, Apr 26, 2005
  2. Petr BaudisApr 26, 2005
  3. Chris WrightApr 26, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.