Skip to contentSkip to conversation

bin/release_scripts/release.py

PATCH New Graydon, Tracy 1 participant 3 messages Feb 19, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 bin/release_scripts/release.py

Fixed tarball repackaging to add missing branch name to the new tarball name. i.e. <blob>-<hash>.tar.bz2 was being renamed to <blob>-<poky-ver>.14.0.1.tar.bz2, which is wrong. Should be renamed to <blob>-<branch>-<poky-ver>.tar.bz2.

---
 bin/release_scripts/release.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
bin/release_scripts/release.py +2 -1
index 83c198e..8751a04 100755
@@ -94,7 +94,7 @@ def fix_tarballs():
         filename = chunks[0]
         basename = split_thing(filename, "-")
         index = len(basename)-1
-        basename[index] = POKY_VER
+        basename[index] = "-".join([BRANCH, POKY_VER])
         new_name = rejoin_thing(basename, "-")
         chunks[0] = new_name
         new_blob = rejoin_thing(chunks, ".")
@@ -511,3 +511,4 @@ if __name__ == '__main__':
         else:
             print "Publishing ADT repo."
             publish_adt(REL_ID, REL_TYPE, "")
+
Signature · 1 line
2.4.3
#1 lore raw

PATCH 2/3 bin/release_scripts/release.py

The BSP packaging was missing the branch name from the repackaged tarball. The md5sums were also not being generated for the BSP tarballs. This patch fixes both these issues.

---
 bin/release_scripts/release.py | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)
bin/release_scripts/release.py +13 -10
index 8751a04..4c71e31 100755
@@ -200,21 +200,23 @@ def make_bsps(bsp_list, bsp_dir):
                 print "Creating %s bsp dir" %dirname
                 os.mkdir(dirname)
             target = os.path.join(dirname, POKY_TARBALL)
-            copyfile(poky_blob, target)
-            os.chdir(dirname)
-            print "Unpacking poky tarball."
-            os.system("tar jxf %s" %POKY_TARBALL)
             oldblob = POKY_TARBALL
             chunks = split_thing(oldblob, "-")
             chunks[0] = dirname
             new_blob = rejoin_thing(chunks, "-")
+            print "BSP tarball: %s" %new_blob
             new_dir = split_thing(blob_dir, "-")
             new_dir[0] = dirname
             new_dir = rejoin_thing(new_dir, "-")
             bin_dir = os.path.join(new_dir, "binary")
+            copyfile(poky_blob, target)
+            os.chdir(dirname)
+            print "Unpacking poky tarball."
+            os.system("tar jxf %s" %POKY_TARBALL)
             shutil.move(blob_dir, new_dir)
             os.remove(POKY_TARBALL)
-            os.mkdir(bin_dir)
+            if not os.path.exists(bin_dir):
+                os.mkdir(bin_dir)
             print "Getting binary files"
             os.system("rsync -arl %s/%s/ %s" %(MACHINES, dirname, bin_dir))
             bsp_bin = os.path.join(bsp_dir, dirname, bin_dir)
@@ -224,8 +226,10 @@ def make_bsps(bsp_list, bsp_dir):
             print "Creating BSP tarball"
             os.system("tar jcf %s %s" %(new_blob, new_dir))
             rmtree(new_dir)
-            print "Copying %s BSP tarball to machines dir" %new_blob
-            shutil.copy(new_blob, platform_dir)
+            print "Generating the md5sum."
+            os.system("md5sum %s > %s.md5sum" %(new_blob, new_blob))
+            print "Copying %s BSP to platform dir" %dirname
+            os.system("mv * %s" %platform_dir)
             os.chdir(bsp_dir)
         print
     os.chdir(RELEASE_DIR)
@@ -356,7 +360,7 @@ if __name__ == '__main__':
    
     VHOSTS = "/srv/www/vhosts"
     AB_BASE = os.path.join(VHOSTS, "autobuilder.yoctoproject.org/pub/releases")
-    DL_BASE = os.path.join(VHOSTS, "downloads.yoctoproject.org/releases")
+    DL_BASE = os.path.join(VHOSTS, "downloads.yoctoproject.org/releases/yocto")
     ADT_BASE = os.path.join(VHOSTS, "adtrepo.yoctoproject.org")
 
     # List of the directories we delete from all releases
@@ -453,7 +457,7 @@ if __name__ == '__main__':
     MACHINES = os.path.join(RELEASE_DIR, "machines")
     BSP_DIR = os.path.join(RELEASE_DIR, 'bsptarballs')
     TARBALL_DIR = os.path.join(RELEASE_DIR, "tarballs")
-    POKY_TARBALL = "poky-" + POKY_VER + ".tar.bz2"
+    POKY_TARBALL = "poky-" + BRANCH + "-" + POKY_VER + ".tar.bz2"
     ECLIPSE_DIR = os.path.join(RELEASE_DIR, "eclipse-plugin")
     BUILD_APP_DIR = os.path.join(RELEASE_DIR, "build-appliance")
     REL_MD5_FILE = RELEASE + ".md5sum"
