Patchwork [2,of,2] contrib: buildrpm checking of md5 checksums of downloaded Python and Docutils

login
register
mail settings
Submitter Mads Kiilerich
Date Oct. 18, 2014, 12:26 p.m.
Message ID <6648b298af260a79c580.1413635216@localhost.localdomain>
Download mbox | patch
Permalink /patch/6405/
State Superseded
Commit a440166d03fc06e3dc18500e0813973e31c4022b
Headers show

Comments

Mads Kiilerich - Oct. 18, 2014, 12:26 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1413635201 -7200
#      Sat Oct 18 14:26:41 2014 +0200
# Node ID 6648b298af260a79c58045cdabdcee04d2126907
# Parent  9a47c47b49c08cc0360a7995996780e20e9c241b
contrib: buildrpm checking of md5 checksums of downloaded Python and Docutils
Pierre-Yves David - Oct. 18, 2014, 9:52 p.m.
On 10/18/2014 05:26 AM, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1413635201 -7200
> #      Sat Oct 18 14:26:41 2014 +0200
> # Node ID 6648b298af260a79c58045cdabdcee04d2126907
> # Parent  9a47c47b49c08cc0360a7995996780e20e9c241b
> contrib: buildrpm checking of md5 checksums of downloaded Python and Docutils

Those two looks reasonable to me and I would queue them if I were a bit 
ore familiar with testing them.

Patch

diff --git a/contrib/buildrpm b/contrib/buildrpm
--- a/contrib/buildrpm
+++ b/contrib/buildrpm
@@ -18,6 +18,7 @@  while [ "$1" ]; do
     --withpython | --with-python)
         shift
         PYTHONVER=2.7.8
+        PYTHONMD5=d4bca0159acb0b44a781292b5231936f
         ;;
     --rpmbuilddir )
         shift
@@ -76,11 +77,18 @@  if [ "$PYTHONVER" ]; then
     cd build
     PYTHON_SRCFILE=Python-$PYTHONVER.tgz
     [ -f $PYTHON_SRCFILE ] || curl -Lo $PYTHON_SRCFILE http://www.python.org/ftp/python/$PYTHONVER/$PYTHON_SRCFILE
+    if [ "$PYTHONMD5" ]; then
+        echo "$PYTHONMD5 $PYTHON_SRCFILE" | md5sum -w -c
+    fi
     ln -f $PYTHON_SRCFILE $RPMBUILDDIR/SOURCES/$PYTHON_SRCFILE
 
     DOCUTILSVER=`sed -ne "s/^%global docutilsname docutils-//p" $specfile`
     DOCUTILS_SRCFILE=docutils-$DOCUTILSVER.tar.gz
     [ -f $DOCUTILS_SRCFILE ] || curl -Lo $DOCUTILS_SRCFILE http://downloads.sourceforge.net/project/docutils/docutils/$DOCUTILSVER/$DOCUTILS_SRCFILE
+    DOCUTILSMD5=`sed -ne "s/^%global docutilsmd5 //p" $specfile`
+    if [ "$DOCUTILSMD5" ]; then
+        echo "$DOCUTILSMD5 $DOCUTILS_SRCFILE" | md5sum -w -c
+    fi
     ln -f $DOCUTILS_SRCFILE $RPMBUILDDIR/SOURCES/$DOCUTILS_SRCFILE
 )
 fi
diff --git a/contrib/mercurial.spec b/contrib/mercurial.spec
--- a/contrib/mercurial.spec
+++ b/contrib/mercurial.spec
@@ -7,6 +7,7 @@ 
 %global pythonver %{withpython}
 %global pythonname Python-%{withpython}
 %global docutilsname docutils-0.12
+%global docutilsmd5 4622263b62c5c771c03502afa3157768
 %global pythonhg python-hg
 %global hgpyprefix /usr/%{pythonhg}
 # byte compilation will fail on some some Python /test/ files