summaryrefslogtreecommitdiff
path: root/japanese/ptex-base/pkg-req
blob: f353fb4258a157c639cafae2eeb85d739c12b799 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

if [ $2 != INSTALL ]; then exit 0; fi

BINDIR=${PKG_PREFIX}/bin
for f in ${BINDIR}/MakeTeXMF ${BINDIR}/MakeTeXPK ${BINDIR}/MakeTeXTFM ${PKG_PREFIX}/share/texmf/web2c/texmf.cnf; do
  if [ -f $f ]; then files_exist="${files_exist} $f"; fi
done

if [ -z "${files_exist}" ]; then exit 0; fi

echo '************************************************************************'
echo
if [ "x$3" = "xBATCH" ]; then
  echo 'Following files will be renamed to *.old:'
 else
  echo 'Files listed below already exist on this system:'
fi
echo
for f in ${files_exist}; do echo $f; done
echo
if [ "x$3" != "xBATCH" ]; then
  echo 'If you proceed, these files will be renamed to *.old and new files'
  echo 'will be installed.'
  if [ -z "${PACKAGE_BUILDING}" ]; then
    read  -p 'Would you like to proceed? (y/N)> ' ans
   else
    ans=yes
  fi
  case x$ans in
    xy*|xY*) for f in ${files_exist} ;do mv -f $f ${f}.old; done; exit 0
  esac

  echo 'Aborting the installation.'
  exit 1
 else
  for f in ${files_exist}; do mv -f $f ${f}.old; done
  exit 0
fi