wok-current rev 5823

tazbb: add stable support for log.php
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jul 15 17:53:08 2010 +0200 (2010-07-15)
parents 1003bb898736
children f4ab8a128b6f
files tazbb/stuff/tazbb tazbb/stuff/web/index.php tazbb/stuff/web/log.php
line diff
     1.1 --- a/tazbb/stuff/tazbb	Thu Jul 15 14:33:06 2010 +0200
     1.2 +++ b/tazbb/stuff/tazbb	Thu Jul 15 17:53:08 2010 +0200
     1.3 @@ -16,6 +16,10 @@
     1.4  else
     1.5  	echo -e "\nNo config file found: tazbb.conf...\n" && exit 0
     1.6  fi
     1.7 +LOG_SUFFIX=""
     1.8 +case "$HG_WOK" in
     1.9 +*stable) LOG_SUFFIX="&stable=1";;
    1.10 +esac
    1.11  
    1.12  # Tazbb is only for root.
    1.13  if test $(id -u) != 0 ; then
    1.14 @@ -325,7 +329,7 @@
    1.15  		# Rebuild unbuilt packages list with link to log file. This list
    1.16  		# is also generated by cook_inslall to have real time stats.
    1.17  		if [ ! -d $BUILD_WOK/$PACKAGE/taz ]; then
    1.18 -			echo "<a href=\"log.php?package=$(escape $PACKAGE)\">$PACKAGE</a>" \
    1.19 +			echo "<a href=\"log.php?package=$(escape $PACKAGE)$LOG_SUFFIX\">$PACKAGE</a>" \
    1.20  				>> $DB_DIR/unbuilt
    1.21  		fi
    1.22  	done
    1.23 @@ -364,7 +368,7 @@
    1.24  	BUILD_DEPENDS=""
    1.25  	SOURCE=""
    1.26  	WANTED=""
    1.27 -	echo "(cooking <a href=\"log.php?package=$(escape $pkg)\">$pkg</a>)" > $DB_DIR/running
    1.28 +	echo "(cooking <a href=\"log.php?package=$(escape $pkg)$LOG_SUFFIX\">$pkg</a>)" > $DB_DIR/running
    1.29  	tazwok clean $pkg
    1.30  	script -c "echo 'install' | tazwok cook $pkg" $LOG_DIR/$pkg.log
    1.31  	# Install new package (important for new shared libs). Note
    1.32 @@ -440,7 +444,7 @@
    1.33  	do
    1.34  		if ! cook_package $pkg; then
    1.35  			# Link to build log.
    1.36 -			echo "<a href=\"log.php?package=$(escape $pkg)\">$pkg</a>" >> \
    1.37 +			echo "<a href=\"log.php?package=$(escape $pkg)$LOG_SUFFIX\">$pkg</a>" >> \
    1.38  				$DB_DIR/unbuilt
    1.39  		fi
    1.40  		missing_depends="$(check_depends_pkg $pkg)"
    1.41 @@ -454,7 +458,7 @@
    1.42  			# Unbuild package
    1.43  			rm -rf $BUILD_WOK/$pkg/taz
    1.44  			# Link to build log.
    1.45 -			echo "<a href=\"log.php?package=$(escape $pkg)\">$pkg</a>" >> \
    1.46 +			echo "<a href=\"log.php?package=$(escape $pkg)$LOG_SUFFIX\">$pkg</a>" >> \
    1.47  				$DB_DIR/unbuilt
    1.48  		fi
    1.49  		# Remove package from the cooklist and empty lines for HTML <pre>.
    1.50 @@ -699,7 +703,7 @@
    1.51  	for pkg in `cat $DB_DIR/blocked`
    1.52  	do
    1.53  		if [ -f $LOG_DIR/$pkg.log ]; then
    1.54 -			echo "<a href=\"log.php?package=$(escape $pkg)\">$pkg</a>" >> \
    1.55 +			echo "<a href=\"log.php?package=$(escape $pkg)$LOG_SUFFIX\">$pkg</a>" >> \
    1.56  				$DB_DIR/blocked.urls
    1.57  		else
    1.58  			echo "$pkg" >> $DB_DIR/blocked.urls
    1.59 @@ -728,7 +732,7 @@
    1.60  				if [ ! -f fs.cpio.gz -a ! -f fs.cpio.lzma ]; then
    1.61  					echo "Missing filesystem    `basename $pkg`"
    1.62  					if [ -f $LOG_DIR/$PACKAGE.log ];then
    1.63 -						echo "Missing filesystem    `basename $pkg` <a href=\"log.php?package=$(escape $PACKAGE)\">Log</a>" \
    1.64 +						echo "Missing filesystem    `basename $pkg` <a href=\"log.php?package=$(escape $PACKAGE)$LOG_SUFFIX\">Log</a>" \
    1.65  							>> $DB_DIR/corrupted
    1.66  					else
    1.67  						echo "Missing filesystem    `basename $pkg`" \
    1.68 @@ -742,7 +746,7 @@
    1.69  					if [ -z "$files" ]; then
    1.70  						echo "Empty filesystem      `basename $pkg`"
    1.71  						if [ -f $LOG_DIR/$PACKAGE.log ]; then
    1.72 -							echo "Empty filesystem      `basename $pkg` <a href=\"log.php?package=$(escape $PACKAGE)\">Log</a>" \
    1.73 +							echo "Empty filesystem      `basename $pkg` <a href=\"log.php?package=$(escape $PACKAGE)$LOG_SUFFIX\">Log</a>" \
    1.74  								>> $DB_DIR/corrupted
    1.75  						else
    1.76  							echo "Empty filesystem      `basename $pkg`" \
     2.1 --- a/tazbb/stuff/web/index.php	Thu Jul 15 14:33:06 2010 +0200
     2.2 +++ b/tazbb/stuff/web/index.php	Thu Jul 15 17:53:08 2010 +0200
     2.3 @@ -92,7 +92,10 @@
     2.4  
     2.5  <p>
     2.6  <form action="log.php" method="get">
     2.7 -	Show cooklog: <input type="text" name="package" />
     2.8 +<?php
     2.9 +	if ($version == 'stable')
    2.10 +		echo '<input type="hidden" name="stable" value="1" />';
    2.11 +?>	Show cooklog: <input type="text" name="package" />
    2.12  	<!-- <input type="submit" value="Show" /> -->
    2.13  </form>
    2.14  </p>
     3.1 --- a/tazbb/stuff/web/log.php	Thu Jul 15 14:33:06 2010 +0200
     3.2 +++ b/tazbb/stuff/web/log.php	Thu Jul 15 17:53:08 2010 +0200
     3.3 @@ -1,4 +1,10 @@
     3.4  <?php
     3.5 +$version='cooking';
     3.6 +$wok='wok';
     3.7 +if (isset($_GET['stable'])) {
     3.8 +	$version='stable';
     3.9 +	$wok='wok-stable';
    3.10 +}
    3.11  include("conf.php");
    3.12  ?>
    3.13  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    3.14 @@ -20,7 +26,7 @@
    3.15      <a href="http://bb.slitaz.org/"><img id="logo"
    3.16      src="pics/website/logo.png" title="bb.slitaz.org" alt="bb.slitaz.org"
    3.17      style="border: 0px solid ; width: 200px; height: 74px;" /></a>
    3.18 -    <p id="titre">#!/bb/packages</p>
    3.19 +    <p id="titre">#!/bb/packages<?php if ($version == 'stable') echo '/stable'; ?></p>
    3.20  </div>
    3.21  
    3.22  <!-- Navigation menu -->