[Blends-commit] [SCM] website branch, master, updated. 37af0793def2c46dcc351ab4a58386ccfc858169

Andreas Tille tille at debian.org
Sun Sep 13 12:29:16 UTC 2015


The following commit has been merged in the master branch:
commit 26647b85133f97c0e62e2b60c0014ded28f59fec
Author: Andreas Tille <tille at debian.org>
Date:   Mon Sep 7 16:11:25 2015 +0200

    Fetch all README.Debian files (also when prefixed by package name)

diff --git a/misc/machine_readable/fetch-machine-readable b/misc/machine_readable/fetch-machine-readable
index 53c608d..496ec70 100755
--- a/misc/machine_readable/fetch-machine-readable
+++ b/misc/machine_readable/fetch-machine-readable
@@ -43,13 +43,29 @@ GITDIRS="debian-astro/packages
          tryton
          demudi"
 
+svn_get_README_Debian () {
+set -x
+              for rdfile in $getfile ; do
+                svn export svn://localhost/svn/$1/$rdfile >/dev/null 2>/dev/null
+                file=`basename $rdfile`
+                if [ "$file" = "README.Debian" ] ; then
+                  mv $file $TARGETDIR/$firstletter/${srcname}.README.Debian
+                else
+                  rdfirstletter=`echo $file | sed "s/^\(.\).*/\1/"`
+                  mv $file $TARGETDIR/$rdfirstletter/${file}
+                fi
+                echo "README.Debian: $file" >> $TARGETDIR/$firstletter/${srcname}.vcs
+              done
+set +x
+}
+
 svn_checkout_machine_readable () {
   curdir=`pwd`
   cd $TARGETDIR
   TMPLIST=`mktemp`
   svn list --verbose svn://localhost/svn/$1 --recursive | \
     grep -v -e '/tags/' -e '/branches/' -e '/patches/' | \
-    grep -e "/control$" -e "/changelog$" -e "/copyright$" -e "/upstream$" -e "/upstream/metadata$" -e "/README.Debian$" | \
+    grep -e "/control$" -e "/changelog$" -e "/copyright$" -e "/upstream$" -e "/upstream/metadata$" -e "README.Debian$" | \
     grep -v "tests/control" | \
     sed 's/^.*[[:space:]]\([^[:space:]]\+\)/\1/' \
     > $TMPLIST
@@ -70,7 +86,7 @@ svn_checkout_machine_readable () {
 #  set -x
   for pkgdir in `cat $PKGLIST` ; do
     pkg=`echo $pkgdir | sed -e 's?^.*/\([^/]\+\)?\1?'`
-    chlog=`grep  -e "/$pkg/[^/]\+/debian/changelog$" -e "^$pkg/trunk/debian/changelog$" -e "^$pkg/debian/changelog$" -e "/$pkg/debian/changelog$" -e "/$pkg/debian/README.Debian$" -e "^[a-z]\+/$pkg/[a-z]\+/trunk/debian/changelog$" $TMPLIST | sort | tail -n 1 2>/dev/null`
+    chlog=`grep  -e "/$pkg/[^/]\+/debian/changelog$" -e "^$pkg/trunk/debian/changelog$" -e "^$pkg/debian/changelog$" -e "/$pkg/debian/changelog$" -e "/$pkg/debian/.*README.Debian$" -e "^[a-z]\+/$pkg/[a-z]\+/trunk/debian/changelog$" $TMPLIST | sort | tail -n 1 2>/dev/null`
     if [ "" != "$chlog" ] ; then
       svn export svn://localhost/svn/$1/$chlog >/dev/null
       srcname=`dpkg-parsechangelog -lchangelog 2>/dev/null | sed -n 's/^Source: //p'`
@@ -89,8 +105,14 @@ svn_checkout_machine_readable () {
           for file in control copyright upstream upstream/metadata README.Debian; do
             srcfile=${file#upstream/}
             destfile=${file%/metadata}
-            getfile=`grep -e "/$pkg/trunk/debian/$file$" -e "^$pkg/trunk/debian/$file$" -e "^$pkg/debian/$file$" -e "trunk/$pkg/debian/$file$" -e "/$pkg/[a-z]\+/trunk/debian/$file$" $TMPLIST 2>/dev/null` || true
-            if [ `echo "$getfile" | wc -l` -gt 1 ] ; then
+            if [ "$file" = "README.Debian" ] ; then
+              # It is possible to have more than one debian/*.README.Debian
+              getfile=`grep -e "/$pkg/trunk/debian/.*$file$" -e "^$pkg/trunk/debian/.*$file$" -e "^$pkg/debian/.*$file$" -e "trunk/$pkg/debian/.*$file$" -e "/$pkg/[a-z]\+/trunk/debian/.*$file$" $TMPLIST 2>/dev/null` || true
+              svn_get_README_Debian $1
+              getfile="" # do not try to fetch file again
+            else
+              getfile=`grep -e "/$pkg/trunk/debian/$file$" -e "^$pkg/trunk/debian/$file$" -e "^$pkg/debian/$file$" -e "trunk/$pkg/debian/$file$" -e "/$pkg/[a-z]\+/trunk/debian/$file$" $TMPLIST 2>/dev/null` || true
+              if [ `echo "$getfile" | wc -l` -gt 1 ] ; then
                 # try whether the package name really matches (no idea why the above partly fails
                 getfile=`echo $getfile | grep -w "$pkg"`
                 if [ `echo "$getfile" | wc -l` -gt 1 ] ; then
@@ -100,14 +122,12 @@ svn_checkout_machine_readable () {
                 else
                     echo "??? for package $getfile there was a competing name ???" >> $ERRLOG
                 fi
+              fi
             fi
             if [ "" != "$getfile" ] ; then
               svn export svn://localhost/svn/$1/$getfile >/dev/null 2>/dev/null
               if [ -e $srcfile ] ; then
                 mv $srcfile $TARGETDIR/$firstletter/${srcname}.$destfile
-                if [ "$file" = "README.Debian" ] ; then
-                  echo "Has_README.Debian: yes" >> $TARGETDIR/$firstletter/${srcname}.vcs
-                fi
               else
                 echo "ERR 1: Can not obtain file ${file} of source ${srcname} of team $1 from ${getfile}" >> $ERRLOG
               fi
@@ -115,19 +135,21 @@ svn_checkout_machine_readable () {
               if ! `echo $vcslocation | grep -q trunk` ; then
                 if [ "$destfile" != "upstream" ] ; then
                   echo "Package $pkg is lacking trunk directory in vcslocation ${vcslocation}. Try to find file $file anyway." >> $ERRLOG
-                  getfile=`grep -e "$vcslocation/debian/$file$" $TMPLIST 2>/dev/null` || true
-                  if [ "" != "$getfile" ] ; then
-                    svn export svn://localhost/svn/$1/$getfile >/dev/null 2>/dev/null
-                    if [ -e $srcfile ] ; then
-                      mv $srcfile $TARGETDIR/$firstletter/${srcname}.$destfile
-                      if [ "$file" = "README.Debian" ] ; then
-                        echo "Has_README.Debian: yes" >> $TARGETDIR/$firstletter/${srcname}.vcs
+                  if [ "$file" = "README.Debian" ] ; then
+                    getfile=`grep -e "$vcslocation/debian/.*$file$" $TMPLIST 2>/dev/null` || true
+                    svn_get_README_Debian $1
+                  else
+                    getfile=`grep -e "$vcslocation/debian/$file$" $TMPLIST 2>/dev/null` || true
+                    if [ "" != "$getfile" ] ; then
+                      svn export svn://localhost/svn/$1/$getfile >/dev/null 2>/dev/null
+                      if [ -e $srcfile ] ; then
+                        mv $srcfile $TARGETDIR/$firstletter/${srcname}.$destfile
+                      else
+                        echo "ERR 2: Can not obtain file ${file} of source ${srcname} of team $1 from ${getfile}" >> $ERRLOG
                       fi
                     else
-                      echo "ERR 2: Can not obtain file ${file} of source ${srcname} of team $1 from ${getfile}" >> $ERRLOG
+                      echo "Did not found $file for package $pkg (`grep "$pkg" $TMPLIST | grep "$file"`)" >> $ERRLOG
                     fi
-                  else
-                    echo "Did not found $file for package $pkg (`grep "$pkg" $TMPLIST | grep "$file"`)" >> $ERRLOG
                   fi
                 fi
               fi
@@ -161,16 +183,27 @@ git_checkout_machine_readable () {
     echo "Vcs-Browser: https://anonscm.debian.org"`echo $1 | sed 's+^/git/+/cgit/+'` >> $TARGETDIR/$firstletter/${srcname}.vcs
     echo "Blend: `echo $2 | sed 's?/.*??'`" >> $TARGETDIR/$firstletter/${srcname}.vcs
     for file in `git ls-tree -r HEAD debian/ 2>/dev/null | \
-                 grep -e "debian/control$" -e "debian/changelog$" -e "debian/copyright$" -e "debian/upstream$" -e "debian/upstream/metadata$" -e "debian/README.Debian$" | \
+                 grep -e "debian/control$" -e "debian/changelog$" -e "debian/copyright$" -e "debian/upstream$" -e "debian/upstream/metadata$" -e "debian/.*README.Debian$" | \
                  sed 's/^[0-9]\+[[:space:]]\+blob[[:space:]]\+[0-9a-f]\+[[:space:]]\+//'` ; do
                  ## grep -v -e "debian/tests" -e "/usr/share/doc" -e "DEBIAN" -e "debian/components" -e "jquery" -e "debian/templates" | \
       # for very strange reasons in two cases (pkg-games/pentobi.git and pkg-octave/octave.git) the line above contains strings not starting with ^debian ... enforcing this
       if echo $file | grep -q ^debian ; then
         destfile=${file%/metadata}
         target=$TARGETDIR/$firstletter/${srcname}.`echo $destfile | sed 's?debian/??'`
-        git show HEAD:$file > $target
-        if [ "$file" = "debian/README.Debian" ] ; then
-          echo "Has_README.Debian: yes" >> $TARGETDIR/$firstletter/${srcname}.vcs
+        if echo $file | grep -q README.Debian ; then
+set -x
+          if [ "$file" = "debian/README.Debian" ] ; then
+            git show HEAD:$file > $target
+            echo "README.Debian: `basename $file`" >> $TARGETDIR/$firstletter/${srcname}.vcs
+          else
+            rdfile=`basename $file`
+            rdfirstletter=`echo $rdfile | sed "s/^\(.\).*/\1/"`
+            git show HEAD:$file > $TARGETDIR/$rdfirstletter/${rdfile}
+            echo "README.Debian: $rdfile" >> $TARGETDIR/$firstletter/${srcname}.vcs
+          fi
+set +x
+        else
+          git show HEAD:$file > $target
         fi
       fi
     done
@@ -207,7 +240,7 @@ fi
 rm -f $MACHINEREADABLEARCHIVE
 cd $TARGETDIR
 cd ..
-tar --exclude=README.Debian -cjf $MACHINEREADABLEARCHIVE $TDNAME
+tar --exclude=*README.Debian -cjf $MACHINEREADABLEARCHIVE $TDNAME
 tar --exclude=*.control --exclude=*.changelog --exclude=*.upstream --exclude=*.vcs --exclude=*.copyright -cjf $READMEDEBIANARCHIVE $TDNAME
 
 # Check for remaining tempfiles

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list