@@ -511,4 +515,3 @@ if __name__ == '__main__':
         else:
             print "Publishing ADT repo."
             publish_adt(REL_ID, REL_TYPE, "")
-
Signature · 1 line
2.4.3
#2 lore raw

PATCH 3/3 bin/release_scripts/relnotes.sh

In reply to Graydon, Tracy

This is basically a capture of the command-line ickiness that we have been using to generate the basic release notes draft. It's frightfully ugly, but gets the job done for now.

---
 bin/release_scripts/relnotes.sh | 82 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)
 create mode 100755 bin/release_scripts/relnotes.sh
bin/release_scripts/relnotes.sh new file +82 -0
new file mode 100755
index 0000000..a88f0b8
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+# NOTE! This script will blissfully clobber any pre-existing poky repos, 
+# previous release notes with same filename, etc. 
+#
+# This is a quick and ugly script to generate the release notes draft.
+#
+# Usage: ./relnotes.sh <release_ID> <rc#> <branch> <poky-ver>
+# i.e. ./relnotes.sh yocto-2.0.1 rc6 jethro 14.0.1
+#
+# Currently the revision in the git log portion is hard coded. You 
+# will want to change accordingly! 
+# i.e. git log --pretty=format:"%s" yocto-2.0..HEAD |grep CVE >> $HOME/CVE;
+# Change the yocto-2.0 bit to whatever it needs to be for the given release.
+
+
+
+clear
+REL_ID=$1
+RC=$2
+BRANCH=$3
+POKY_VER=$4
+RELEASE=$REL_ID
+VHOSTS="/srv/www/vhosts"
+AB_BASE="$VHOSTS/autobuilder.yoctoproject.org/pub/releases"
+DL_BASE="$VHOSTS/downloads.yoctoproject.org/releases"
+RC_SOURCE="$AB_BASE/$RELEASE.$RC"
+RELEASE_DIR="$AB_BASE/$RELEASE"
+MACHINES="$RELEASE_DIR/machines"
+HOME=~/work/release
+echo "REL_ID: $REL_ID"
+echo "RC: $RC"
+echo "BRANCH: $BRANCH"
+echo "POKY_VER: $POKY_VER"
+echo "RELEASE: $RELEASE"
+echo "AB_BASE: $AB_BASE"
+echo "DL_BASE: $DL_BASE"
+echo "RC_SOURCE: $RC_SOURCE"
+echo "RELEASE_DIR: $RELEASE_DIR"
+echo "MACHINES: $MACHINES"
+echo
+
+if [[ -e $HOME/RELEASENOTES.$RELEASE ]]; then
+    rm -v $HOME/RELEASENOTES.$RELEASE
+fi
+if [[ -e $HOME/CVE ]]; then
+    rm -v $HOME/CVE
+fi
+if [[ -e $HOME/FIXES ]]; then
+    rm -v $HOME/FIXES
+fi
+if [[ -d $HOME/poky ]]; then
+    rm -rvf $HOME/poky
+fi
+
+for x in `ls $RELEASE_DIR/*.bz2.md5sum | grep -v "\-fsl" | grep -v "\-ppc"`; do 
+   layer=`basename $x | sed 's/\-'"$BRANCH"'\-'"$POKY_VER"'.tar.bz2.md5sum//g'`; 
+   tarball=`basename $x |sed 's/\.md5sum//g'`; 
+   ghash=`ls $RELEASE_DIR/$layer*.bz2 | grep -v $BRANCH | sed 's/'"$layer"'-//g' | sed 's/.tar.bz2//g'`;
+   ghash=`basename $ghash`
+   echo "Release Name: " $layer-$BRANCH-$POKY_VER; 
+   echo "Branch: $BRANCH"; 
+   echo "Tag: $BRANCH-$POKY_VER"; 
+   echo "Hash: " $ghash; 
+   echo "md5: `cat $RELEASE_DIR/$tarball.md5sum`"; 
+   echo "Download Locations:"; 
+   echo "http://downloads.yoctoproject.org/releases/yocto/$RELEASE/$tarball"; 
+   echo "http://mirrors.kernel.org/yocto/yocto/$RELEASE/$tarball"; echo ""; 
+done >> $HOME/RELEASENOTES.$RELEASE
+
+git clone git://git.yoctoproject.org/poky;
+cd poky; 
+git checkout $BRANCH; 
+echo -e "\n-------\nSecurity Fixes\n-------" >> $HOME/CVE;
+git log --pretty=format:"%s" yocto-2.0..HEAD |grep CVE >> $HOME/CVE; 
+echo -e "\n-------\nFixes\n-------" >> $HOME/FIXES; 
+git log --pretty=format:"%s" yocto-2.0..HEAD |grep -v CVE >> $HOME/FIXES; 
+cat $HOME/CVE >> $HOME/RELEASENOTES.$RELEASE; cat $HOME/FIXES >> $HOME/RELEASENOTES.$RELEASE
+cd $HOME
+
+
+
Signature · 1 line
2.4.3