This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: "ss" patches


Here are the long-promised patches to gdbadmin's crontab and ss
directories.

I haven't really tested them, I'm afraid.
I'll see what I can do today, but otherwise I'll just keep an eye on
them next week, since the worst case scenario is just a missing snapshot
or two.

Tom

Index: crontab
===================================================================
RCS file: /cvs/gdbadmin/crontab/crontab,v
retrieving revision 1.37
diff -u -r1.37 crontab
--- crontab	24 Jun 2013 22:26:13 -0000	1.37
+++ crontab	18 Oct 2013 16:09:33 -0000
@@ -4,4 +4,4 @@
 
 47 1 * * * sh%$HOME/ss/do-all-snapshots `date -u '+\%Y-\%m-\%d-gmt'` $BRANCH
 
-0 * * * * sh $HOME/ss/update-cvs-version -d /cvs/src co -r $BRANCH src/gdb/version.in >>$HOME/log/update-cvs-version.$BRANCH 2>&1
+0 * * * * sh $HOME/ss/update-git-version  src/gdb/version.in clone --branch $BRANCH --single-branch /git/binutils-gdb.git >>$HOME/log/update-cvs-version.$BRANCH 2>&1
Index: README
===================================================================
RCS file: /cvs/gdbadmin/ss/README,v
retrieving revision 1.7
diff -u -r1.7 README
--- README	14 Apr 2009 18:16:18 -0000	1.7
+++ README	18 Oct 2013 16:09:37 -0000
@@ -27,8 +27,6 @@
     insight+dejagnu*	Containts INSIGHT, DEJAGNU and TCL/TK.
     *.tar.bz2		A bzip2 tar archive
     *.diff.bz2		Differences between two snapshots.
-    *-CVS-*.tar.bz2	Checkout of the CVS tree (made weekly)
-			may be faster than `cvs -z9 co ...`
 
 Using 6.0 (previous) and 6.1 (next) as examples, snapshots in the
 branch/ are assigned the version numbers:
Index: do-all-snapshots
===================================================================
RCS file: /cvs/gdbadmin/ss/do-all-snapshots,v
retrieving revision 1.14
diff -u -r1.14 do-all-snapshots
--- do-all-snapshots	6 Oct 2004 15:20:48 -0000	1.14
+++ do-all-snapshots	18 Oct 2013 16:09:37 -0000
@@ -30,13 +30,13 @@
 
 (
     cat <<EOF
-gdb      current  gdb/current   ${today}  -D ${midnight}
-#insight+dejagnu  current  DNE           ${today}  -D ${midnight}
+gdb      current  gdb/current   ${today}
+#insight+dejagnu  current  DNE           ${today}
 EOF
     test "${branch}" && cat <<EOF
-gdb      branch   gdb           ${today}  -D ${midnight} -r ${branch}
-#gdb+dejagnu      branch   gdb           ${today}  -D ${midnight} -r ${branch}
-#insight+dejagnu  branch   DNE           ${today}  -D ${midnight} -r ${branch}
+gdb      branch   gdb           ${today} --branch ${branch}
+#gdb+dejagnu      branch   gdb           ${today} --branch ${branch}
+#insight+dejagnu  branch   DNE           ${today} --branch ${branch}
 EOF
 ) | grep -v '#' | while read module ftp www today coopts
 do
Index: do-snapshot
===================================================================
RCS file: /cvs/gdbadmin/ss/do-snapshot,v
retrieving revision 1.19
diff -u -r1.19 do-snapshot
--- do-snapshot	10 Jul 2013 22:38:39 -0000	1.19
+++ do-snapshot	18 Oct 2013 16:09:37 -0000
@@ -5,7 +5,7 @@
 
 if test $# -lt 4
 then
-    echo "Usage: $0 package ftp www today coopts ..." 1>&2
+    echo "Usage: $0 package ftp www today branch" 1>&2
     exit 1
 fi
 
@@ -13,12 +13,19 @@
 ftp=$1 ; shift ; echo "ftp=$ftp"
 www=$1 ; shift ; echo "www=$www"
 today=$1 ; shift ; echo "today=$today"
-coopts="$*" ; shift ; echo "coopts=$coopts"
+branch=$1 ; shift ; echo "branch=$branch"
 
 ftpdir=/sourceware/ftp/anonftp/pub/gdb/snapshots/${ftp}
 wwwdir=/www/sourceware/htdocs/${www}
 
