]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
mg-debian-installer-update: Update "current" symlink, if appropriate
authorIan Campbell <ian.campbell@citrix.com>
Fri, 26 Jun 2015 10:31:31 +0000 (11:31 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 26 Jun 2015 10:41:03 +0000 (11:41 +0100)
Where "appropriate" means if TftpDiVersion is set to current, which is
the default in standalone mode. The assumption is that someone wuth
that configration runs mg-debian-installer-update then they would
expected the update to be immediately effective.

There was some existing, but commented, code to do this update,
reinstate it with the correct condition and adjusting for the addition
of -$suite to the patch many moons ago.

There is no impact on any production configuration, since they always
set TftpDiVersion.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
mg-debian-installer-update

index 1595ae5e1f9bd0d1e088c98af234b175fac6ac70..77d806d6e2583b2aa158b4cbf2026a84a1f7b606 100755 (executable)
@@ -67,6 +67,7 @@ esac
 
 pfile=$sbase/non-free/binary-$arch/Packages.gz
 
+tftpdiversion=`getconfig TftpDiVersion`
 dstroot=`getconfig TftpPath`/`getconfig TftpDiBase`/
 date=`date +%Y-%m-%d`
 dst=$arch/$date-$suite
@@ -192,10 +193,12 @@ done
 
 rm Packages.gz
 
-#cd $dstroot/$arch
-#rm -rf current.new
-#ln -s $date current.new
-#mv -Tf current.new current
+if [ x$tftpdiversion = xcurrent ]; then
+    cd $dstroot/$arch
+    rm -rf current-$suite.new
+    ln -s $date-$suite current-$suite.new
+    mv -Tf current-$suite.new current-$suite
+fi
 
 echo "TftpDiVersion $date"
 echo >&2 "downloaded $dstroot/$dst"