tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: buildlink and symlinks to directories



On Mon, Jan 23, 2012 at 02:09:22PM +0900, OBATA Akio wrote:
> On Sun, 22 Jan 2012 19:08:34 +0900, Mark Davies 
> <mark%ecs.vuw.ac.nz@localhost> wrote:
> 
> >On Sunday 22 January 2012 16:14:17 Steven Drake wrote:
> >>> Any suggestions on how to fix this?
> >
> >>Shouldn't the following work:
> >
> >>BUILDLINK_FILES.qt4-tools+=     qt4/mkspecs/default
> >
> >It doesn't.
> 
> And followings?
> 
> Index: mk/buildlink3/bsd.buildlink3.mk
> ===================================================================
> RCS file: /cvsroot/pkgsrc/mk/buildlink3/bsd.buildlink3.mk,v
> retrieving revision 1.210
> diff -u -r1.210 bsd.buildlink3.mk
> --- mk/buildlink3/bsd.buildlink3.mk     17 Jan 2012 22:19:22 -0000      
> 1.210
> +++ mk/buildlink3/bsd.buildlink3.mk     23 Jan 2012 05:07:05 -0000
> @@ -598,7 +598,7 @@
>  _BLNK_FILES_CMD.${_pkg_}=      (
>  _BLNK_FILES_CMD.${_pkg_}+=     ${BUILDLINK_FILES_CMD.${_pkg_}};
>  .for _filepattern_ in ${BUILDLINK_FILES.${_pkg_}}
> -_BLNK_FILES_CMD.${_pkg_}+=     ${LS} -1 ${_filepattern_} 2>/dev/null || 
> ${TRUE};
> +_BLNK_FILES_CMD.${_pkg_}+=     ${LS} -1d ${_filepattern_} 2>/dev/null || 
> ${TRUE};
>  .endfor
>  _BLNK_FILES_CMD.${_pkg_}+=     )
>  _BLNK_FILES_CMD.${_pkg_}+=     | ${SORT} -u
> @@ -625,7 +625,7 @@
>         ${_BLNK_FILES_CMD.${_pkg_}} |                                   \
>         while read file; do                                             \
>                 src="${_CROSS_DESTDIR}${BUILDLINK_PREFIX.${_pkg_}}/$$file"; 
>                 \
> -               if [ ! -f "$$src" ]; then                                   
> \
> +               if [ ! -f "$$src" -a ! -h "$$src" ]; then               \

Beware, there are problems with the test operator for symbolic links:

NetBSD's roughly-current man page says:

   -L file                                                                      
                                                       
          True if file exists and is a symbolic link. This operator is retained 
for compatibility with previous versions of this       
          program. Do not rely on its existence; use -h instead.    

whilst FreeBSD's almost-9 manpage says:

     -h file       True if file exists and is a symbolic link.  This operator
                   is retained for compatibility with previous versions of
                   this program.  Do not rely on its existence; use -L
                   instead.

Also... isn't the idea that a symbolic link can be created to a directory,
and not a symbolic link - if so, -d might be needed?

Best,
Alistair


Home | Main Index | Thread Index | Old Index