-version=`cvs -d /cvs/src co ${coopts} -p src/gdb/version.in`
+REPO=/git/binutils-gdb.git
+coopts=""
+if test -n "$branch"; then
+    coopts="--branch $branch"
+fi
+coopts="$coopts --depth 1 $REPO"
+
+version=`cd $REPO && git show ${branch:-master}:gdb/version.in 2> /dev/null`
 version=`echo ${version} | sed -e "
 s/-cvs//
 s/DATE/${today}/
@@ -42,7 +49,7 @@
 	${tmpdir}/make-snapshot \
 	${package} \
 	${version} \
-	-Q -d /cvs/src co ${coopts} -P ${package} \
+	-q clone ${coopts} \
 	>> ${logfile} )
 then
     echo "make-snapshot ${package} ${ftp} done" | tee -a ${logfile}
@@ -105,9 +112,8 @@
 	gdb \
 	>> ${logfile} )
   then
-      echo "update-web-ari from CVS sources ${package} ${ftp} done" | tee -a ${logfile}
+      echo "update-web-ari from git sources ${package} ${ftp} done" | tee -a ${logfile}
       diff=${wwwdir}/ari/ari.source.diff
-      branch="$coopts"
       node=`uname -n`
       if [ "x${branch}" != "x" ]; then
 	email_suffix="`date` in ${branch}"
Index: do-ss
===================================================================
RCS file: /cvs/gdbadmin/ss/do-ss,v
retrieving revision 1.16
diff -u -r1.16 do-ss
--- do-ss	14 Apr 2009 18:16:18 -0000	1.16
+++ do-ss	18 Oct 2013 16:09:37 -0000
@@ -11,7 +11,6 @@
 tmpdir=/sourceware/snapshot-tmp/gdb/delete-me/tmp
 ftpdir=/sourceware/snapshot-tmp/gdb/delete-me/ftp
 wwwdir=/sourceware/snapshot-tmp/gdb/delete-me/www
-coopts="-D ${today}"
 
 sh -x ./do-scp
 
@@ -25,15 +24,12 @@
 sssh mkdir -p ${ftpdir}
 for module in gdb
 do
-    for task in update-web-ari # do-all-snapshots update-web-ari make-snapshot update-snapshot
+    for task in update-web-ari # do-all-snapshots update-web-ari update-snapshot
     do
 	case $task in
 	do-all-snapshots )
 	    sssh ./ss/do-all-snapshots `date -u '+%Y-%m-%d-gmt'`
 	    ;;
-	make-snapshot )
-	    sssh /bin/sh -x ./ss/make-snapshot ${tmpdir} $module ${version} -d /cvs/src -Q co -P ${coopts} $module
-	    ;;
 	update-snapshot )
 	    sssh /bin/sh -x ./ss/update-snapshot ${tmpdir} $module ${version} ${ftpdir}
 	    ;;
Index: make-snapshot
===================================================================
RCS file: /cvs/gdbadmin/ss/make-snapshot,v
retrieving revision 1.12
diff -u -r1.12 make-snapshot
--- make-snapshot	25 Jun 2013 20:33:49 -0000	1.12
+++ make-snapshot	18 Oct 2013 16:09:37 -0000
@@ -1,6 +1,6 @@
 #!/bin/sh -x
 
-# This script makes a ${package} snapshot from the CVS sources.
+# This script makes a ${package} snapshot from the git sources.
 # This is based closely on a script by Ken Raeburn.
 
 PATH=/bin:/usr/bin:/usr/local/bin:$HOME/bin
@@ -15,7 +15,7 @@
 
 if test $# -lt 5
 then
-    echo "Usage: $0 <snapdir> <tmpdir> <package> <version> <cvs-options> -Q co -P <co-options>"
+    echo "Usage: $0 <snapdir> <tmpdir> <package> <version> <git-options> -q clone <clone-options>"
     exit 1
 fi
 snapdir=$1 ; shift
@@ -28,8 +28,8 @@
 cd ${tmpdir} || exit 1
 
 
-echo Working in `pwd`. cvs "$@" ...
-cvs "$@"
+echo Working in `pwd`. git "$@" ...
+git "$@"
 
 
 # Work out where things ended up, there are several possible names
@@ -44,72 +44,8 @@
 fi
 
 
-echo Creating a CVS snapshot ...
-
-echo "Strip /D... option from the CVS/Entries file ..."
-find ${root} -name Entries | while read f
-do
-    ed $f > /dev/null 2>&1 <<EOF
-1,$ s,/D[0-9\.]*$,/,
-wq
-EOF
-done
-
-echo "Replace root with sourceware root ..."
-find ${root} -name Root | while read f
-do
-    echo ":pserver:anoncvs@sourceware.org:/cvs/src" > $f
-done
-
-echo "`date`: Create CVS tarball ..."
-tar cf ${snapdir}/${package}-CVS-${version}.tar ${root}
-chmod 644 ${snapdir}/${package}-CVS-${version}.tar
-
-
-
 echo Create the release snapshot ...
 
-echo "`date`: Fix the date/version in any AM_INIT_AUTOMAKE ..."
-for am in ${root}/bfd/configure.in ${root}/dejagnu/configure.in
-do
-    if [ -f $am ]
-    then
-	ed $am <<EOF
-/AM_INIT_AUTOMAKE/
-s/,.*)/, ${version})/g
-p
-w
-EOF
-    fi
-done
-
-
-echo "`date`: Fix the date/version in any Makefile.in or configure scripts ..."
-for mf in ${root}/bfd/configure ${root}/dejagnu/configure.in
-do
-    if [ -f $mf ]
-    then
-	ed $mf <<EOF
-/^VERSION *=/
-s/=.*/=${version}/g
-p
-w
-EOF
-    fi
-done
-
-
-echo `date`: Blatting files ...
-for f in $HOME/ss/Makefile.in $HOME/ss/src-release
-do
-    if [ -r $f ]
-    then
-	echo ... $f
-	cp $f ${root}
-    fi
-done
-
-
 if test -r ${root}/src-release
 then
     makefile=src-release
Index: update-cvs-version
===================================================================
RCS file: update-cvs-version
diff -N update-cvs-version
--- update-cvs-version	10 Jul 2013 22:38:39 -0000	1.9
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,52 +0,0 @@
-#!/bin/sh
-
-PATH=/bin:/usr/bin:/usr/local/bin:$HOME/bin
-export PATH
-
-
-# Usage: <cvs-options> co <co-options> file
-if test $# -eq 0
-then
-    cat <<EOF 1>&2
-Usage: $0 -d <cvs-repository> co [ <co-options> ] version-file>
-eg: $0 -d /cvs/src co src/gdb/version.in
-EOF
-    exit 1
-fi
-
-
-# pluck the version-file from the end of the command
-file=`while test $# -gt 1 ; do shift ; done ; echo $1`
-dir=`dirname $file`
-ver=`basename $file`
-
-
-workdir=/sourceware/snapshot-tmp/gdb/update-cvs-version.$$
-mkdir -p ${workdir}
-cd ${workdir}
-
-
-date=`date -u +%Y-%m-%d`
-DATE=`date -u +%Y%m%d`
-
-
-echo ${date} "$@"
-
-
-cvs "$@" > /dev/null
-cd $dir
-sed \
-    -e 's/[Y0-9][Y0-9][Y0-9][Y0-9]-[M0-9][M0-9]-[D0-9][D0-9]/'$date'/' \
-    -e 's/[Y0-9][Y0-9][Y0-9][Y0-9][M0-9][M0-9][D0-9][D0-9]/'$DATE'/' \
-    < ${ver} > ${ver}.new
-
-if diff ${ver}.new ${ver}
-then
-    :
-else
-    mv ${ver}.new ${ver}
-    EDITOR=true cvs commit -F /dev/null $ver
-fi
-
-cd
-rm -rf ${workdir}
Index: update-git-version
===================================================================
RCS file: update-git-version
diff -N update-git-version
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ update-git-version	18 Oct 2013 16:09:37 -0000
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+PATH=/bin:/usr/bin:/usr/local/bin:$HOME/bin
+export PATH
+
+# Usage: file <git-options> clone <clone-options>
+if test $# -eq 0
+then
+    cat <<EOF 1>&2
+Usage: version-file <git-options> clone <clone-options>
+EOF
+    exit 1
+fi
+
+
+file=$1
+shift
+
+dir=`dirname $file`
+ver=`basename $file`
+
+
+workdir=/sourceware/snapshot-tmp/gdb/update-git-version.$$
+mkdir -p ${workdir}
+cd ${workdir}
+
+
+date=`date -u +%Y-%m-%d`
+DATE=`date -u +%Y%m%d`
+
+
+echo ${date} "$@"
+
+
+git $cloneargs > /dev/null
+
+# Loop in case pushing fails and we need to pull again first.
+while true; do
+    cd $dir
+    sed \
+	-e 's/[Y0-9][Y0-9][Y0-9][Y0-9]-[M0-9][M0-9]-[D0-9][D0-9]/'$date'/' \
+	-e 's/[Y0-9][Y0-9][Y0-9][Y0-9][M0-9][M0-9][D0-9][D0-9]/'$DATE'/' \
+	< ${ver} > ${ver}.new
+
+    if diff ${ver}.new ${ver}
+    then
+	break
+    else
+	mv ${ver}.new ${ver}
+	git commit -a -m'' --allow-empty-message
+	if git push origin HEAD; then
+	    break
+	fi
+	# Try again.
+	if ! git pull --rebase; then
+	    # If a pull failed, bail out.
+	    break
+	fi
+    fi
+done
+
+cd
+rm -rf ${workdir}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]