threads / discuss / 1858

[PATCHES] CURLDIR support, more usable cmd-rename.sh

Subject: [PATCHES] CURLDIR support, more usable cmd-rename.sh

## tl;dr

7 messages between Sep 19, 2005 and Sep 20, 2005.

replies: 6people: 4as markdown or json

Patrick Mauritz· Sep 19, 2005, 11:14 UTC · lore
hello,
attached are two patches.

the first is an updated implementation of CURLDIR support (for those who have libcurl outside their library search path)

the second changes cmd-rename.sh so that it only adds symlinks to executables that actually exist (eg. when building with NO_CURL, git-http-pull would still be created).

another issue I had was that mailinfo uses strcasestr, which isn't in solaris' libc (and not in posix according to http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00076.html). I disabled it in my build for now, and might come up with a patch later, unless someone beats me to it.

patrick mauritz
Petr Baudis· Sep 19, 2005, 13:37 UTC · re: Patrick Mauritz · lore

Re: [PATCHES] CURLDIR support, more usable cmd-rename.sh

Dear diary, on Mon, Sep 19, 2005 at 01:14:36PM CEST, I got a letter where Patrick Mauritz <oxygene@studentenbude.ath.cx> told me that...

> hello,
Hello,
> attached are two patches.
seems that they didn't quite get attached in the end. ;-)
Show 5 quoted lines
> another issue I had was that mailinfo uses strcasestr, which isn't in
> solaris' libc (and not in posix according to
> http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00076.html). I
> disabled it in my build for now, and might come up with a patch later,
> unless someone beats me to it.
Linus already did in <Pine.LNX.4.58.0509181829310.9106@g5.osdl.org>.
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox
Patrick Mauritz· Sep 19, 2005, 14:11 UTC · re: Petr Baudis · lore

Re: [PATCHES] CURLDIR support, more usable cmd-rename.sh

On Mon, 2005-09-19 at 15:37, Petr Baudis wrote:
> seems that they didn't quite get attached in the end. ;-)

oops :) here they are

> Linus already did in <Pine.LNX.4.58.0509181829310.9106@g5.osdl.org>.
yay :)
patrick mauritz

diff -ur git-core-0.99.7.orig//Makefile git-core-0.99.7/Makefile --- git-core-0.99.7.orig//Makefile Mon Sep 19 12:43:04 2005 +++ git-core-0.99.7/Makefile Mon Sep 19 12:45:45 2005

@@ -42,7 +42,10 @@
 
 GIT_VERSION = 0.99.7
 
-CFLAGS = -g -O2 -Wall
+CFLAGS = -g -O2
+ifdef CURLDIR
+CFLAGS+=-I$(CURLDIR)/include
+endif
 ALL_CFLAGS = $(CFLAGS) $(PLATFORM_DEFINES) $(DEFINES)
 
 prefix = $(HOME)
@@ -261,7 +264,11 @@
 git-ssh-pull: rsh.o fetch.o
 git-ssh-push: rsh.o
 
+ifdef CURLDIR
+git-http-fetch: LIBS += -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl
+else
 git-http-fetch: LIBS += -lcurl
+endif
 git-rev-list: LIBS += $(OPENSSL_LIBSSL)
 
 init-db.o: init-db.c


--- cmd-rename.sh~	Mon Sep 19 12:53:40 2005
+++ git-core-0.99.7/cmd-rename.sh	Mon Sep 19 12:53:58 2005
@@ -4,7 +4,9 @@
 while read old new
 do
 	rm -f "$d/$old"
+	if [ -x "$d/$new" ]; then
 	ln -s "$new" "$d/$old"
+	fi
 done <<\EOF
 git-add-script	git-add
 git-archimport-script	git-archimport
Matthias Urlichs· Sep 19, 2005, 14:37 UTC · re: Patrick Mauritz · lore

Re: [PATCHES] CURLDIR support, more usable cmd-rename.sh

Hi, Patrick Mauritz wrote:
> -CFLAGS = -g -O2 -Wall
> +CFLAGS = -g -O2
Umm, no, you don't get to unconditionally throw way -Wall.
*Some* people think this flag makes sense and that the sane default
(on sane OSes, i.e. those who have GCC and glibc) should be to include it. 
 ;-)
