Skip to contentSkip to conversation

mg-debian-installer-update: Print the correct value for TftpDiVersion

PATCH Superseded Ian Campbell 2 participants 5 messages Jun 23, 2015 – Jun 25, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mg-debian-installer-update: Print the correct value for TftpDiVersion

That is, the date without the suite suffix.

---
 mg-debian-installer-update | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
mg-debian-installer-update +4 -4
index ba2fdc4..59f05ec 100755
@@ -68,8 +68,8 @@ esac
 pfile=$sbase/non-free/binary-$arch/Packages.gz
 
 dstroot=`getconfig TftpPath`/`getconfig TftpDiBase`/
-date=`date +%Y-%m-%d`-$suite
-dst=$arch/$date
+date=`date +%Y-%m-%d`
+dst=$arch/$date-$suite
 
 cd $dstroot
 mkdir -p $dst
@@ -197,5 +197,5 @@ rm Packages.gz
 #ln -s $date current.new
 #mv -Tf current.new current
 
-echo $date
-echo >&2 "downloaded $dstroot/$arch/$date"
+echo "New TftpDiVersion: $date"
+echo >&2 "downloaded $dstroot/$dst"
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/2 mg-debian-installer-update: Update "current" symlink, if appropriate

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.

---
 mg-debian-installer-update | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
mg-debian-installer-update +7 -4
index 59f05ec..f7a954a 100755
@@ -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 "New TftpDiVersion: $date"
 echo >&2 "downloaded $dstroot/$dst"
Signature · 1 line
2.1.4
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH OSSTEST 2/2] mg-debian-installer-update: Update "current" symlink, if appropriate

Ian Campbell writes ("[PATCH OSSTEST 2/2] mg-debian-installer-update: Update "current" symlink, if appropriate"):

Quoted 11 lines

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.

#3 lore raw
In reply to Ian Campbell

Ian Campbell writes ("[PATCH OSSTEST 1/2] mg-debian-installer-update: Print the correct value for TftpDiVersion"):

Quoted 1 line

That is, the date without the suite suffix.

...

mg-debian-installer-update rm Packages.gz · line 201

Quoted 4 lines
mg-debian-installer-update +2 -2
-echo $date
-echo >&2 "downloaded $dstroot/$arch/$date"
+echo "New TftpDiVersion: $date"
+echo >&2 "downloaded $dstroot/$dst"

You could make the output suitable for c&p ?

+echo "TftpDiVersion $date"

Ian.

#4 lore raw
Quoted 11 lines · Ian Jackson

Ian Campbell writes ("[PATCH OSSTEST 1/2] mg-debian-installer-update: Print the correct value for TftpDiVersion"):

Quoted 1 line

That is, the date without the suite suffix.

...

mg-debian-installer-update rm Packages.gz · line 201

Quoted 4 lines
mg-debian-installer-update +2 -2
-echo $date
-echo >&2 "downloaded $dstroot/$arch/$date"
+echo "New TftpDiVersion: $date"
+echo >&2 "downloaded $dstroot/$dst"

You could make the output suitable for c&p ?

+echo "TftpDiVersion $date"

Good idea. Shall I resend or just do it on commit?