Subject: pkg/21863: wrong x11-links symlinks with LOCALBASE=/usr
To: None <>
From: None <>
List: netbsd-bugs
Date: 06/11/2003 15:19:05
>Number:         21863
>Category:       pkg
>Synopsis:       wrong x11-links symlinks with LOCALBASE=/usr
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 11 22:20:01 UTC 2003
>Release:        NetBSD 1.6
System: NetBSD 1.6 NetBSD 1.6 (JCR-20020927) #3: Sat Sep 28 13:40:20 PDT 2002 i386
Architecture: i386
Machine: i386
mk/buildlink2/ puts the x11-links in place with:

$ ls -l work/.buildlink/include/X11/Intrinsic.h 
lrwxrwxrwx    1 reed     reed           41 Jun 11 14:31 work/.buildlink/include/X11/Intrinsic.h -> ../../../../X11R6/include/X11/Intrinsic.h

$ ls -l /usr/share/x11-links/include/X11/Intrinsic.h 
lrwxrwxrwx    1 root     root           41 Jun  7 21:28 /usr/share/x11-links/include/X11/Intrinsic.h -> ../../../../X11R6/include/X11/Intrinsic.h

$ cd /usr/share/x11-links/include/X11/
$ ls -l ../../../../X11R6/include/X11/Intrinsic.h
-r--r--r--    1 root     root        73241 Mar 25 07:38 ../../../../X11R6/include/X11/Intrinsic.h

So the problem is that the links have relative path (../../../../).

When pkgtools/x11-links is installed in first place, it is temporarily
correct until:
Full pathname symlink ... is target of ... adjusting to ...

(This is done in CheckSymlink() of pkg_install's

My LOCALBASE is /usr. I am doing this under Linux.

Some of my old emails about this:
Attempt to build x11/rxvt when LOCALBASE=/usr.

 In file included from rxvt.c:1:
 rxvtlib.h:46:73: X11/Intrinsic.h: No such file or directory

(This is not an rxvt issue; this happens with packages needing x11-links.)

Maybe patch pkg_install/create/pl.c so if cwd is /usr then ignore.

If this adjusting pathname symlinks is really important then keep it,
but make it so that mk/buildlink2/ does the right thing,
but just creating symlinks or copies the target of the file itself.

My work-around for several months is to make the symlinks using
GNU cp -s switch.