changeset 2727:1e1166e396a0

Update tarball scripts and .hgignore 2014-06-12 Andrew John Hughes <gnu.andrew@member.fsf.org> * .hgignore: Add compile script added by recent version of Automake. * scripts/create_tarballs.sh: New script to create tarballs using Mercurial, as used for the drops created for the previous bump. * scripts/gen_changeset_and_sha256sums.sh: Updated to latest local version, with support for tarballs created by create_tarballs.sh. * scripts/update_tarballs.sh: Updated to latest local version with support for OpenJDK 8.
author Andrew John Hughes <gnu_andrew@member.fsf.org>
date Fri, 13 Jun 2014 01:46:35 +0100
parents 012d523c56c9
children 2311a87279e8
files .hgignore ChangeLog scripts/create_tarballs.sh scripts/gen_changeset_and_sha256sums.sh scripts/update_tarballs.sh
diffstat 5 files changed, 249 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Fri Jun 13 01:30:38 2014 +0100
+++ b/.hgignore	Fri Jun 13 01:46:35 2014 +0100
@@ -10,4 +10,4 @@
 config.status
 install-sh
 Makefile.in
-
+compile
--- a/ChangeLog	Fri Jun 13 01:30:38 2014 +0100
+++ b/ChangeLog	Fri Jun 13 01:46:35 2014 +0100
@@ -1,3 +1,17 @@
+2014-06-12  Andrew John Hughes  <gnu.andrew@member.fsf.org>
+
+	* .hgignore: Add compile script added by
+	recent version of Automake.
+	* scripts/create_tarballs.sh: New script
+	to create tarballs using Mercurial, as used
+	for the drops created for the previous bump.
+	* scripts/gen_changeset_and_sha256sums.sh:
+	Updated to latest local version, with support
+	for tarballs created by create_tarballs.sh.
+	* scripts/update_tarballs.sh:
+	Updated to latest local version with support
+	for OpenJDK 8.
+
 2014-06-12  Andrew John Hughes  <gnu.andrew@member.fsf.org>
 
 	* AUTHORS:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/create_tarballs.sh	Fri Jun 13 01:46:35 2014 +0100
@@ -0,0 +1,93 @@
+#!/bin/bash
+
+# Copyright (C) 2014 Red Hat, Inc.
+# Written by Andrew John Hughes <gnu.andrew@redhat.com>.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+CHECKOUT_DIR=$1
+DOWNLOAD_DIR=$2
+TAG=$3
+RUNNING_DIR=$(dirname $0)
+CTYPE=bz2
+echo "PWD: $PWD"
+echo "COMPRESSION TYPE: ${CTYPE}"
+
+if [ $(echo $0|grep '8$') ]; then
+    echo "Assuming OpenJDK 8 and later";
+    OPENJDK8=true;
+    NASHORN=nashorn;
+else
+    echo "Assuming OpenJDK 7 and earlier";
+    OPENJDK8=false;
+fi
+
+if test "x$CHECKOUT_DIR" = "x"; then
+    echo "ERROR: Checkout directory must be specified";
+    echo "$0 <CHECKOUT_DIR> <DOWNLOAD_DIR> <TAG>"
+    exit -1;
+fi
+
+if test "x$DOWNLOAD_DIR" = "x"; then
+    if test "x$OPENJDK8" = "xfalse"; then
+      DOWNLOAD_DIR=/home/downloads/java/drops/icedtea7 ;
+    else
+      DOWNLOAD_DIR=/home/downloads/java/drops/icedtea8 ;
+    fi
+fi
+
+if test "x$TAG" = "x"; then
+    TAG=tip ;
+elif echo ${TAG}|grep '^icedtea' ; then
+    if test "x$CHECKOUT_DIR" = "x"; then
+	echo "No checkout directory found.";
+	exit -1;
+    fi
+fi
+
+echo "TAG = $TAG";
+echo "Creating new tarballs in $DOWNLOAD_DIR"
+echo "Using checkout directory $CHECKOUT_DIR"
+URL=$(hg -R ${CHECKOUT_DIR} paths default)
+PREFIX=$(echo ${URL}|sed -r 's#.*/([^/]*)$#\1#'|sed 's#\.#-#')
+echo "Upstream URL is ${URL}"
+echo "Prefix for root tree is ${PREFIX}"
+pushd $DOWNLOAD_DIR
+for repos in . corba jaxp jaxws langtools hotspot jdk $NASHORN;
+do
+    if test "x$repos" = "x."; then
+	FILENAME=openjdk;
+	REPONAME=${PREFIX};
+    else
+	FILENAME=${repos};
+	REPONAME=${repos};
+    fi
+    if echo ${TAG} | egrep '^(icedtea|jdk|tip)' > /dev/null ; then
+	CHANGESET=$(hg log -r ${TAG} -R ${CHECKOUT_DIR}/$repos | head -n1| awk -F ':' '{print $3}')
+    else
+	CHANGESET=${TAG}
+    fi
+    echo "Creating ${FILENAME}.tar.${CTYPE} containing ${REPONAME}-${CHANGESET} from tag ${TAG} in ${CHECKOUT_DIR}/${repos}"
+    hg archive -R ${CHECKOUT_DIR}/$repos -t t${CTYPE} -r ${TAG} -p ${REPONAME}-${CHANGESET} ${FILENAME}.tar.${CTYPE}
+done
+echo Removing outdated symlinks
+find $DOWNLOAD_DIR -maxdepth 1 -type l -exec rm -vf '{}' ';'
+popd
+echo Generating new changeset IDs and SHA256 sums
+echo URL = ${URL}
+if test "x$OPENJDK8" = "xfalse"; then
+  $RUNNING_DIR/gen_changeset_and_sha256sums.sh bz2 $DOWNLOAD_DIR ${URL}
+else
+  $RUNNING_DIR/gen_changeset_and_sha256sums_8.sh bz2 $DOWNLOAD_DIR ${URL}
+fi
--- a/scripts/gen_changeset_and_sha256sums.sh	Fri Jun 13 01:30:38 2014 +0100
+++ b/scripts/gen_changeset_and_sha256sums.sh	Fri Jun 13 01:46:35 2014 +0100
@@ -1,19 +1,79 @@
 #!/bin/bash
 
