#!/bin/sh

source master_vars.sh

# Update system
${ROOTCMD} apt-get -f -y --force-yes install
${ROOTCMD} apt-get -f -y --force-yes update
${ROOTCMD} apt-get -f -y --force-yes dist-upgrade



cat << 'EOF' > $LOGHTMLPATH/$LOGHTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Buildcross results: Emdebian vs Debian (unstable)</title>  <link rev="made" href="mailto:webmaster\@emdebian.org">
  <link rel="shortcut icon" href="http://www.emdebian.org/favicon.ico">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#800080" alink="#FF0000">
<table width="100%" align="center" border="0" cellpadding="3" cellspacing="0" summary="">
<tr>
  <td align="left" valign="middle">
  <a href="http://www.emdebian.org/"><img src="http://www.emdebian.org/Pics.bak/emdebian_swirl.jpg" border="0" hspace="0" 
  vspace="0" alt="emdebian logo" width="310" height="61"></a>
  </td>
</tr>
</table>
<table bgcolor="#DF0451" border="0" cellpadding="0" cellspacing="0" width="100%" summary="">
<tr>
<td valign="top">
<img src="http://www.emdebian.org/Pics.bak/red-upperleft.png" align="left" border="0" hspace="0" vspace="0" 
alt="" width="15" height="16">
</td>
<td rowspan="2" align="center">
<a href="http://www.emdebian.org/News/index.html"><img src="http://www.emdebian.org/Pics.bak/news.en.png" align="middle" 
border="0" hspace="4" vspace="7" alt="news" width="48" height="18"></a>
<a href="http://www.emdebian.org/projects.html"><img src="http://www.emdebian.org/Pics.bak/projects.en.png" align="middle" 
border="0" hspace="4" vspace="7" alt="emdebian projects" width="62" height="18"></a>
<a href="http://www.emdebian.org/support.html"><img src="http://www.emdebian.org/Pics.bak/support.en.png" align="middle" 
border="0" hspace="4" vspace="7" alt="support" width="62" height="18"></a>
<a href="http://www.emdebian.org/develinfo.html"><img src="http://www.emdebian.org/Pics.bak/devel.en.png" align="middle" 
border="0" hspace="4" vspace="7" alt="development" width="89" height="18"></a>
<td valign="top">
<img src="http://www.emdebian.org/Pics.bak/red-upperright.png" align="right" border="0" hspace="0" vspace="0" 
alt="" width="16" height="16">
</td>

</tr>
<tr>
<td valign="bottom">
<img src="http://www.emdebian.org/Pics.bak/red-lowerleft.png" align="left" border="0" hspace="0" vspace="0" 
alt="" width="16" height="16">
</td>
<td valign="bottom">
<img src="http://www.emdebian.org/Pics.bak/red-lowerright.png" align="right" border="0" hspace="0" vspace="0" 
alt="" width="15" height="16">
</td>
</tr>
</table>
<div><h1>
Emdebian buildcross toolchain updates: unstable</h1>
<p>This page is generated automatically by buildcross infrastructure to check latest status in
Emdebian toolchain <b>unstable</b> repository against upstream Debian unstable.</p>
<table border="1"><colgroup><col width="30%"><col width="10%">
<col width="30%"></colgroup>
<br>
<p>You can check <a href="./logs/build.log">buildcross complete log</a></p>
<b>BUILD-HOST : ARCH : SUITE : PKG : LOGFILE : STATUS</b> <br>
EOF

for ARCH in $ARCHLIST; do
	# Do PKGLIST
	for PKG in $PKGLIST; do
		# Check if it is already latest version built

		# Builds certain PKG for certain ARCH
		nice -n +15 ./em_build.sh $PKG $ARCH

		# Anything else to do?
	done
		
	# Anything else to do?
done

cat << 'EOF' >> $LOGHTMLPATH/$LOGHTML
</table>
</body></html>
EOF

