#!/bin/csh -f
#
#******************************************************************************
# $Source: /vobs/develop/src/environment/INSTALL,v $
#
# Inferno/Flame/Flint installation script.
#
# Last Modification: $Revision: 1.7 $
#                    $Date: 1996/01/03 16:34:11 $
#
# Copyright (c) 1996 Discreet Logic, Inc.
#******************************************************************************

# explicitly set the path to the default for root in case user uses su rather
# than login or su -
set path = ( /usr/sbin /usr/bsd /sbin /usr/bin /bin /etc /usr/etc /usr/bin/X11 )
rehash

#******************************************************************************
# Setup continuously changing vars.
#******************************************************************************

# set up variables for NEW resource Directories
set PAINT = "paint"

set resourceDirs = ( \
    menu \
    filter \
    lut \
    ${PAINT}/brush \
    ${PAINT}/palette \
    ${PAINT}/set \
    )

# set up variables for OLD resource Directories
if ( { ( hinv -c graphics | egrep -s 'RealityEngine|VGX' ) } ) then

  set OLD_PAINT = "fire"

else

  set OLD_PAINT = "spark"

endif


set OLD_resourceDirs = ( \
    menu \
    filter \
    lut \
    ${OLD_PAINT}/brush \
    ${OLD_PAINT}/palette \
    ${OLD_PAINT}/set \
    )


# set up variables for OLD setup Directories

set OLD_setupDirs = ( \
   action \
   audio \
   batch \
   composite \
   correct \
   crossfade \
   difference \
   dissolve \
   edl \
   engineering \
   images \
   key \
   mix \
   morf \
   stabilizer \
   text \
   timewarp \
   ${OLD_PAINT}/autopaint \
   ${OLD_PAINT}/cutout \
   ${OLD_PAINT}/mask \
   ${OLD_PAINT}/medium \
   ${OLD_PAINT}/paper \
   ${OLD_PAINT}/picture \
   ${OLD_PAINT}/sequence \
 )

# set up variables for NEW setup Directories

set setupDirs = ( \
   action \
   audio \
   batch \
   composite \
   correct \
   crossfade \
   difference \
   dissolve \
   edl \
   engineering \
   images \
   key \
   mix \
   morf \
   stabilizer \
   text \
   timewarp \
   ${PAINT}/autopaint \
   ${PAINT}/cutout \
   ${PAINT}/geometry \
   ${PAINT}/mask \
   ${PAINT}/medium \
   ${PAINT}/paper \
   ${PAINT}/picture \
   ${PAINT}/sequence \
 )


#******************************************************************************
# Define some useful aliases.
#******************************************************************************

set CONFIRM = "/usr/bin/X11/xconfirm -geometry 700x150 -c -noframe"

alias QUESTION '$CONFIRM -icon question -header "$header" -t "$msg" -t "$msg2" -t "$msg4" -t "$msg5"'
alias INFORM   '$CONFIRM -icon info     -header "$header" -t "$msg" -t "$msg3" -t "$msg4"'

set msg2 = ""
set msg3 = ""
set msg4 = ""
set msg5 = ""

#******************************************************************************
# Setup the script variables.
#******************************************************************************