-DOWNLOAD_DIR=$1
+# Copyright (C) 2014 Red Hat, Inc.
+# Written by Andrew John Hughes <gnu.andrew@redhat.com>.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+COMPRESSION_TYPE=$1
+DOWNLOAD_DIR=$2
+ROOT_URL=$3
+
+if [ $(echo $0|grep '_8') ]; then
+    echo "Assuming OpenJDK 8 and later";
+    OPENJDK8=true;
+    NASHORN=nashorn;
+else
+    echo "Assuming OpenJDK 7 and earlier";
+    OPENJDK8=false;
+fi
+
+if test "x$COMPRESSION_TYPE" = "x"; then
+    echo "ERROR: Compression type must be specified.";
+    echo "$0 <COMPRESSION_TYPE> <DOWNLOAD_DIR> <ROOT_URL>"
+    exit -1;
+fi
 
 if test "x$DOWNLOAD_DIR" = "x"; then
-    DOWNLOAD_DIR=/home/downloads/java/icedtea ;
+    if test "x$OPENJDK8" = "xfalse"; then
+      DOWNLOAD_DIR=/home/downloads/java/drops/icedtea7 ;
+    else
+      DOWNLOAD_DIR=/home/downloads/java/drops/icedtea8 ;
+    fi
+fi
+
+if test "x$URL" = "x"; then
+    if test "x$OPENJDK8" = "xfalse"; then
+      URL=http://icedtea.classpath.org/hg/icedtea7-forest ;
+    else
+      URL=http://icedtea.classpath.org/hg/icedtea8-forest ;
+    fi
 fi
 
 rm -f /tmp/changesets /tmp/sums
-for repos in corba hotspot jaxp jaxws jdk langtools openjdk
+for repos in corba jaxp jaxws jdk langtools openjdk $NASHORN
 do
-    echo Generating changeset and checksum for $repos using $DOWNLOAD_DIR/$repos.tar.gz
-    file=$DOWNLOAD_DIR/$repos.tar.gz
-    id=$(echo $repos|tr '[a-z]' '[A-Z]')
-    sha256sum=$(sha256sum $file|awk '{print $1}')
-    changeset=$(tar tzf $file|head -n1|sed -r "s#[a-z0-9-]*-([0-9a-z]*)/.*#\1#")
-    echo "${id}_CHANGESET = $changeset" >> /tmp/changesets
-    echo "${id}_SHA256SUM = $sha256sum" >> /tmp/sums
+    file=$DOWNLOAD_DIR/$repos.tar.${COMPRESSION_TYPE}
+    echo Generating changeset and checksum for $repos using ${file}
+    if [ -e $file ] ; then
+      id=$(echo $repos|tr '[a-z]' '[A-Z]')
+      sha256sum=$(sha256sum $file|awk '{print $1}')
+      changeset=$(tar tf $file|head -n1|sed -r "s#[a-z0-9-]*-([0-9a-z]*)/.*#\1#")
+      name=$(echo ${DOWNLOAD_DIR}|sed -r 's#.*(icedtea.*)#\1#'|sed 's#7/#-#')
+      ln -sf ${file} ${DOWNLOAD_DIR}/${name}-${repos}-${changeset}.tar.${COMPRESSION_TYPE}
+      echo "${id}_CHANGESET = $changeset" >> /tmp/changesets
+      echo "${id}_SHA256SUM = $sha256sum" >> /tmp/sums
+    fi
 done
