[tex-live] wrong links with --disable-multiplatform

François Charette firmicus at ankabut.net
Thu Apr 24 14:45:07 CEST 2008


Karl Berry wrote:

[ sorry Karl if I previously sent this to you instead of the list :/ ]

>     When using the switch "--disable-multiplatform", the symbolic 
> links in the
>
> Sorry, I can't support that.  Life is too short.
>
> If you or anyone can provide a maintainable patch to do what you want,
> I'll be happy to install it.  Meanwhile, I can only suggest writing a
> trivial post-processing script that changes the symlinks.
>
> karl
>
>   

Here is such a script.

(Assuming installation goes to $PREFIX, with binaries
under $PREFIX/bin and scripts under some subdir of $PREFIX/$DATADIR.
(For instance PREFIX="/usr/local" and DATADIR="$PREFIX/share/texlive"):

  ### FIX symlinks under $PREFIX/bin/:
  echo "--> ...fixing wrong symlinks to scripts under $PREFIX/bin/"
  for f in $PREFIX/bin/* ; do
      if [ -L $f ]; then
          target=`ls -l "$f" | sed 's/^.\+ -> //'` || return 1
          if [[ "$target" == ..* ]]; then
              newtarget=`echo $target | sed 's|../../|$DATADIR|'`
              rm -f $f
              ln -s $newtarget $f
              test -f $newtarget && chmod a+x $newtarget
          fi
      fi
  done

NB: My original script is slightly different since my installation is 
made to a temporary $INSTALLDIR before packaging for the distro I am 
maintaining:

  for f in $INSTALLDIR/$PREFIX/bin/* ; do
      if [ -L $f ]; then
          target=`ls -l "$f" | sed 's/^.\+ -> //'` || return 1
          if [[ "$target" == ..* ]]; then
              newtarget=`echo $target | sed 's|../../|$DATADIR|'`
              rm -f $f
              ln -s $newtarget $f
              test -f $INSTALLDIR/$newtarget && chmod a+x 
$INSTALLDIR/$newtarget
          fi
      fi
  done

Best,
François




More information about the tex-live mailing list