diff mbox

[cbuild2,4/4] Remove ${dir} specific md5sums files.

Message ID 1381423216-21180-5-git-send-email-ryan.arnold@linaro.org
State New
Headers show

Commit Message

Ryan S. Arnold Oct. 10, 2013, 4:40 p.m. UTC
From: "Ryan S. Arnold" <ryan.arnold@linaro.org>

The ${dir}/ specific md5sums files are redundant with the
snapshots/md5sums file and should be removed.  This includes the
testcode/md5sums files.
---
 lib/common.sh   |  2 +-
 lib/fetch.sh    | 14 +++++++-------
 lib/testcode.sh | 12 ++++--------
 3 files changed, 12 insertions(+), 16 deletions(-)

Comments

Rob Savoye Oct. 10, 2013, 5:57 p.m. UTC | #1
On 10/10/2013 10:40 AM, Ryan S. Arnold wrote:
> From: "Ryan S. Arnold" <ryan.arnold@linaro.org>
>
> The ${dir}/ specific md5sums files are redundant with the
> snapshots/md5sums file and should be removed.  This includes the
> testcode/md5sums files.
  All 5 patches have been merged from the md5sums-v2 branch, and
committed to master and pushed.

    - rob -
diff mbox

Patch

diff --git a/lib/common.sh b/lib/common.sh
index ae2bd6b..01d35dc 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -322,7 +322,7 @@  find_snapshot()
     #fetch_rsync ${remote_snapshots}/md5sums
 
     # Search for the snapshot in the md5sum file, and filter out anything we don't want.
-    snapshot="`grep $1 ${local_snapshots}/${dir}md5sums | egrep -v "\.asc|\.diff|\.txt|xdelta" | cut -d ' ' -f 3`"
+    snapshot="`grep $1 ${local_snapshots}/md5sums | egrep -v "\.asc|\.diff|\.txt|xdelta" | cut -d ' ' -f 3`"
     if test x"${snapshot}" != x; then
 	if test `echo "${snapshot}" | grep -c $1` -gt 1; then
 	    error "Too many results for $1!"
diff --git a/lib/fetch.sh b/lib/fetch.sh
index 70dcd64..d2e5d72 100755
--- a/lib/fetch.sh
+++ b/lib/fetch.sh
@@ -33,12 +33,12 @@  fetch()
     if test x"$1" = x"md5sums"; then
 	# Move the existing file to force a fresh copy to be downloaded.
 	# Otherwise this file can get stale, and new tarballs not found.
-	if test -f ${local_snapshots}/${dir}md5sums; then
-	    cp -f ${local_snapshots}/${dir}md5sums ${local_snapshots}/${dir}md5sums.bak
+	if test -f ${local_snapshots}/md5sums; then
+	    cp -f ${local_snapshots}/md5sums ${local_snapshots}/md5sums.bak
 	fi
-	fetch_http ${dir}md5sums
-	if test ! -s ${dir}md5sums; then
-	    cp -f ${local_snapshots}/${dir}md5sums.bak ${local_snapshots}/${dir}md5sums
+	fetch_http md5sums
+	if test ! -s md5sums; then
+	    cp -f ${local_snapshots}/md5sums.bak ${local_snapshots}/md5sums
 	fi
 	return $?
     fi
@@ -175,7 +175,7 @@  check_md5sum()
     local getfile=`echo ${1}`
 
     newsum="`md5sum ${local_snapshots}/$1 | cut -d ' ' -f 1`"
-    oldsum="`grep ${getfile} ${local_snapshots}/${dir}md5sums | cut -d ' ' -f 1`"
+    oldsum="`grep ${getfile} ${local_snapshots}/md5sums | cut -d ' ' -f 1`"
     # if there isn't an entry in the md5sum file, we're probably downloading
     # something else that's less critical.
     if test x"${oldsum}" = x; then
@@ -215,7 +215,7 @@  extract()
     fi
 
     if test `echo $1 | egrep -c "\.gz|\.bz2|\.xz"` -eq 0; then	
-	local file="`grep $1 ${local_snapshots}/${dir}md5sums | egrep -v  "\.asc|\.txt" | cut -d ' ' -f 3 | cut -d '/' -f 2`"
+	local file="`grep $1 ${local_snapshots}/md5sums | egrep -v  "\.asc|\.txt" | cut -d ' ' -f 3 | cut -d '/' -f 2`"
     else
 	local file="`echo $1 | cut -d '/' -f 2`"
     fi
diff --git a/lib/testcode.sh b/lib/testcode.sh
index 1605f01..3d56b90 100644
--- a/lib/testcode.sh
+++ b/lib/testcode.sh
@@ -4,19 +4,15 @@ 
 
 testcode()
 {
-    # force downloading the md5sum file, as it changes frequently
-    rm -f ${local_snapshots}/testcode/md5sums
-    fetch_http testcode/md5sums
-
     rm -f ${local_snapshots}/testcode/ChangeLog
     fetch_http testcode/ChangeLog
 
-    if test -f ${local_snapshots}/testcode/md5sums; then
-     	files="`cat ${local_snapshots}/testcode/md5sums | cut -d ' ' -f3`"
+    if test -f ${local_snapshots}/md5sums; then
+     	files="`grep testcode ${local_snapshots}/md5sums | cut -d ' ' -f3`"
      	for i in ${files}; do
-     	    build testcode/$i
+     	    build $i
 	    if test $? -gt 0; then
-		error "Couldn't build testcode/$i!"
+		error "Couldn't build $i!"
 		return 1
 	    fi
      	done