+
+file=${DOWNLOAD_DIR}/hotspot.tar.${COMPRESSION_TYPE}
+echo Generating changeset and checksum for hotspot using ${file}
+if [ -e ${file} ] ; then
+  sha256sum=$(sha256sum $file|awk '{print $1}')
+  name=$(echo ${DOWNLOAD_DIR}|sed -r 's#.*(icedtea.*)#\1#'|sed 's#7/#-#')
+  changeset=$(tar tf $file|head -n1|sed -r "s#[a-z0-9-]*-([0-9a-z]*)/.*#\1#")
+  ln -sf ${file} ${DOWNLOAD_DIR}/${name}-hotspot-$changeset.tar.${COMPRESSION_TYPE}
+  echo "default ${ROOT_URL}/hotspot ${changeset} ${sha256sum}" > /tmp/hotspot.map
+fi
+    
--- a/scripts/update_tarballs.sh	Fri Jun 13 01:30:38 2014 +0100
+++ b/scripts/update_tarballs.sh	Fri Jun 13 01:46:35 2014 +0100
@@ -1,20 +1,85 @@
 #!/bin/bash
 
+# Copyright (C) 2014 Red Hat, Inc.
+# Written by Andrew John Hughes <gnu.andrew@redhat.com>.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
 DOWNLOAD_DIR=$1
+URL=$2
+TAG=$3
+CHECKOUT_DIR=$4
 RUNNING_DIR=$(dirname $0)
 echo $PWD
 
+if [ $(echo $0|grep '8$') ]; then
+    echo "Assuming OpenJDK 8 and later";
+    OPENJDK8=true;
+    NASHORN=nashorn;
+else
+    echo "Assuming OpenJDK 7 and earlier";
+    OPENJDK8=false;
+fi
+
 if test "x$DOWNLOAD_DIR" = "x"; then
-    DOWNLOAD_DIR=/home/downloads/java/icedtea ;
+    if test "x$OPENJDK8" = "xfalse"; then
+      DOWNLOAD_DIR=/home/downloads/java/drops/icedtea7 ;
+    else
+      DOWNLOAD_DIR=/home/downloads/java/drops/icedtea8 ;
+    fi
 fi
 
+if test "x$URL" = "x"; then
+    if test "x$OPENJDK8" = "xfalse"; then
+      URL=http://icedtea.classpath.org/hg/icedtea7-forest ;
+    else
+      URL=http://icedtea.classpath.org/hg/icedtea8-forest ;
+    fi
+fi
+
+if test "x$TAG" = "x"; then
+    TAG=tip ;
+elif echo ${TAG}|grep '^icedtea' ; then
+    if test "x$CHECKOUT_DIR" = "x"; then
+	echo "No checkout directory found.";
+	exit -1;
+    fi
+fi
+
+echo "URL = $URL, TAG = $TAG";
 echo Downloading new tarballs to $DOWNLOAD_DIR
 pushd $DOWNLOAD_DIR
-for repos in corba jaxp jaxws langtools hotspot jdk;
+for repos in . corba jaxp jaxws langtools hotspot jdk $NASHORN;
 do
-	wget -O $repos.tar.gz http://icedtea.classpath.org/hg/icedtea7-forest/$repos/archive/tip.tar.gz
+    if test "x$repos" = "x."; then
+	FILENAME=openjdk;
+    else
+	FILENAME=$repos;
+    fi
+    if echo ${TAG} | egrep '^(icedtea|jdk)' > /dev/null ; then
+	CHANGESET=$(hg log -r ${TAG} -R ${CHECKOUT_DIR}/$repos | head -n1| awk -F ':' '{print $3}')
+    else
+	CHANGESET=${TAG}
+    fi
+    wget -O ${FILENAME}.tar.gz ${URL}/$repos/archive/${CHANGESET}.tar.gz
 done
-wget -O openjdk.tar.gz http://icedtea.classpath.org/hg/icedtea7-forest/archive/tip.tar.gz
+echo Removing outdated symlinks
+find $DOWNLOAD_DIR -maxdepth 1 -type l -exec rm -vf '{}' ';'
+popd
 echo Generating new changeset IDs and SHA256 sums
-popd
-$RUNNING_DIR/gen_changeset_and_sha256sums.sh $DOWNLOAD_DIR
+if test "x$OPENJDK8" = "xfalse"; then
+  $RUNNING_DIR/gen_changeset_and_sha256sums.sh gz $DOWNLOAD_DIR ${URL}
+else
+  $RUNNING_DIR/gen_changeset_and_sha256sums_8.sh gz $DOWNLOAD_DIR ${URL}
+fi