slitaz-forge rev 539

dir-generator.php: auto refresh .filelist
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu May 01 16:45:34 2014 +0000 (2014-05-01)
parents d0383e006701
children 17d70cbe5f1b
files boot/gpxe mirror/info/bin/chksrc mirror/root/dir-generator.php usbkey/tail.php
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/boot/gpxe	Thu May 01 16:45:34 2014 +0000
     1.3 @@ -0,0 +1,3 @@
     1.4 +#!gpxe
     1.5 +kernel http://mirror.slitaz.org/boot/gpxe.pxe
     1.6 +boot
     2.1 --- a/mirror/info/bin/chksrc	Thu May 01 11:16:37 2014 +0200
     2.2 +++ b/mirror/info/bin/chksrc	Thu May 01 16:45:34 2014 +0000
     2.3 @@ -1,12 +1,21 @@
     2.4  #!/bin/sh
     2.5  
     2.6  . /etc/tazwok.conf
     2.7 +PURGE=
     2.8 +while true; do
     2.9 +	case "$1" in
    2.10 +	--purge) PURGE="yes";;
    2.11 +	*) break;;
    2.12 +	esac
    2.13 +	shift
    2.14 +done
    2.15  WOK=/home/slitaz/${1:-cooking}/wok
    2.16  SRC=/var/www/slitaz/mirror/sources/packages-${1:-cooking}
    2.17  SRC2=/var/www/slitaz/mirror/sources/packages
    2.18  
    2.19  for i in $WOK/*/receipt ; do
    2.20  	unset TARBALL EXTRA_SOURCE_FILES WGET_URL WANTED PACKAGE VERSION
    2.21 +	ARCH=${2:-i486}
    2.22  	. $i
    2.23  	[ -n "$WANTED" ] && continue
    2.24  	if [ -z "$TARBALL$EXTRA_SOURCE_FILES" ]; then
    2.25 @@ -42,9 +51,10 @@
    2.26  		grep -q ^$(basename $i)$ /tmp/tarball$$ && continue
    2.27  		;;
    2.28  	esac
    2.29 -	echo $i
    2.30 +	echo $i && [ "$PURGE" == "yes" ] && \rm -i $i
    2.31  done
    2.32  rm -f /tmp/tarball$$ /tmp/wget_url$$
    2.33  for i in $SRC2/?/* ; do
    2.34 -	[ $(stat -c "%h" $i) -eq 1 ] && echo $i
    2.35 +	[ $(stat -c "%h" $i) -eq 1 ] && echo $i &&
    2.36 +	[ "$PURGE" == "yes" ] && echo "Purge $i" && rm -f $i
    2.37  done
     3.1 --- a/mirror/root/dir-generator.php	Thu May 01 11:16:37 2014 +0200
     3.2 +++ b/mirror/root/dir-generator.php	Thu May 01 16:45:34 2014 +0000
     3.3 @@ -340,7 +340,8 @@
     3.4  //return date('Y-M-d H:m:s', filemtime($path));
     3.5  }
     3.6  
     3.7 -if (filesize($path.".folderlist") > 0 && filesize($path.".filelist") > 0) {
     3.8 +if (filesize($path.".folderlist") > 0 && filesize($path.".filelist") > 0 &&
     3.9 +    filemtime($path."/.filelist") > filemtime($path)) {
    3.10  	$folderlist = unserialize(file_get_contents($path.".folderlist"));
    3.11  	$filelist = unserialize(file_get_contents($path.".filelist"));
    3.12  }
     4.1 --- a/usbkey/tail.php	Thu May 01 11:16:37 2014 +0200
     4.2 +++ b/usbkey/tail.php	Thu May 01 16:45:34 2014 +0000
     4.3 @@ -13,14 +13,25 @@
     4.4  <a href="http://validator.w3.org/check?uri=referer"><img src="/static/xhtml10.png" alt="Valid XHTML 1.0" title="Code validé XHTML 1.0" style="width: 80px; height: 15px;" /></a>
     4.5  </p>
     4.6  <p>
     4.7 -	<img src="#" id="qrcodeimg" alt="#" width="60" height="60"
     4.8 -	     onmouseover= "this.title = location.href"
     4.9 -	     onclick= "this.width = this.height = 300" />
    4.10 -	<script type="text/javascript" src="/static/qrcode.js"></script>
    4.11 +	<!-- script type="text/javascript" src="/static/qrcode.js"></script -->
    4.12  	<script type="text/javascript">
    4.13 -		document.getElementById('qrcodeimg').src =
    4.14 -			QRCode.generatePNG(location.href, {ecclevel: 'H'});
    4.15 +	function QRCodePNG(str, obj) {
    4.16 +		try {
    4.17 +			return QRCode.generatePNG(str, {ecclevel: 'H'});
    4.18 +		}
    4.19 +		catch (any) {
    4.20 +			var element = document.createElement("script");
    4.21 +			element.src = "/static/qrcode.js";
    4.22 +			element.type ="text/javascript"; 
    4.23 +			element.onload = function() {
    4.24 +				obj.src = QRCode.generatePNG(str, {ecclevel: 'H'});
    4.25 +			};
    4.26 +			document.body.appendChild(element);
    4.27 +		}
    4.28 +	}
    4.29  	</script>
    4.30 +	<img src="/static/qr.png" alt="#" onmouseover="this.title = location.href"
    4.31 +		onclick="this.src = QRCodePNG(location.href, this)" />
    4.32  </p>
    4.33  </div>
    4.34