-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
I must have a prodigious quantity of mind; it takes me as much as a
week sometimes to make it up.
		-- Mark Twain, "The Innocents Abroad"
Junio C Hamano· Sep 19, 2005, 16:34 UTC · re: Patrick Mauritz · lore

Re: [PATCHES] CURLDIR support, more usable cmd-rename.sh

Patrick Mauritz <oxygene@studentenbude.ath.cx> writes:
> diff -ur git-core-0.99.7.orig//Makefile git-core-0.99.7/Makefile
> --- git-core-0.99.7.orig//Makefile	Mon Sep 19 12:43:04 2005
> +++ git-core-0.99.7/Makefile	Mon Sep 19 12:45:45 2005

Why not a patch from either git or cogito or stgit ;-)? Anyway, thanks for your patch.

> -CFLAGS = -g -O2 -Wall
> +CFLAGS = -g -O2

Not relevant to the current topic as far as I can tell (unless your non-standard curl include files trip under -Wall).

Show 15 quoted lines
> +ifdef CURLDIR
> +CFLAGS+=-I$(CURLDIR)/include
> +endif
>  ALL_CFLAGS = $(CFLAGS) $(PLATFORM_DEFINES) $(DEFINES)
>  
>  prefix = $(HOME)
> @@ -261,7 +264,11 @@
>  git-ssh-pull: rsh.o fetch.o
>  git-ssh-push: rsh.o
>  
> +ifdef CURLDIR
> +git-http-fetch: LIBS += -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl
> +else
>  git-http-fetch: LIBS += -lcurl
> +endif

I do not have any objections to helping installations where CURL is installed somewhere nonstandard, but if that is the case I am wondering if assuming that they are all in the same directory hierarchy covers enough. CURLDIR=/usr/local/ would be OK and CURLDIR=/opt/curl/ would be as well with this patch, so this probably is fine. Installations without ld.so.conf need -R, but is it safe to always force -R like this?

Also I wonder if we need similar customization for openssl stuff, but that is a separate topic.

Show 9 quoted lines
> --- cmd-rename.sh~	Mon Sep 19 12:53:40 2005
> +++ git-core-0.99.7/cmd-rename.sh	Mon Sep 19 12:53:58 2005
> @@ -4,7 +4,9 @@
>  while read old new
>  do
>  	rm -f "$d/$old"
> +	if [ -x "$d/$new" ]; then
>  	ln -s "$new" "$d/$old"
> +	fi
No questions about this part.  Thanks for the fix.
Patrick Mauritz· Sep 19, 2005, 17:40 UTC · re: Junio C Hamano · lore

Re: [PATCHES] CURLDIR support, more usable cmd-rename.sh

On Mon, 2005-09-19 at 18:34, Junio C Hamano wrote:
> Why not a patch from either git or cogito or stgit ;-)?
because my only use for git is with monotone's git import.
> Not relevant to the current topic as far as I can tell (unless
> your non-standard curl include files trip under -Wall).
the only issue with this is that sunpro's cc doesn't like -Wall
> Installations without ld.so.conf need -R, but
> is it safe to always force -R like this?

the only case that comes to mind is where you want to link git against a library which is at a different location now than it is later, eg. in conjunction with DESTDIR or similar means. as long as git doesn't build any shared libraries by itself and links to them, this shouldn't be an issue.

patrick mauritz
Junio C Hamano· Sep 20, 2005, 06:25 UTC · re: Patrick Mauritz · lore

Re: [PATCHES] CURLDIR support, more usable cmd-rename.sh

Patrick Mauritz <oxygene@studentenbude.ath.cx> writes:
>> Not relevant to the current topic as far as I can tell (unless
>> your non-standard curl include files trip under -Wall).
> the only issue with this is that sunpro's cc doesn't like -Wall

Since you will be saying "make CURLDIR=blah" anyway, I'd ask you to say "make CURLDIR=blah CFLAGS='-O -g'" and will forget about this part.

The rest of your patch I am keeping a variant based on it, done slightly differently, in the proposed updates branch. I'll have it graduate to the master branch when I hear from somebody (can be you) with SunPro that the it is OK (or an improvement patch).

Thanks.

← back to recent threads