Différences entre les versions de « Auto-éditer un wikilivre/Annexer (Version internationalisée)/users install annex.sh »

m
Mise à jour du code
m (Mise à jour du code)
m (Mise à jour du code)
#O Version
VERSION=210425210519
if [ "$1" = "--v" ]; then echo "Version of users_install_annex.sh "$VERSION; exit 0; fi
 
cd $Workdir
echo -n "The current directory to create $Workdir sub directories = "; pwd
mkdir bin books datas lib man lib/src resources sbin share src temp tests vars
cd share
echo "$Workdir/share is the current directory to create sub share directories."; pwd
#O print copy all source files to appropriate directory
rm -r ~/tmp; mkdir ~/tmp
if [ "$1" = "/usr/local/" ] #i1if1
then
ls -l /usr/local/src > ~/tmp/src.txt
#T
echo "Nblines = $nblines"
if [ "$nblines" != "1011" ] #i2if2
then
echo " Nuber of files '$nblines' in /usr/local/src is incorrect"
echo " Please copy all nine annex internationalized sources files in $Workdir/src directory to update $Installdir/bin";
fi #iif-2
fi #iif-1
 
#T Test if working/src dir empty
#T echo " Nb files in $Workdir/src is '$n'"
echo; echo " Directory $Workdir/src is empty"
echo " If you want install or update $Installdir/bin directory, copy all nineten annex internationalized sources files in $Workdir/src directory";
else
ls -l $Workdir/src > ~/tmp/src.txt
wc -l ~/tmp/src.txt | cut -d ' ' -f1 > ~/tmp/nblines.txt
read nblines < ~/tmp/nblines.txt
if [ "$nblines" != "1011" ] #i2
then
echo " Number of files '$nbline' in /usr/local/src is incorrect"
echo " Please copy all nineten annex internationalized sources files in $Workdir/src directory to update bin directory"
else
echo " Want you update $Bindir files ?"
read -s -n1 -pinkey inkey;echo;
if [ "$inkey" = 'y' ]; #i3if3
then echo;
#O *** Copy src files from install directory to bin directory
fi #i-1
rm $Workdir/datasvars/installdir.var
echo "Installdir=$Installdir" > $Workdir/datasvars/installdir.var
echo "Workdir=$Workdir" >> $Workdir/datasvars/installdir.var
echo; echo "Bindir=$Bindir"Content >>of file $Workdir/datasvars/installdir.var"
cat $Workdir/datasvars/installdir.var
if ! test -e /usr/local/lib/annex.lib || ! test -e $Workdir/lib/annex.lib
then
if ! test -e /usr/local/lib/annex.lib ; then Libdir=/usr/local/lib; elif ! test -e $Workdir/lib/annex.lib ; then Libdir=$Workdir/lib; fi
echo "Libdir=$Libdir" >> $Workdir/datas/installdir.var
echo; echo "Found in $Libdir : "; ls $Libdir
else echo; echo "Lib directory not found"
fi
if ! test -e /usr/local/sbin/users_install_annex.sh || ! test -e $Workdir/sbin/users_install_annex.sh ;
then
if ! test -e /usr/local/sbin/users_install_annex.sh ; then Sbindir=/usr/local/sbin; elif ! test -e $Workdir/sbin/users_install_annex.sh ; then Sbindir=$Workdir/sbin; fi
echo "Sbindir=$Sbindir" >> $Workdir/datas/installdir.var
echo; echo "annex.lib found in $Sbindir : "; ls $Sbindir; echo
else echo "sbin directory not found"
fi
echo; echo "Content of file $Workdir/datas/installdir.var"
cat $Workdir/datas/installdir.var
if [ $1 = "Annexer" ] && [ $n = "0" ];