You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by na...@apache.org on 2015/08/03 17:51:28 UTC

svn commit: r10058 - /dev/jclouds/compare_tarball_tag.sh

Author: nacx
Date: Mon Aug  3 15:51:28 2015
New Revision: 10058

Log:
Added a script to compare a release targball with the tag

The script compares the contents of the expanded tarballs with
the corresponding tag in the Git repository. It uses Git to perform
the comparison without having to diff each file separately.


Added:
    dev/jclouds/compare_tarball_tag.sh   (with props)

Added: dev/jclouds/compare_tarball_tag.sh
==============================================================================
--- dev/jclouds/compare_tarball_tag.sh (added)
+++ dev/jclouds/compare_tarball_tag.sh Mon Aug  3 15:51:28 2015
@@ -0,0 +1,69 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+function usage {
+    echo "Usage: ${0} <release candidate path>"
+    exit 1
+}
+
+[[ $# -ge 1 ]] || usage
+
+set -ue
+
+RC_PATH=${1}
+RC=$(basename ${RC_PATH})
+VERSION=${RC%-rc[0-9]*}
+DIR=$(PWD)
+
+for TARBALL in ${RC_PATH}/*.tar.gz; do
+    FILE=$(basename ${TARBALL})
+    REPO=${FILE%%-[0-9]*}
+    FOLDER=${REPO}-${VERSION}
+    TAG=${REPO}-${RC}
+
+    echo "Comparing ${FILE} to tag ${TAG}..."
+    
+    rm -rf /tmp/${RC}
+    mkdir -p /tmp/${RC}
+    cd ${DIR}
+    tar -C /tmp/${RC} -xzf ${TARBALL}
+
+    # Initialize a Git repo for the expanded tarball and commit
+    # its contents. We will use Git to compare the tarball with the tag
+    cd /tmp/${RC}/${FOLDER}
+    git init -q
+    git add .
+    git commit -q -m "Base commit to compare"
+
+    # Clone the repo and checkout the tag to be compared with the tarball
+    cd /tmp/${RC}
+    git clone -q https://git-wip-us.apache.org/repos/asf/${REPO}.git
+    cd ${REPO}
+    git fetch origin --tags
+    git checkout -q ${TAG}
+
+    # Replace the .git directory of the tarball with the one from the Git
+    # repo. This should make the trick to allow us to use a 'git status' to
+    # see the differences
+    rm -rf /tmp/${RC}/${FOLDER}/.git
+    mv .git /tmp/${RC}/${FOLDER}/
+    cd /tmp/${RC}/${FOLDER}
+
+    git status --short
+done

Propchange: dev/jclouds/compare_tarball_tag.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: dev/jclouds/compare_tarball_tag.sh
------------------------------------------------------------------------------
    svn:executable = *