wok diff tramys-server/stuff/tramys2.cgi @ rev 19685

Up tazpkg (942)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sun Feb 12 04:43:38 2017 +0200 (2017-02-12)
parents e96aa956e72e
children 02c70d036ea0
line diff
     1.1 --- a/tramys-server/stuff/tramys2.cgi	Tue Aug 26 13:31:50 2014 +0300
     1.2 +++ b/tramys-server/stuff/tramys2.cgi	Sun Feb 12 04:43:38 2017 +0200
     1.3 @@ -16,6 +16,7 @@
     1.4  #    HTTP_COOKIE (dl=DLKEY) -> send /tmp/tmp.DLKEY.tgz file
     1.5  
     1.6  . /usr/bin/httpd_helper.sh
     1.7 +. /home/slitaz/www/cook/tramys2.msg # translations
     1.8  
     1.9  WORKING=$(busybox mktemp -d) # make temp working dir /tmp/tmp.??????
    1.10  DATADIR=/usr/share/tramys    # this folder contains lists
    1.11 @@ -125,23 +126,18 @@
    1.12  		NUM=1 # initial value
    1.13  
    1.14  		echo -e "Content-Type: text/plain\n\n" # to Yad client
    1.15 -		echo "#Number of packages: $PKGNUM"    # Message to Yad log
    1.16 -		echo "#Searching in progress..."       # And another one
    1.17 +		msg 1 # Message to Yad log
    1.18  
    1.19  		copy_translations
    1.20  
    1.21 -		echo "#"                                  # Message to Yad log
    1.22 -		echo "#Preparing archive. Please wait..." # And another one
    1.23 +		msg 2 # Message to Yad log
    1.24  
    1.25  		# Make the archive from working dir and remove temp working dir.
    1.26  		busybox tar -czf $WORKING.tgz -C $WORKING .
    1.27  		rm -rf $WORKING
    1.28  
    1.29 -		echo "#" # to Yad client log
    1.30 -		echo "#Done!"
    1.31 -		echo "#Now you can proceed to downloading"
    1.32 -		echo "#and installing your translations."
    1.33 -		echo "#File size: $(stat -c %s $WORKING.tgz) bytes."
    1.34 +		SIZE=$(ls -lh $WORKING.tgz | awk '{print $5}')
    1.35 +		msg 3 # Message to Yad log
    1.36  
    1.37  		echo "${WORKING#*.}" # give download token to Yad client
    1.38  		exit 0 ;;
    1.39 @@ -151,7 +147,7 @@
    1.40  		archive="/tmp/tmp.$(echo $arg | tr -cd 'A-Za-z0-9').tgz"
    1.41  		rm -f $archive
    1.42  		cat <<EOT
    1.43 -Content-Type: text/plain
    1.44 +Content-Type: text/plain; charset=UTF-8
    1.45  Content-Length: 0
    1.46  
    1.47  EOT