#if the pkg created in packages-woof has something wrong, this file is a last
#resort to fix it. Current-dir is where this file FIXUPHACK is located.
#note: DISTRO_BINARY_COMPAT and DISTRO_FILE_PREFIX are visible here, exported in 2createpackages.
#140117 xARCHDIR, ARCHDIR and DISTRO_ARCHDIR_SYMLINKS exported in 2createpackages. 
#140117 note, 2createpackages may move /lib, /usr/lib, /usr/bin in template to ARCHDIR subdir.

#these old ones work properly (have to do it this way because of debian/ubuntu symlinks)...
rm -rf usr/share/terminfo
mv -f usr/share/terminfoOLD usr/share/terminfo

#sh*t debian/ubuntu people love to mess around with pkg layout...
HMMM=0
if [ "$xARCHDIR" ];then #140117
 if [ -d lib/${ARCHDIR}/terminfo ];then
  rm -rf lib/${ARCHDIR}/terminfo
  HMMM=1
 fi
fi
if [ -d lib/terminfo ];then
 rm -rf lib/terminfo
 HMMM=1
fi
[ $HMMM -eq 1 ] && ln -s ../usr/share/terminfo lib/terminfo

#can't remember why have this one...
HMMM=0
if [ "$xARCHDIR" ];then #140117
 if [ -d usr/lib/${ARCHDIR}/terminfo ];then
  rm -rf usr/lib/${ARCHDIR}/terminfo
  HMMM=1
 fi
fi
if [ -d usr/lib/terminfo ];then
 rm -rf usr/lib/terminfo
 HMMM=1
fi
[ $HMMM -eq 1 ] && ln -s ../../usr/share/terminfo usr/lib/terminfo