set VERSION_FILE = `ls -1d *_VERSION`
if (!($#VERSION_FILE)) then

  set header = "Product Version File"
  set msg = "Could not find Product Version File, Install aborted"
  
  INFORM -B "OK" >& /dev/null

  exit 1 

endif

set SOFTWARE = `ls *_VERSION | nawk -F_ '{print $1}' | nawk '{print tolower($1)}'`
set PRODUCT  = `echo $SOFTWARE | nawk '{printf "%s%s",toupper(substr($1,1,1)),substr($1,2)}'`
set VERSION  = `cat *_VERSION | nawk '{gsub("\"","",$3);gsub(" ","",$3); print $3}'`
set LOGIN    = `echo $VERSION | tr . _ | sed 's/alpha/a/' | sed 's/beta/b/' | nawk -v user="$SOFTWARE" '{printf "%s%s",user,$1}'`
set SWR_INSTALLED = 0
set REBOOT_REQUIRED = "No"

#******************************************************************************
# Am I running as root?
#******************************************************************************

if ( `whoami` != "root" ) then

   set header = "Privileges"
   set msg    = "You must have root privileges to install ${PRODUCT}."

   INFORM -B "OK" > /dev/null

   exit 1

endif

#**************************************************************************
# Am I running the right version of IRIX
#**************************************************************************

set IRIX_RELEASE = `uname -r`

set exes = `ls -1d ./bin/${SOFTWARE}_IRIX_* | /sbin/grep ${IRIX_RELEASE}`

if ( ! $#exes ) then

   set header = "IRIX Release"
   set msg    =  "Your workstation must be driven by IRIX ${IRIX_RELEASE} to run ${PRODUCT}."

   INFORM -B "OK" >& /dev/null

   exit 1

endif

echo "####################################################################"
echo "#                                                                  #"
echo "#             Discreet Logic Software Installation                 #"
echo "#                                                                  #"
echo "#                                                                  #"
echo "####################################################################"

set OLD_ACCOUNT = ()
set ACCOUNT = "/usr/${SOFTWARE}_${VERSION}"

#******************************************************************************
# Check if install type is CDROM.
#******************************************************************************

set CURRENT_DIR = `pwd`
if ( ${CURRENT_DIR} == "/CDROM" ) then

    set CDROM_DIR = "/CDROM"

    #**************************************************************************
    # Copy media.
    #**************************************************************************

    echo ""
    echo "Beginning to copy ${PRODUCT} media to ${ACCOUNT}"
    echo -n "This will take about one minute, please wait..."

    cp -r ${CDROM_DIR} ${ACCOUNT}

    echo "done"

    cd $ACCOUNT

endif

#*****************************************************************************
#  Copy the libio shared object and tablet driver config files.
#*****************************************************************************

if ( (-d /usr/lib/discreet) == 0 ) then

    mkdir /usr/lib/discreet
    chown root.sys /usr/lib/discreet
    chmod 755 /usr/lib/discreet

endif

ln -sf ${ACCOUNT}/io/libio.so /usr/lib/discreet/libio.so

if ( (-d /usr/lib/X11/input/config) == 0 ) then

    mkdir /usr/lib/X11/input/config
    chown root.sys /usr/lib/X11/input/config
    chmod 755 /usr/lib/X11/input/config
   
endif

cp ${ACCOUNT}/bin/dlwacom /usr/lib/X11/input/config/dlwacom

#****************************************************************************
# Locate the currently used version of the product if one exists.
#****************************************************************************

set dirs = `ls -1d /usr/${SOFTWARE}_* | /sbin/grep -v ^/usr/${SOFTWARE}_${VERSION}\$`

if ( $#dirs ) then

   set oldVersionNbs = "-B None"

   foreach dir ( $dirs )

      set oldVersionNbs = "-b `echo ${dir:t} | cut -d_ -f2` ${oldVersionNbs}"

   end

   set header = "${PRODUCT} Version"
   set msg    = "Please select the currently used version of ${PRODUCT}."

   set OLD_ACCOUNT = "/usr/${SOFTWARE}_`QUESTION ${oldVersionNbs}`"

   if ( ${OLD_ACCOUNT} == "/usr/${SOFTWARE}_None" ) set OLD_ACCOUNT = ()
   if ( ${OLD_ACCOUNT} == "/usr/${SOFTWARE}_"     ) set OLD_ACCOUNT = ()

endif

#******************************************************************************
# Create the product user account.
#******************************************************************************

if ( ! { /usr/bin/egrep -s "^${LOGIN}:" /etc/passwd } ) then

   passmgmt -a -g20 -c"${PRODUCT} ${VERSION}" -h${ACCOUNT} -s/bin/csh ${LOGIN}

   passwd -d ${LOGIN}

endif

#******************************************************************************
# Change the ownership of the release directory files.
#******************************************************************************

chown -R ${LOGIN}.user ${ACCOUNT}

chown root ${ACCOUNT}/bin/*_IRIX_${IRIX_RELEASE}
chown root ${ACCOUNT}/bin/*_framestore

if ( -e ${ACCOUNT}/clip ) chown root ${ACCOUNT}/clip

chown -R root ${ACCOUNT}/menu
chown -R root ${ACCOUNT}/filter
chown -R root ${ACCOUNT}/lut

chown    root ${ACCOUNT}/${PAINT}
chown -R root ${ACCOUNT}/${PAINT}/brush
chown -R root ${ACCOUNT}/${PAINT}/geometry
chown -R root ${ACCOUNT}/${PAINT}/palette
chown -R root ${ACCOUNT}/${PAINT}/set
chown    root ${ACCOUNT}/imageio/*

#*******************************************************************************
# Change the access permissions of the release directory files.
#*******************************************************************************

find ${ACCOUNT} -type d -exec chmod 1750 {} \;
find ${ACCOUNT} -type f -exec chmod  640 {} \;

chmod 750 ${ACCOUNT}/INSTALL
chmod 750 ${ACCOUNT}/INSTALL_LICENCE
chmod 750 ${ACCOUNT}/INSTALL_MEM

chmod 4750 ${ACCOUNT}/bin/*_IRIX_${IRIX_RELEASE}
chmod 4750 ${ACCOUNT}/bin/*_framestore

chmod 1770 ${ACCOUNT}/cfg
chmod 0660 ${ACCOUNT}/cfg/*.cfg

if ( -e ${ACCOUNT}/clip ) chmod 1770 ${ACCOUNT}/clip

chmod 1770 ${ACCOUNT}/menu
chmod 1770 ${ACCOUNT}/filter
chmod 1770 ${ACCOUNT}/lut

chmod 1770 ${ACCOUNT}/${PAINT}/brush
chmod 1770 ${ACCOUNT}/${PAINT}/geometry
chmod 1770 ${ACCOUNT}/${PAINT}/palette
chmod 1770 ${ACCOUNT}/${PAINT}/set

chmod 1770 ${ACCOUNT}/io
chmod 4750 ${ACCOUNT}/io/*
chmod  750 ${ACCOUNT}/io/*.o
chmod 0660 ${ACCOUNT}/io/*.c
chmod 0660 ${ACCOUNT}/io/*.h
chmod 0660 ${ACCOUNT}/io/Make*
chmod 0660 ${ACCOUNT}/io/README

chmod 1770 ${ACCOUNT}/imageio
chmod 4750 ${ACCOUNT}/imageio/imcopy
chmod  750 ${ACCOUNT}/imageio/iminfo

chmod 1770 ${ACCOUNT}/sparks

if ( ${SOFTWARE} == "flame" || ${SOFTWARE} == 'inferno' ) then
   
  chmod 777 ${ACCOUNT}/Stone_+_Wire/CONFIG/*

endif


#******************************************************************************
# Is it a first-time installation?
#******************************************************************************

if ( ! ${#OLD_ACCOUNT} ) then

   #***************************************************************************
   # Create the licence file if required.
   #***************************************************************************

   set header = "Software Licence"
   set msg    = "Have you received a software licence from Discreet Logic?"

   if ( `QUESTION -B "No" -b "Yes"` == "Yes" ) then

      set header = "Entering Licence"
      set msg    = "Get ready to type in the software licence number."

      INFORM -B "OK" > /dev/null

      ${ACCOUNT}/INSTALL_LICENCE

   endif

   
   #***************************************************************************
   # Create the logical volume table if required.
   #***************************************************************************

   if ( $SWR_INSTALLED == 0 ) then

       set header = "Logical Volume Table"
       set msg    = "Do you need to create a logical volume table?"

       if ( `QUESTION -B "No" -b "Yes"` == "Yes" ) then

          set header = "File '/etc/lvtab'"
          set msg    = "Get ready to type in the logical volume table."

          INFORM -B "OK" > /dev/null

          jot -f /etc/lvtab

          chown root.sys /etc/lvtab
          chmod 644      /etc/lvtab

          while ( ! { mklv -f lv0 } )

             set header = "Logical Volume Table"
             set msg    = "'mklv' cannot create the logical volume 'lv0'."

             INFORM -B "OK" > /dev/null

             set header = "File '/etc/lvtab'"
             set msg    = "Get ready to update the logical volume table."

             INFORM -B "OK" > /dev/null

             jot -f /etc/lvtab

          end

       endif

   endif

   #***************************************************************************
   # Create the default configuration file if required.
   #***************************************************************************

   if ( ! -e ${ACCOUNT}/cfg/default.cfg ) then

      set header = "Default Configuration File"
      set msg    = "Please select your preferred frame resolution."

      switch ( `QUESTION -b "film" -b "PAL" -B "NTSC"` )
         case NTSC:
            cp ${ACCOUNT}/cfg/sample_ntsc.cfg ${ACCOUNT}/cfg/default.cfg
            breaksw
         case PAL:
            cp ${ACCOUNT}/cfg/sample_pal.cfg ${ACCOUNT}/cfg/default.cfg
            breaksw
         case film:
            cp ${ACCOUNT}/cfg/sample_film.cfg ${ACCOUNT}/cfg/default.cfg
            breaksw
      endsw

   endif

   #***************************************************************************
   # Customize the default configuration file.
   #***************************************************************************

   set header = "File 'default.cfg'"
   set msg    = "Get ready to customize the default configuration file."
   set msg3   = "Please refer to the Installation Guide for more information."

   INFORM -B "OK" > /dev/null

   jot -f ${ACCOUNT}/cfg/default.cfg

   if ( -e ${ACCOUNT}/cfg/default.cfg ) then

      chown ${LOGIN}.user ${ACCOUNT}/cfg/default.cfg
      chmod 640           ${ACCOUNT}/cfg/default.cfg

   endif

   set msg3   = ""

   #******************************************************************************
   # Disconnect the diagnostics terminal from serial port 1 if needed.
   #******************************************************************************

   if ( { /usr/bin/egrep -s '^t1:23:respawn:' /etc/inittab } ) then

      set header = "Serial Port 1"
      set msg    = "Do you need to make serial port 1 available for ${PRODUCT}?"

      if ( `QUESTION -b "No" -B "Yes"` == "Yes" ) then

	 sed -e 's/^t1:23:respawn:/t1:23:off:/' /etc/inittab > /etc/inittab.tmp
	 mv -f /etc/inittab.tmp /etc/inittab

	 chown root.sys /etc/inittab
	 chmod 644      /etc/inittab

	 telinit Q

      endif

   endif

   #******************************************************************************
   # Turn off unnecessary IRIX daemons and subsystems if needed.
   #******************************************************************************

   set header = "IRIX Daemons and Subsystems"
   set msg    = "Do you need to turn off unnecessary IRIX daemons and subsystems?"
   set msg2   = "These are the desktop, directoryserver, fontserver, mediad, objectserver, and soundscheme."

   if ( `QUESTION -b "No" -B "Yes"` == "Yes" ) then

      chkconfig desktop         off
      chkconfig directoryserver off
      chkconfig fontserver      off
      chkconfig mediad          off
      chkconfig objectserver    off
      chkconfig soundscheme     off
      set REBOOT_REQUIRED = "Yes"

   endif

   set msg2   = ""

#******************************************************************************
# Is it an updating installation?
#******************************************************************************

else
      set BETA_VERSION = `echo ${OLD_ACCOUNT} | cut -d_ -f2 | cut -c1`

      if ( ( ${SOFTWARE} == 'flame' || ${SOFTWARE} == "flint" ) && ${BETA_VERSION} == "4" ) then

         set BETA_UPDATE = "TRUE"
	
      else if  ( ${SOFTWARE} == 'inferno' && ${BETA_VERSION} == "1" ) then
      
         set BETA_UPDATE = "TRUE"
	
      else
      
         set BETA_UPDATE = "FALSE"
         
      endif
      
   #***************************************************************************
   # Create the licence file if required.
   #***************************************************************************

   set header = "Software Licence"
   set msg    = "Have you received a software licence from Discreet Logic?"

   if ( `QUESTION -B "No" -b "Yes"` == "Yes" ) then

      set header = "Entering Licence"
      set msg    = "Get ready to type in the software licence number."

      INFORM -B "OK" > /dev/null

      ${ACCOUNT}/INSTALL_LICENCE

   endif


   #***************************************************************************
   # Move the old clip directory.
   #***************************************************************************

   if ( ${BETA_UPDATE} == "TRUE" ) then
   
      if ( ! -l ${OLD_ACCOUNT}/clip ) then

	 rmdir ${OLD_ACCOUNT}/clip >& /dev/null
	 rmdir ${ACCOUNT}/clip     >& /dev/null

	 if ( -e ${OLD_ACCOUNT}/clip && ! -e ${ACCOUNT}/clip ) then

            mv ${OLD_ACCOUNT}/clip ${ACCOUNT}/clip

	 endif

	 if ( -e ${ACCOUNT}/clip ) then

            chown -R ${LOGIN}.user ${ACCOUNT}/clip

            find ${ACCOUNT}/clip -type d           -exec chown root {} \;
            find ${ACCOUNT}/clip -type f -name .\* -exec chown root {} \;

            find ${ACCOUNT}/clip -type f -exec chmod 660 {} \;

            find ${ACCOUNT}/clip -type d           -exec chmod 1770 {} \;
            find ${ACCOUNT}/clip -type f -name .\* -exec chmod  640 {} \;

	 endif

	 if ( ! -e ${OLD_ACCOUNT}/clip && -e ${ACCOUNT}/clip ) then

            ( umask 007; ln -s ${ACCOUNT}/clip ${OLD_ACCOUNT}/clip )

            chown -h root.user ${OLD_ACCOUNT}/clip

	 endif

      endif

   endif
   
   #***************************************************************************
   # Copy the custom resource files.
   #***************************************************************************

   set header = "Resource Files"
   set msg    = "Do you want to carry over your custom resource files?"
   set msg2   = "These include LUTs, custom menus, filters, brushes, palettes, and paint brush setups."
   set msg5   = "WARNING: Check the Release Notes for backward compatibility of these files."

   if ( `QUESTION -b "No" -B "Yes"` == "Yes" ) then
   
      set OLD_VER = `echo $OLD_ACCOUNT | cut -d_ -f2 | cut -c3`

      if ( ${OLD_VER} == "0" || ${OLD_VER} == "1" ) then

        # if this is an update from a version which uses "spark" or "fire" as the paint dir

         set dir=1

         while ( ${dir} <= $#OLD_resourceDirs )

            @ nbFiles = `ls -1 ${OLD_ACCOUNT}/${OLD_resourceDirs[$dir]} | wc -l`

            if ( ${nbFiles} ) then

               pushd ${OLD_ACCOUNT}/${OLD_resourceDirs[$dir]}

               foreach oldFile ( * )

        	  set newFile = "${ACCOUNT}/${resourceDirs[$dir]}/${oldFile}"

        	  if ( -f "${oldFile}" && ! -e "${newFile}" ) then

                     echo "Copying '${OLD_ACCOUNT}/${OLD_resourceDirs[$dir]}/${oldFile}'."

                     cp "${oldFile}" "${newFile}"

                     chown ${LOGIN}.user "${newFile}"
                     chmod 640           "${newFile}"

        	  endif

               end

               popd

            endif

            @ dir = $dir + 1

	 end

      else 

         # if this is an update from a version which uses "paint" as the paint dir
	 foreach dir ( ${resourceDirs} )

            @ nbFiles = `ls -1 ${OLD_ACCOUNT}/${dir} | wc -l`

            if ( ${nbFiles} ) then

               pushd ${OLD_ACCOUNT}/${dir}

               foreach oldFile ( * )

        	  set newFile = "${ACCOUNT}/${dir}/${oldFile}"

        	  if ( -f "${oldFile}" && ! -e "${newFile}" ) then

                     echo "Copying '${OLD_ACCOUNT}/${dir}/${oldFile}'."

                     cp "${oldFile}" "${newFile}"

                     chown ${LOGIN}.user "${newFile}"
                     chmod 640           "${newFile}"

        	  endif

               end

               popd

            endif

	 end

      endif

   endif

   set msg2 = ""
   set msg5 = ""

   #***************************************************************************
   # Copy the setup files.
   #***************************************************************************

   set header = "Setup Files"
   set msg    = "Do you want to carry over your setup files?"
   set msg5   = "WARNING: Check the Release Notes for backward compatibility of these files."

   if ( `QUESTION -b "No" -B "Yes"` == "Yes" ) then

      if ( ${OLD_VER} == "0" || ${OLD_VER} == "1" ) then 

         # if this is an update from a version which uses "spark" or "fire" as the paint dir

         set dir=1

         while ( ${dir} <= $#OLD_setupDirs )

            if ( -e ${OLD_ACCOUNT}/${OLD_setupDirs[$dir]} ) then

               @ nbFiles = `ls -1 ${OLD_ACCOUNT}/${OLD_setupDirs[$dir]} | wc -l`

               if ( ${nbFiles} ) then

        	  echo "Copying '${OLD_ACCOUNT}/${setupDirs[$dir]}' to '${ACCOUNT}/${setupDirs[$dir]}'."

		  cp ${OLD_ACCOUNT}/${OLD_setupDirs[$dir]}/* ${ACCOUNT}/${setupDirs[$dir]}

               endif

            endif

            @ dir = $dir + 1

         end

      else

         # if this is an update from a version which uses "paint" as the paint dir
	 foreach dir ( ${setupDirs} )

            if ( -e ${OLD_ACCOUNT}/${dir} ) then

               @ nbFiles = `ls -1 ${OLD_ACCOUNT}/${dir} | wc -l`

               if ( ${nbFiles} ) then

        	  echo "Copying '${OLD_ACCOUNT}/${dir}' to '${ACCOUNT}/${dir}'."

		  cp ${OLD_ACCOUNT}/${dir}/* ${ACCOUNT}/${dir}

               endif

            endif

         end

      endif

   endif

   set msg5 = ""

   #************************************************************************
   # Copy the old default configuration file if it exists.
   #************************************************************************

   if ( ${BETA_UPDATE} == "TRUE" ) then

      if ( -e ${OLD_ACCOUNT}/cfg/default.cfg ) then

         cp ${OLD_ACCOUNT}/cfg/default.cfg ${ACCOUNT}/cfg/

      endif

   endif

   #***************************************************************************
   # Create the default configuration file if required.
   #***************************************************************************

   if ( ! -e ${ACCOUNT}/cfg/default.cfg ) then

      #************************************************************************
      # Create the default configuration file if required.
      #************************************************************************

      set header = "Default Configuration File"
      set msg    = "Please select your preferred frame resolution."
      set msg5   = "WARNING: Check the Release Notes for changes to the config file."

      switch ( `QUESTION -b "film" -b "PAL" -B "NTSC"` )
         case NTSC:
            cp ${ACCOUNT}/cfg/sample_ntsc.cfg ${ACCOUNT}/cfg/default.cfg
            breaksw
         case PAL:
            cp ${ACCOUNT}/cfg/sample_pal.cfg ${ACCOUNT}/cfg/default.cfg
            breaksw
         case film:
            cp ${ACCOUNT}/cfg/sample_film.cfg ${ACCOUNT}/cfg/default.cfg
            breaksw
      endsw

      set msg5 = ""

   endif


   #***************************************************************************
   # Update the default configuration file.
   #***************************************************************************

   set header = "File 'default.cfg'"
   set msg    = "Get ready to update the default configuration file."
   set msg4   = "WARNING: Check the Release Notes for changes to the config file."

   INFORM -B "OK" > /dev/null

   set msg4   = ""

   jot -f ${ACCOUNT}/cfg/default.cfg

   if ( -e ${ACCOUNT}/cfg/default.cfg ) then

      chown ${LOGIN}.user ${ACCOUNT}/cfg/default.cfg
      chmod 640           ${ACCOUNT}/cfg/default.cfg

   endif

endif



#*****************************************************************************
# Update the system for inferno
#*****************************************************************************

if ( ${SOFTWARE} == "inferno") then

   set REBOOT_REQUIRED = "Yes"
   ${ACCOUNT}/INSTALL_MEM
   
endif



#******************************************************************************
# Check dlwacom driver registration for possible update.
#******************************************************************************

set DLWACOM_ID = `ml | /sbin/grep dlwacom | cut -d: -f2 | cut -c1-5`

if ( (`/sbin/ml unreg $DLWACOM_ID >& /dev/null`) == 0 ) then 
   set REBOOT_REQUIRED = "Yes"
endif



#******************************************************************************
# Installation completed.
#******************************************************************************

set header = "INSTALL"
set msg    = "${PRODUCT} installation completed."

INFORM -B "OK" > /dev/null

#***************************************************************************
# Reboot the workstation.
#***************************************************************************

if ( ${REBOOT_REQUIRED} == "Yes" ) then

   set header = "Restart IRIX"
   set msg    = "Changes to the IRIX Daemons and Subsystems require rebooting the system."
   set msg2   = "However, if you are going to install the Stone + Wire driver you should wait until that is done."
   set msg5   = "DO you want to reboot the workstation now?"

   if ( `QUESTION -b "No" -B "Yes"` == "Yes" ) then
   
      reboot
   
   endif

endif

exit 0
