RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm-5_3: rpm/tests/ Makefile.am devtool devtool.conf

From: Jeff Johnson <jbj@rpm5.org>
Date: Sun 26 Sep 2010 - 02:52:28 CEST
Message-Id: <20100926005228.4D40FCC342@rpm5.org>
  RPM Package Manager, CVS Repository
  /cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   26-Sep-2010 02:52:28
  Branch: rpm-5_3                          Handle: 2010092600522700

  Added files:              (Branch: rpm-5_3)
    rpm/tests               devtool devtool.conf
  Modified files:           (Branch: rpm-5_3)
    rpm/tests               Makefile.am

  Log:
    - tests: upload Install-DISTRO records to mongo.rpm5.org.
    - tests: split Check-DISTRO into Install-DISTRO/Verify-DISTRO targets.

  Summary:
    Revision    Changes     Path
    1.63.2.21   +46 -25     rpm/tests/Makefile.am
    1.1.2.1     +143 -0     rpm/tests/devtool
    1.1.2.1     +234 -0     rpm/tests/devtool.conf
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/tests/Makefile.am
  ============================================================================
  $ cvs diff -u -r1.63.2.20 -r1.63.2.21 Makefile.am
  --- rpm/tests/Makefile.am	25 Sep 2010 05:54:02 -0000	1.63.2.20
  +++ rpm/tests/Makefile.am	26 Sep 2010 00:52:27 -0000	1.63.2.21
  @@ -127,6 +127,7 @@
   gsr =		@__GSR@
   mkdir =		@__MKDIR@
   mongo =		@__MONGO@
  +mongoserver =	198.178.231.189		# XXX mongo.rpm5.org
   mv =		@__MV@
   rm =		@__RM@
   sqlite3 =	@__SQLITE3@
  @@ -351,8 +352,9 @@
   	${rpm} -U probes-test/probes-2*.rpm
   
   # AL -- AsianLinux
  -AL_mirror =	http://download.asianlinux.net/pub/AsianLinux
  -AL2_uri =	$(AL_mirror)/2/i386/os/AsianLinux/RPMS/
  +# XXX notyet
  +#AL_mirror =	http://download.asianlinux.net/pub/AsianLinux
  +#AL2_uri =	$(AL_mirror)/2/i386/os/AsianLinux/RPMS/
   # ALT -- Alt Linux
   ALT_mirror =	http://distro.ibiblio.org/pub/linux/distributions/altlinux
   ALT51_uri =	$(ALT_mirror)/5.1/branch/files/i586/RPMS/
  @@ -379,14 +381,16 @@
   C52_uri =	http://vault.centos.org/5.2/os/i386/CentOS/
   C51_uri =	http://vault.centos.org/5.1/os/i386/CentOS/
   C50_uri =	http://vault.centos.org/5.0/os/i386/CentOS/
  -C48_uri =	$(C_mirror)/4.8/os/i386/CentOS/RPMS/
  -C39_uri =	$(C_mirror)/3.9/os/i386/RedHat/RPMS/
  +# XXX notyet
  +#C48_uri =	$(C_mirror)/4.8/os/i386/CentOS/RPMS/
  +#C39_uri =	$(C_mirror)/3.9/os/i386/RedHat/RPMS/
   # IDMS -- IDMS Linux
   IDMS_uri =	http://download.idms-linux.org/trunk/i586/RPMS/
   IDMS_manifest =	$(testdir)/ref/idms-minimal.i586.manifest
   # MYTHDORA -- MythDora
  -MYTHDORA_mirror = http://mirror.beww.org/mythdora
  -MYTHDORA1223 =	$(MYTHDORA_mirror)/12.23/i386/os/Packages/
  +# XXX notyet
  +#MYTHDORA_mirror = http://mirror.beww.org/mythdora
  +#MYTHDORA1223 =	$(MYTHDORA_mirror)/12.23/i386/os/Packages/
   # MDV -- Mandriva
   MDV_mirror =	http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official
   MDV2009_uri =	$(MDV_mirror)/2009.0/i586/media/main/release/
  @@ -424,7 +428,8 @@
   SL52_uri =	$(SL_mirror)/52/i386/SL/
   SL51_uri =	$(SL_mirror)/51/i386/SL/
   SL50_uri =	$(SL_mirror)/50/i386/SL/
  -SL48_uri =	$(SL_mirror)/48/i386/SL/
  +# XXX notyet
  +#SL48_uri =	$(SL_mirror)/48/i386/SL/
   # SLES -- SuSE
   SLES_mirror =	http://mirrors1.kernel.org/opensuse/distribution
   SLES11_1_uri =	$(SLES_mirror)/11.1/repo/oss/suse/i586/
  @@ -441,21 +446,19 @@
   # YL -- Yoper Linux
   
   DISTROS = \
  -	AL2 \
   	ALT51 \
   	ARK \
   	CM12 CM14 CM15 \
   	CAOS2 CAOS3 \
  -	C55 C54 C53 C52 C51 C50 C48 C39 \
  +	C55 C54 C53 C52 C51 C50 \
   	IDMS \
   	MDV2009 MDV2010 \
   	MOBLIN21 \
  -	MYTHDORA1223 \
   	OJUBA4 \
   	OWL2 \
   	PLD3 \
  -	SL55 SL54 SL53 SL52 SL51 SL50 SL48 \
  -	SLES11_1 SLES11_2 SLES11_3 
  +	SL55 SL54 SL53 SL52 SL51 SL50 \
  +	SLES11_3 SLES11_2 SLES11_1  \
   	UL \
   	YDL62 YDL61
   
  @@ -470,11 +473,14 @@
   	@echo "=== $@ ==="
   	@mkdir -p $(@D)
   	@if [ ! -f $@ ]; then \
  +	  rm -f ${@D}/uri; \
  +	  for U in ${$(@D)_uri}; do echo "$${U}" >> ${@D}/uri; done; \
   	  if [ -z "${${@D}_manifest}" ]; \
   	    then ${find} ${$(@D)_uri} -maxdepth 1 | grep 'rpm$$' > $@; \
   	    else cp ${${@D}_manifest} $@; \
   	  fi; \
  -	  ls -l $@; \
  +	  ./devtool ${@D} > ${@D}/distros.mongo; \
  +	  ls -l ${@D}/uri $@ ${@D}/distros.mongo; \
   	fi
   
   %/RPMS: %/manifest
  @@ -491,33 +497,47 @@
   	  then ${find} $< -name '*.rpm' | sort -u > $@; \
   	fi
   
  +now =	date -u --rfc-3339=seconds
  +
   %/solve: %/todo
  -	@echo "==> Create $@ ..."
  +	@rm -f ${@D}/import
  +	@echo "`now` ==> ${@D}: Creating ..." | tee -a ${@D}/import
   	@mkdir -p $@/log $@/tmp
   	@${cp} $(testdir)/ref/DB_CONFIG $@
  -	@echo "==> Import $@ ..."
  -	${rpm} -i -D '_dbpath ${@D}/solve' --justdb --stats \
  +	@echo "`now` <== ${@D}: Created." | tee -a ${@D}/import
  +	@echo "`now` ==> ${@D}: Importing ..." | tee -a ${@D}/import
  +	@-${rpm} -i -D '_dbpath ${@D}/solve' --justdb --stats \
   	  --replacepkgs --replacefiles --oldpackage \
   	  --noaid --ignoresize --nodeps --noorder \
   	  --noscripts --notriggers --noparentdirs --nolinktos \
  -	  $<
  +	  $< \
  +	  2>&1 | tee -a ${@D}/import
  +	@echo "`now` <== ${@D}: Imported." | tee -a ${@D}/import
   
  -Check-%: %/solve
  +Install-%: %/solve
   	@echo "=== $@ ==="
  +	@rm -f $(<D)/install
  +	@echo "`$(now)` ==> ${<D}: Installing ..." | tee -a $(<D)/install
   	@${sudo} rm -rf $(<D)/ROOT
   	@mkdir -p $(<D)/ROOT/var/lib/rpm/log $(<D)/ROOT/var/lib/rpm/tmp
   	@${cp} $(testdir)/ref/DB_CONFIG $(<D)/ROOT/var/lib/rpm
  -	@echo "==> $@: Installing ..."
   	@-${sudo} ${rpm} -Uvh --nofdigests \
   	  -r $(testdir)/$(<D)/ROOT \
   	  -D '_dbpath /var/lib/rpm' \
   	  -D '_solve_A $(<D)/solve' \
   	  --noparentdirs --nolinktos \
  -	  $(<D)/todo
  +	  $(<D)/todo 2>&1 | tee -a $(<D)/install
  +	@echo "`$(now)` <== ${<D}: Installed." | tee -a $(<D)/install
  +	@-./devtool ${<D} > ${<D}/install.mongo
  +	@-${mongo} ${mongoserver} < ${<D}/install.mongo
  +
  +Verify-%: %/solve
  +	@echo "=== $@ ==="
   	@${sudo} rm -rf $(<D)/ROOT
   	@mkdir -p $(<D)/ROOT/var/lib/rpm/log $(<D)/ROOT/var/lib/rpm/tmp
   	@${cp} $(testdir)/ref/DB_CONFIG $(<D)/ROOT/var/lib/rpm
  -	@echo "==> $@: Verifying ..."
  +	@rm -f $(<D)/verify
  +	@echo "`$(now)` ==> ${<D}: Verifying ..." | tee -a $(<D)/verify
   	@-for F in `cat $(<D)/todo`; do \
   	  echo "-----> " $$F; \
   	  ${rpm} -U --justdb --stats \
  @@ -525,17 +545,18 @@
   	    -D "_solve_A $(<D)/solve" \
   	    --noscripts --notriggers --noparentdirs --nolinktos \
   	    $$F \
  -	  || : ; \
  +	  2>&1 || : ; \
   	  ${rpm} -Va --nofiles --noaid \
   	    -D '_dbpath $(testdir)/$(<D)/ROOT/var/lib/rpm' \
   	    --noparentdirs --nolinktos \
  -	  || : ; \
  +	  2>&1 || : ; \
   	  ${rpm} -e --justdb \
   	    -D '_dbpath $(testdir)/$(<D)/ROOT/var/lib/rpm' \
   	    --nodeps --noscripts --notriggers \
   	    `${rpm} -D '_dbpath $(testdir)/$(<D)/ROOT/var/lib/rpm' -qa` \
  -	  || : ; \
  -	done
  +	  2>&1 || : ; \
  +	done | tee -a $(<D)/verify
  +	@echo "`$(now)` <== ${<D}: Verified." | tee -a $(<D)/verify
   
   .PHONY:	check-triggers
   check-triggers:
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/tests/devtool
  ============================================================================
  $ cvs diff -u -r0 -r1.1.2.1 devtool
  --- /dev/null	2010-09-26 02:46:07.000000000 +0200
  +++ devtool	2010-09-26 02:52:28.203172483 +0200
  @@ -0,0 +1,143 @@
  +#!/bin/sh
  +##
  +##  devtool -- Development Tool
  +##  Copyright (c) 2001 Ralf S. Engelschall <rse@engelschall.com>
  +##
  +
  +#   determine source tree location
  +DEVTOOL_SRCDIR=`echo "$0" | sed -e 's;/devtool$;;'`
  +export DEVTOOL_SRCDIR
  +
  +#   build environment sanity check
  +if [ ! -f ${DEVTOOL_SRCDIR}/devtool.conf ]; then
  +    echo "devtool:ERROR: no devtool.conf in current directory" 1>&2
  +    exit 1
  +fi
  +
  +#   usage sanity check
  +if [ $# -eq 0 ]; then
  +    echo "devtool:USAGE: devtool <command> [<arg> ...]" 1>&2
  +    exit 1
  +fi
  +cmd="$1"
  +shift
  +cmdline=`grep "^%$cmd" ${DEVTOOL_SRCDIR}/devtool.conf`
  +if [ ".$cmdline" = . ]; then
  +    echo "devtool:ERROR: command $cmd not found in devtool.conf" 1>&2
  +    exit 1
  +fi
  +
  +#   ensure a reasonable temporary directory exists
  +if [ ".$TMPDIR" != . ]; then
  +    tmpdir="$TMPDIR"
  +elif [ ".$TEMPDIR" != . ]; then
  +    tmpdir="$TEMPDIR"
  +else
  +    tmpdir="/tmp"
  +fi
  +tmpfile="$tmpdir/devtool.$$.tmp"
  +
  +#   generate run-command script
  +rm -f $tmpfile
  +touch $tmpfile
  +( sed <${DEVTOOL_SRCDIR}/devtool -e '1,/^##  devtool.func {/d' -e '/^##  } devtool.func/,$d'
  +  sed <${DEVTOOL_SRCDIR}/devtool.conf -e "1,/^%common/d" -e '/^%.*/,$d'
  +  sed <${DEVTOOL_SRCDIR}/devtool.conf -e "1,/^%$cmd/d" -e '/^%.*/,$d' ) |\
  +sed -e 's;\([ 	]\)@\([a-zA-Z_][a-zA-Z0-9_-]*\);\1devtool_\2;' \
  +    -e 's;\([ 	]\)%\([a-zA-Z_][a-zA-Z0-9_-]*\);\1devtool_execute \2;' \
  +>>$tmpfile
  +
  +#   execute run-command script
  +sh $tmpfile "$@"
  +rc=$?
  +
  +#   cleanup and graceful exit
  +rm -f $tmpfile >/dev/null 2>&1 || true
  +exit $rc
  +
  +##  devtool.func { # is now embedded. This line used as cutting point. Do not remove.
  +
  +devtool_execute () {
  +    sh ${DEVTOOL_SRCDIR}/devtool "$@"
  +}
  +
  +devtool_source () {
  +    _tmpfile="${TMPDIR-/tmp}/devtool.$$.tmp.$2"
  +    rm -f $_tmpfile
  +    sed <${DEVTOOL_SRCDIR}/devtool.conf -e "1,/^%$2/d" -e '/^%.*/,$d' |\
  +    sed -e 's;\([ 	]\)@\([a-zA-Z_][a-zA-Z0-9_-]*\);\1devtool_\2;' \
  +        -e 's;\([ 	]\)%\([a-zA-Z_][a-zA-Z0-9_-]*\);\1devtool_execute \2;' >$_tmpfile
  +    . $_tmpfile
  +    rm -f $_tmpfile
  +}
  +
  +devtool_require () {
  +    t="$1"; o="$2"; p="$3"; e="$4"; a="$5"
  +    v=`($t $o | head -1 | awk "{ print \\\$$p; }") 2>/dev/null`
  +    if [ ".$v" = . ]; then
  +        echo "devtool:ERROR: unable to determine version of $t" 1>&2
  +        exit 1
  +    fi
  +    case "$v" in
  +        $e )
  +            ;;
  +        $a )
  +            echo "devtool:WARNING: $t version $v accepted, but expected $e." 1>&2
  +            ;;
  +        * )
  +            echo "devtool:ERROR: $t version $v NOT acceptable, requires $e." 1>&2
  +            exit 1
  +            ;;
  +    esac
  +    echo "$v"
  +}
  +
  +devtool_autogen () {
  +    tool=$1
  +    shift
  +    case $tool in
  +        autoconf )
  +            autoconf_version=`devtool_require autoconf --version 4 "$1" "$2"`
  +            echo "generating (GNU Autoconf $autoconf_version): configure config.h.in"
  +            autoconf
  +            autoheader 2>&1 | grep -v "is unchanged"
  +            rm -rf autom4te.cache >/dev/null 2>&1
  +            ;;
  +        libtool )
  +            libtoolize_version=`devtool_require libtoolize --version 4 "$1" "$2"`
  +            echo "generating (GNU Libtool $libtoolize_version): ltmain.sh, libtool.m4, config.guess, config.sub"
  +            libtoolize --force --copy --install >/dev/null 2>&1
  +            cp `libtoolize --force --copy --dry-run --install | grep "add the contents of" |\
  +                sed -e 's;^[^\`]*\`;;' -e "s;'.*;;"` libtool.m4
  +            ;;
  +        shtool )
  +            shtoolize_version=`devtool_require shtoolize -v 3 "$1" "$2"`
  +            echo "generating (GNU Shtool $shtoolize_version): shtool"
  +            shift
  +            shift
  +            shtoolize -q "$@"
  +            ;;
  +    esac
  +}
  +
  +devtool_autoclean () {
  +    tool=$1
  +    shift
  +    case $tool in
  +        autoconf )
  +            echo "removing: configure config.h.in"
  +            rm -f configure config.h.in
  +            ;;
  +        libtool )
  +            echo "removing: ltmain.sh libtool.m4 config.guess config.sub"
  +            rm -f ltmain.sh libtool.m4 config.guess config.sub
  +            ;;
  +        shtool )
  +            echo "removing: shtool"
  +            rm -f shtool
  +            ;;
  +    esac
  +}
  +
  +##  } devtool.func # is now embedded. This line used as cutting point. Do not remove.
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/tests/devtool.conf
  ============================================================================
  $ cvs diff -u -r0 -r1.1.2.1 devtool.conf
  --- /dev/null	2010-09-26 02:46:07.000000000 +0200
  +++ devtool.conf	2010-09-26 02:52:28.173170046 +0200
  @@ -0,0 +1,234 @@
  +##
  +##  devtool.conf -- Development Tool Configuration for RPM 5
  +##
  +
  +%common
  +    Y=mongo
  +    export Y
  +
  +## ----- YAML
  +%init_yaml
  +    echo "---"
  +
  +%next_yaml
  +
  +%fini_yaml
  +    echo "---"
  +
  +%scalar_yaml
  +    T=$1; shift
  +    echo "$T:	$*"
  +
  +%tuple_yaml
  +    T=$1; shift
  +    echo "$T:"
  +    for I in $*; do
  +        echo "  - $I"
  +    done
  +
  +%slurp_yaml
  +    T=$1; shift
  +    echo "$T: |-"
  +    echo "`cat $1 | sed -e 's;^;  ;'`"
  +
  +## ----- JSON
  +%init_json
  +
  +%next_json
  +    echo ", "
  +
  +%fini_json
  +    echo ""
  +
  +%scalar_json
  +    T=$1; shift
  +    echo -n "{ \"$T\" : \"$*\" }"
  +
  +%tuple_json
  +    T=$1; shift
  +    echo -n "{ \"$T\" : "
  +    C="  [ "
  +    for I in $*; do
  +        echo -n "$C\"$I\""; C=", "
  +    done
  +    echo -n " ]"
  +    -n echo " }"
  +
  +%slurp_json
  +    T=$1; shift
  +    echo -n " { \"$T\" : \"`cat $1 | sed -e 's;\";\\\\\";g'`\" }"
  +
  +## ----- MONGO
  +%init_mongo
  +    D=$1
  +    set `../rpm --version`
  +    echo "use distros-`echo $3 | tr . _`;"
  +    echo "log = db.$D;"
  +    echo "log.insert("
  +
  +%next_mongo
  +    echo ", "
  +
  +%fini_mongo
  +    echo ");"
  +
  +%scalar_mongo
  +    T=$1; shift
  +    echo -n " { \"$T\" : \"$*\" }"
  +
  +%tuple_mongo
  +    T=$1; shift
  +    echo " { \"$T\" : "
  +    C="  [ "
  +    for I in $*; do
  +        echo -n "$C\"$I\""; C=",
  +    "
  +    done
  +    echo "
  +  ]"
  +    echo " }"
  +
  +%slurp_mongo
  +    T=$1; shift
  +    echo " { \"$T\" : \"\\"
  +    echo "`cat $1 | sed -e 's;\";\\\\\";g' -e 's;$;\\\\n\\\\;'`"
  +    echo "\"}"
  +
  +## -----
  +%identify
  +    D=$1
  +    Uri=`head -n 1 $D/uri`
  +    Mirror="$(test -f $D/mirror && cat $D/mirror || {
  +        echo $Uri | sed -e 's;^\(.*://[^/]*\)/.*;\1;'
  +    })"
  +    %scalar_$Y here	`hostname`:$PWD/$D
  +    %next_$Y
  +    %scalar_$Y now	`date -u --rfc-3339=seconds`
  +    %next_$Y
  +    set `../rpm --version`
  +    %scalar_$Y rpm	$3
  +    %next_$Y
  +    %scalar_$Y uname	`uname -a`
  +    %next_$Y
  +    %scalar_$Y distro	$D
  +    %next_$Y
  +    %scalar_$Y mirror	$Mirror
  +    %next_$Y
  +    %scalar_$Y base	`echo $Uri | sed -e 's;^'$Mirror'/;;'`
  +
  +%packages
  +    D=$1
  +    F=$D/manifest
  +    %init_$Y		$D
  +    %identify		$D
  +    %next_$Y
  +    set `wc -l $F`
  +    %scalar_$Y npkgs	$1
  +    %next_$Y
  +    %tuple_$Y manifest	`cat $F | sed -e 's;^.*/;;' -e 's;.rpm$;;'`
  +    if [ -f $D/install ]; then
  +        %next_$Y
  +	%slurp_$Y install $D/install
  +    fi
  +    if [ -f $D/verify ]; then
  +        %next_$Y
  +	%slurp_$Y verify $D/verify
  +    fi
  +    %fini_$Y
  +
  +## -----
  +%ALT51
  +    %packages		ALT51
  +
  +%ARK
  +    %packages		ARK
  +
  +%CM12
  +    %packages		CM12
  +
  +%CM14
  +    %packages		CM14
  +
  +%CM15
  +    %packages		CM15
  +
  +%CAOS2
  +    %packages		CAOS2
  +
  +%CAOS3
  +    %packages		CAOS3
  +
  +%C55
  +    %packages		C55
  +
  +%C54
  +    %packages		C54
  +
  +%C53
  +    %packages		C53
  +
  +%C52
  +    %packages		C52
  +
  +%C51
  +    %packages		C51
  +
  +%C50
  +    %packages		C50
  +
  +%IDMS
  +    %packages		IDMS
  +
  +%MDV2009
  +    %packages		MDV2009
  +
  +%MDV2010
  +    %packages		MDV2010
  +
  +%MOBLIBN21
  +    %packages		MOBLIBN21
  +
  +%OJUBA4
  +    %packages		OJUBA4
  +
  +%OWL2
  +    %packages		OWL2
  +
  +%PLD3
  +    %packages		PLD3
  +
  +%SL55
  +    %packages		SL55
  +
  +%SL54
  +    %packages		SL54
  +
  +%SL53
  +    %packages		SL53
  +
  +%SL52
  +    %packages		SL52
  +
  +%SL51
  +    %packages		SL51
  +
  +%SL50
  +    %packages		SL50
  +
  +%SLES11_3
  +    %packages		SLES11_3
  +
  +%SLES11_2
  +    %packages		SLES11_2
  +
  +%SLES11_1
  +    %packages		SLES11_1
  +
  +%UL
  +    %packages		UL
  +
  +%YDL62
  +    %packages		YDL62
  +
  +%YDL61
  +    %packages		YDL61
  @@ .
Received on Sun Sep 26 02:52:28 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.