diff options
86 files changed, 3817 insertions, 196 deletions
diff --git a/community/augeas/PKGBUILD b/community/augeas/PKGBUILD index deab45541..0d53076e5 100644 --- a/community/augeas/PKGBUILD +++ b/community/augeas/PKGBUILD @@ -1,18 +1,19 @@ -# $Id: PKGBUILD 59250 2011-11-22 01:03:57Z ebelanger $ +# $Id: PKGBUILD 60191 2011-12-07 04:43:36Z ebelanger $ # Contributor: Thomas S Hatch <thatch45@gmail.com> # Contributor: Jon Nordby <jononor@gmail.com> pkgname=augeas -pkgver=0.9.0 +pkgver=0.10.0 pkgrel=1 pkgdesc="A configuration editing tool that parses config files and transforms them into a tree" arch=('i686' 'x86_64' 'mips64el') url="http://augeas.net" license=('LGPL') -depends=('readline' 'gcc-libs') +depends=('libxml2') options=('!libtool') -source=(http://augeas.net/download/$pkgname-$pkgver.tar.gz) -md5sums=('5ef0ce53ce4c75f59ab2523506731084') +source=(http://augeas.net/download/$pkgname-$pkgver.tar.gz{,.sig}) +md5sums=('fe1834e90a066c3208ac0214622c7352' + 'efb3f1a90ff31320dcc4c499eba5a555') build() { cd "$srcdir/$pkgname-$pkgver" diff --git a/community/clanlib/PKGBUILD b/community/clanlib/PKGBUILD index d102689c1..bf4035763 100644 --- a/community/clanlib/PKGBUILD +++ b/community/clanlib/PKGBUILD @@ -1,8 +1,8 @@ -# $Id: PKGBUILD 55262 2011-09-07 19:47:51Z svenstaro $ +# $Id: PKGBUILD 60147 2011-12-06 05:24:01Z svenstaro $ # Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com> pkgname=clanlib -pkgver=2.3.3 +pkgver=2.3.4 pkgrel=1 pkgdesc="A multi-platform game development library." arch=('i686' 'x86_64' 'mips64el') @@ -12,7 +12,7 @@ depends=('alsa-lib' 'libjpeg' 'libmikmod' 'libpng' 'libvorbis' 'libxi' 'libxmu' makedepends=('doxygen' 'graphviz') options=('!libtool') source=(http://clanlib.org/download/releases-2.0/ClanLib-${pkgver}.tgz) -md5sums=('052779f52c2e86317eca6a1e7d882fdf') +md5sums=('cc89f632aa194399e909bbbd13beca1b') build() { cd ${srcdir}/ClanLib-${pkgver} diff --git a/community/confuse/PKGBUILD b/community/confuse/PKGBUILD index b64aab760..ddfb63ec2 100755 --- a/community/confuse/PKGBUILD +++ b/community/confuse/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 17258 2010-05-22 14:32:23Z ibiru $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer : Ionut Biru <ibiru@archlinux.org> # Contributor: Roman Kyrylych <roman@archlinux.org> # Contributor: Alexander Mieland (dma147) <dma147@linux-stats.org> diff --git a/community/converseen/PKGBUILD b/community/converseen/PKGBUILD index 9cb8758be..c324f06d4 100644 --- a/community/converseen/PKGBUILD +++ b/community/converseen/PKGBUILD @@ -1,10 +1,10 @@ -# $Id: PKGBUILD 59585 2011-11-28 16:53:50Z giovanni $ +# $Id: PKGBUILD 60165 2011-12-06 10:42:48Z giovanni $ # Maintainer: Giovanni Scafora <giovanni@archlinux.org> # Contributor: archtux <antonio.arias99999 at gmail.com> pkgname=converseen -pkgver=0.4.6 -pkgrel=4 +pkgver=0.4.7 +pkgrel=1 pkgdesc="The batch image converter and resizer" arch=('i686' 'x86_64') url="http://converseen.sourceforge.net/" @@ -13,7 +13,7 @@ depends=('imagemagick' 'qt') makedepends=('cmake') install=converseen.install source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.bz2") -md5sums=('07c876b52e1982b8b2493c3aea3c3071') +md5sums=('d21cb571b268ddf4bcdc395d01c0dc49') build() { cd "${srcdir}" diff --git a/community/denemo/PKGBUILD b/community/denemo/PKGBUILD index b04dd2eac..d12c5680b 100644 --- a/community/denemo/PKGBUILD +++ b/community/denemo/PKGBUILD @@ -1,22 +1,22 @@ -# $Id: PKGBUILD 45779 2011-04-28 21:38:58Z spupykin $ +# $Id: PKGBUILD 60150 2011-12-06 08:50:04Z spupykin $ # Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> # Contributor: Philipp Sandhaus <philipp.sandhaus@gmx.de> # Contributor: Robert Emil Berge <filoktetes@linuxophic.org> # Contributor: Gnud <ach.gnud@gmail.com> pkgname=denemo -pkgver=0.9.0 +pkgver=0.9.2 pkgrel=1 pkgdesc="A music score editor" arch=('i686' 'x86_64' 'mips64el') url="http://www.denemo.org" license=('GPL') depends=('aubio' 'portaudio' 'lilypond' 'gtk2' 'libxml2' 'guile' 'fftw' 'gtksourceview2' - 'librsvg' 'fluidsynth') + 'librsvg' 'fluidsynth' 'libsmf') options=('!libtool') backup=('etc/denemo/denemo.conf') source=("http://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz") -md5sums=('7679622302e5fec9776501a5e2777888') +md5sums=('6dbe944f45cf8818b199e831ac7a5e4f') build() { cd $srcdir/$pkgname-$pkgver diff --git a/community/devil/PKGBUILD b/community/devil/PKGBUILD index fddb3cc7c..b1fa118b2 100644 --- a/community/devil/PKGBUILD +++ b/community/devil/PKGBUILD @@ -1,17 +1,17 @@ -# $Id: PKGBUILD 57890 2011-11-04 08:33:14Z lcarlier $ -# Maintainer: damir <damir@archlinux.org> +# $Id: PKGBUILD 60209 2011-12-07 16:29:05Z svenstaro $ +# Maintainer: Laurent Carlier <lordheavym@gmail.org> +# Contributor: damir <damir@archlinux.org> # Contributor: TheHoff <forums> pkgname=devil pkgver=1.7.8 -pkgrel=8 +pkgrel=9 pkgdesc="Library for reading several different image formats" arch=('i686' 'x86_64' 'mips64el') url="http://openil.sourceforge.net/" -depends=('allegro4' 'sdl' 'libpng' 'libmng' 'freeglut' - 'jasper' 'lcms' 'openexr') -makedepends=('bash') -options=('!libtool' '!docs') +depends=('libpng' 'libmng' 'jasper' 'lcms' 'openexr') +install=devil.install +options=('!libtool' '!docs' '!emptydirs') license=('GPL') source=(http://downloads.sourceforge.net/openil/DevIL-$pkgver.tar.gz libpng14.patch) md5sums=('7918f215524589435e5ec2e8736d5e1d' @@ -22,7 +22,7 @@ build() { patch -Np1 -i ${srcdir}/libpng14.patch - ./configure --prefix=/usr --enable-ILU --enable-ILUT --enable-opengl --enable-sdl + ./configure --prefix=/usr --enable-ILU make } diff --git a/community/devil/devil.install b/community/devil/devil.install new file mode 100644 index 000000000..8336ac3d1 --- /dev/null +++ b/community/devil/devil.install @@ -0,0 +1,11 @@ +infodir=usr/share/info + +post_upgrade() { + [ -x usr/bin/install-info ] || return 0 + install-info $infodir/DevIL_manual.info.gz $infodir/dir 2> /dev/null +} + +pre_remove() { + [ -x usr/bin/install-info ] || return 0 + install-info --delete $infodir/DevIL_manual.info.gz $infodir/dir 2> /dev/null +} diff --git a/community/dillo/PKGBUILD b/community/dillo/PKGBUILD index af53031ec..20b975395 100644 --- a/community/dillo/PKGBUILD +++ b/community/dillo/PKGBUILD @@ -1,9 +1,9 @@ -# $Id: PKGBUILD 55932 2011-09-26 09:36:25Z spupykin $ +# $Id: PKGBUILD 60152 2011-12-06 08:54:11Z spupykin $ # Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> # Maintainer: dorphell <dorphell@archlinux.org> pkgname=dillo -pkgver=3.0.1 +pkgver=3.0.2 pkgrel=1 pkgdesc="A small, fast graphical web browser built on FLTK" arch=(i686 x86_64 'mips64el') @@ -13,7 +13,7 @@ depends=('fltk' 'libjpeg' 'perl' 'openssl' 'libpng' 'gcc-libs' 'libxcursor' 'libxi' 'libxinerama') backup=(etc/dillo/{dillorc,dpidrc}) source=(http://www.dillo.org/download/$pkgname-$pkgver.tar.bz2) -md5sums=('f201e771a4bc70e801521000763b82fb') +md5sums=('81b82112cefcc7d54fe2972a21f42930') build() { cd "$srcdir/$pkgname-$pkgver" diff --git a/community/e-svn/PKGBUILD b/community/e-svn/PKGBUILD index db8906b12..4e8053ec8 100755 --- a/community/e-svn/PKGBUILD +++ b/community/e-svn/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 58075 2011-11-06 10:13:58Z rvanharen $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Ronald van Haren <ronald.archlinux.org> # Contributor: Ronald van Haren <ronald.archlinux.org> diff --git a/community/e_dbus-svn/PKGBUILD b/community/e_dbus-svn/PKGBUILD index 06c75533c..f893b61ff 100755 --- a/community/e_dbus-svn/PKGBUILD +++ b/community/e_dbus-svn/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 58073 2011-11-06 10:12:55Z rvanharen $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Ronald van Haren <ronald.archlinux.org> # Contributor: Ronald van Haren <ronald.archlinux.org> diff --git a/community/ecore-svn/PKGBUILD b/community/ecore-svn/PKGBUILD index ec20ba97a..12e599935 100755 --- a/community/ecore-svn/PKGBUILD +++ b/community/ecore-svn/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 58089 2011-11-06 13:31:05Z rvanharen $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Ronald van Haren <ronald.archlinux.org> # Contributor: Ronald van Haren <ronald.archlinux.org> diff --git a/community/edje-svn/PKGBUILD b/community/edje-svn/PKGBUILD index 912678418..a3b51cc3b 100755 --- a/community/edje-svn/PKGBUILD +++ b/community/edje-svn/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 58090 2011-11-06 13:31:38Z rvanharen $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Ronald van Haren <ronald.archlinux.org> # Contributor: Ronald van Haren <ronald.archlinux.org> diff --git a/community/eet-svn/PKGBUILD b/community/eet-svn/PKGBUILD index 983c417af..27346f8b4 100755 --- a/community/eet-svn/PKGBUILD +++ b/community/eet-svn/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 58091 2011-11-06 13:32:00Z rvanharen $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Ronald van Haren <ronald.archlinux.org> # Contributor: Ronald van Haren <ronald.archlinux.org> diff --git a/community/efreet-svn/PKGBUILD b/community/efreet-svn/PKGBUILD index e7609cf72..6d6dd57ea 100755 --- a/community/efreet-svn/PKGBUILD +++ b/community/efreet-svn/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 58071 2011-11-06 10:11:44Z rvanharen $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Ronald van Haren <ronald.archlinux.org> # Contributor: Ronald van Haren <ronald.archlinux.org> diff --git a/community/eina-svn/PKGBUILD b/community/eina-svn/PKGBUILD index 75957b532..65b508ece 100755 --- a/community/eina-svn/PKGBUILD +++ b/community/eina-svn/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 58057 2011-11-06 10:03:11Z rvanharen $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Ronald van Haren <ronald.archlinux.org> # Contributor: Ronald van Haren <ronald.archlinux.org> diff --git a/community/embryo-svn/PKGBUILD b/community/embryo-svn/PKGBUILD index 4a27c760d..ecade52fa 100755 --- a/community/embryo-svn/PKGBUILD +++ b/community/embryo-svn/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 58067 2011-11-06 10:07:33Z rvanharen $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Ronald van Haren <ronald.archlinux.org> # Contributor: Ronald van Haren <ronald.archlinux.org> diff --git a/community/emesene/PKGBUILD b/community/emesene/PKGBUILD index 8e855b55d..f86109ac9 100755 --- a/community/emesene/PKGBUILD +++ b/community/emesene/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 59461 2011-11-25 15:15:41Z jelle $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Ronald van Haren <ronald.archlinux.org> # Contributor: Claudio Riva <firetux83@gmail.com> diff --git a/community/emprint-svn/PKGBUILD b/community/emprint-svn/PKGBUILD index f2023c285..cc25d3fcd 100755 --- a/community/emprint-svn/PKGBUILD +++ b/community/emprint-svn/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 53118 2011-07-30 17:05:35Z rvanharen $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Ronald van Haren <ronald.archlinux.org> # Contributor: Ronald van Haren <ronald.archlinux.org> diff --git a/community/evas-svn/PKGBUILD b/community/evas-svn/PKGBUILD index a6fcc5a41..95e1ae93f 100755 --- a/community/evas-svn/PKGBUILD +++ b/community/evas-svn/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 58061 2011-11-06 10:05:15Z rvanharen $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Ronald van Haren <ronald.archlinux.org> # Contributor: Ronald van Haren <ronald.archlinux.org> diff --git a/community/fcron/PKGBUILD b/community/fcron/PKGBUILD index 67b8e026f..788d6800c 100755 --- a/community/fcron/PKGBUILD +++ b/community/fcron/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 42747 2011-03-20 15:07:32Z ttopper $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Contributor: Giorgio Lando <lando at imap dot cc> # Contributor: Sergej Pupykin # Contributor: Thomas Bächler diff --git a/community/intellij-idea-libs/PKGBUILD b/community/intellij-idea-libs/PKGBUILD index 1c0843521..ccb506e98 100644 --- a/community/intellij-idea-libs/PKGBUILD +++ b/community/intellij-idea-libs/PKGBUILD @@ -1,8 +1,8 @@ -# $Id: PKGBUILD 60020 2011-12-03 09:02:29Z stativ $ +# $Id: PKGBUILD 60185 2011-12-06 20:06:27Z stativ $ # Maintainer: Lukas Jirkovsky <l.jirkovsky@gmail.com> pkgname=intellij-idea-libs -pkgver=10.5.3 -_pkgver=107.764 +pkgver=11 +_pkgver=111.69 pkgrel=1 pkgdesc="Architecture dependend libraries needed by the Intellij Idea IDE" arch=('i686' 'x86_64' 'mips64el') @@ -10,14 +10,16 @@ url="http://www.jetbrains.org/" license=('apache') depends=('glibc') source=(http://download.jetbrains.com/idea/ideaIC-$pkgver.tar.gz) -md5sums=('56d1fec8f420cb964f086f5685694b86') +md5sums=('d838994ecc6556b52a83d37138530dbb') build() { cd "$srcdir" - install -d -m755 "$pkgdir/"usr/{bin,lib} + install -d -m755 "$pkgdir/usr/share/intellijidea-ce/bin" + install -d -m755 "$pkgdir/usr/lib" + [ $CARCH == "x86_64" ] && SUFFIX=64 - install -m755 "idea-IC-$_pkgver"/bin/fsnotifier${SUFFIX} "$pkgdir"/usr/bin + install -m755 "idea-IC-$_pkgver"/bin/fsnotifier${SUFFIX} "$pkgdir"/usr/share/intellijidea-ce/bin/ install -m644 "idea-IC-$_pkgver"/bin/libbreakgen${SUFFIX}.so "$pkgdir"/usr/lib } diff --git a/community/keepalived/PKGBUILD b/community/keepalived/PKGBUILD new file mode 100644 index 000000000..79361ec90 --- /dev/null +++ b/community/keepalived/PKGBUILD @@ -0,0 +1,44 @@ +# $Id$ +# Maintainer: Sebastien Luttringer <seblu+arch@seblu.net +# Contributor: Andrea Zucchelli <zukka77@gmail.com> + +pkgname=keepalived +pkgver=1.2.2 +pkgrel=1 +pkgdesc='implements an independent VRRPv2 stack and a userspace daemon for LVS cluster nodes healthchecks and LVS directors failover' +arch=('i686' 'x86_64') +url='http://www.keepalived.org/' +license=('GPL2') +backup=('etc/keepalived/keepalived.conf' 'etc/conf.d/keepalived') +depends=('openssl' 'popt' 'libnl') +source=("http://www.keepalived.org/software/$pkgname-$pkgver.tar.gz" + 'keepalived.rc' + 'keepalived.conf' + 'ip_vs_moved.patch') +md5sums=('f68327ca142616a8463d2d105db122cd' + 'baeb62a682c2b59d732cea84bf52cc87' + '9c8142da8730ad27a345587dea83ced7' + '87ee19c85adaedd3eb11bea8a5865d47') + +build() { + cd $pkgname-$pkgver + patch -p1 -i ../ip_vs_moved.patch + ./configure --prefix=/usr --sysconfdir=/etc + make +} + +package() { + # add initscripts + install -D -m 755 $pkgname.rc "${pkgdir}/etc/rc.d/$pkgname" + install -D -m 644 $pkgname.conf "${pkgdir}/etc/conf.d/$pkgname" + + cd $pkgname-$pkgver + make DESTDIR="$pkgdir" install + # clean pacakge init scripts + rm -r "$pkgdir/etc/rc.d/init.d" "$pkgdir/etc/sysconfig" + # move examples to /usr/share + install -d -m 755 "$pkgdir/usr/share/$pkgname" + mv "$pkgdir/etc/keepalived/samples" "$pkgdir/usr/share/$pkgname/samples" +} + +# vim:set ts=2 sw=2 ft=sh et: diff --git a/community/keepalived/ip_vs_moved.patch b/community/keepalived/ip_vs_moved.patch new file mode 100644 index 000000000..e27873810 --- /dev/null +++ b/community/keepalived/ip_vs_moved.patch @@ -0,0 +1,23 @@ +--- keepalived-1.2.2/configure 2011-01-06 01:51:33.000000000 +0100 ++++ keepalived-1.2.2.orig/configure 2011-11-24 19:36:32.051486626 +0100 +@@ -3973,7 +3973,7 @@ + + IPVS_SUPPORT="_WITHOUT_LVS_" + if test "$enable_lvs" != "no"; then +- ac_fn_c_check_header_mongrel "$LINENO" "net/ip_vs.h" "ac_cv_header_net_ip_vs_h" "$ac_includes_default" ++ ac_fn_c_check_header_mongrel "$LINENO" "linux/ip_vs.h" "ac_cv_header_net_ip_vs_h" "$ac_includes_default" + if test "x$ac_cv_header_net_ip_vs_h" = x""yes; then : + IPVS_SUPPORT="_WITH_LVS_" + else +diff -ru keepalived-1.2.2/configure.in keepalived-1.2.2.orig/configure.in +--- keepalived-1.2.2/configure.in 2011-01-06 01:51:30.000000000 +0100 ++++ keepalived-1.2.2.orig/configure.in 2011-11-24 19:36:11.797860077 +0100 +@@ -124,7 +124,7 @@ + dnl ----[ Checks for LVS and VRRP support ]---- + IPVS_SUPPORT="_WITHOUT_LVS_" + if test "$enable_lvs" != "no"; then +- AC_CHECK_HEADER([net/ip_vs.h], ++ AC_CHECK_HEADER([linux/ip_vs.h], + [IPVS_SUPPORT="_WITH_LVS_"], + [ + IPVS_SUPPORT="_WITHOUT_LVS_" diff --git a/community/keepalived/keepalived.conf b/community/keepalived/keepalived.conf new file mode 100644 index 000000000..225f02bf9 --- /dev/null +++ b/community/keepalived/keepalived.conf @@ -0,0 +1,16 @@ +# vim:set ts=2 sw=2 ft=sh et: +# Options for keepalived. See `keepalived --help' output and keepalived(8) and +# keepalived.conf(5) man pages for a list of all options. Here are the most +# common ones : +# +# --vrrp -P Only run with VRRP subsystem. +# --check -C Only run with Health-checker subsystem. +# --dont-release-vrrp -V Dont remove VRRP VIPs & VROUTEs on daemon stop. +# --dont-release-ipvs -I Dont remove IPVS topology on daemon stop. +# --dump-conf -d Dump the configuration data. +# --log-detail -D Detailed log messages. +# --log-facility -S 0-7 Set local syslog facility (default=LOG_DAEMON) +# + +DAEMON_OPTS='-D' + diff --git a/community/keepalived/keepalived.rc b/community/keepalived/keepalived.rc new file mode 100644 index 000000000..88bb90724 --- /dev/null +++ b/community/keepalived/keepalived.rc @@ -0,0 +1,39 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/${0##*/} + +NAME=keepalived +DAEMON=/usr/sbin/keepalived +PID=$(pidof -o %PPID $DAEMON) + +case "$1" in + start) + stat_busy "Starting $NAME daemon" + [[ ! $PID ]] && $DAEMON $DAEMON_OPTS && add_daemon $NAME && stat_done && exit 0 + stat_fail + ;; + stop) + stat_busy "Stopping $NAME daemon" + [[ $PID ]] && kill $PID &> /dev/null && rm_daemon $NAME && stat_done && exit 0 + stat_fail + ;; + restart) + $0 stop + $0 start + exit 0 + ;; + reload) + stat_busy "Reloading $NAME daemon" + [[ $PID ]] && kill -HUP $PID &> /dev/null && stat_done && exit 0 + stat_fail + ;; + *) + echo "usage: ${0##*/} {start|stop|restart|reload}" >&2 + ;; +esac + +exit 1 + +# vim:set ts=2 sw=2 ft=sh noet: diff --git a/community/libfbclient/PKGBUILD b/community/libfbclient/PKGBUILD index 5f9ac10f4..3bb9cbc28 100755 --- a/community/libfbclient/PKGBUILD +++ b/community/libfbclient/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 58848 2011-11-18 21:30:35Z lcarlier $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Carlier Laurent <lordheavym@gmail.com> # Contributor: Douglas Soares de Andrade <dsa@aur.archlinux.org> diff --git a/community/libmilter/PKGBUILD b/community/libmilter/PKGBUILD index 3154cc8b9..3d842fb77 100644 --- a/community/libmilter/PKGBUILD +++ b/community/libmilter/PKGBUILD @@ -1,16 +1,16 @@ -# $Id: PKGBUILD 56914 2011-10-16 12:39:57Z spupykin $ +# $Id: PKGBUILD 60205 2011-12-07 15:22:36Z spupykin $ # Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> # Maintainer: mutantmonkey <mutantmonkey@gmail.com> pkgname=libmilter -pkgver=8.14.4 -pkgrel=3 +pkgver=8.14.5 +pkgrel=1 pkgdesc="libmilter" arch=(i686 x86_64) url="http://www.postfix.org/MILTER_README.html" license=('custom:Sendmail open source license') source="ftp://ftp.sendmail.org/pub/sendmail/sendmail.${pkgver}.tar.gz" -md5sums=('1b23d5000c8e7bfe82ec1a27f2f5fdc5') +md5sums=('02ccfc331cc81ed00ec8bb5ecfc69018') build(){ cd "${srcdir}/sendmail-${pkgver}" diff --git a/community/libsmf/PKGBUILD b/community/libsmf/PKGBUILD new file mode 100644 index 000000000..62f77a96a --- /dev/null +++ b/community/libsmf/PKGBUILD @@ -0,0 +1,28 @@ +# $Id: PKGBUILD 60154 2011-12-06 08:54:54Z spupykin $ +# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Maintainer: SpepS <dreamspepser at yahoo dot it> + +pkgname=libsmf +pkgver=1.3 +pkgrel=3 +pkgdesc='A BSD-licensed C library for handling SMF ("*.mid") files.' +arch=('i686' 'x86_64') +url="http://sourceforge.net/projects/libsmf/" +license=('BSD') +depends=('glib2' 'readline') +options=('!libtool') +source=("http://downloads.sourceforge.net/project/libsmf/libsmf/$pkgver/$pkgname-$pkgver.tar.gz") +md5sums=('eb698f1bc0bad9d5bce4c10386347486') + +build() { + cd "$srcdir/$pkgname-$pkgver" + ./configure --prefix=/usr \ + --enable-static=no + make +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + make DESTDIR="$pkgdir" install + install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} diff --git a/community/pragha/PKGBUILD b/community/pragha/PKGBUILD index 44bdf517d..568cd38c4 100755 --- a/community/pragha/PKGBUILD +++ b/community/pragha/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 58664 2011-11-17 11:39:42Z ttopper $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Thorsten Töpper <atsutane-tu@freethoughts.de> # Contributor: Alois Nespor <alois.nespor@gmail.com> # Contributor: JerichoKru <jerichokru(AT)htomail.com> diff --git a/community/python-mpi4py/PKGBUILD b/community/python-mpi4py/PKGBUILD index 31223ef91..e48458f39 100644 --- a/community/python-mpi4py/PKGBUILD +++ b/community/python-mpi4py/PKGBUILD @@ -1,11 +1,11 @@ -# $Id: PKGBUILD 42202 2011-03-15 13:58:47Z andrea $ +# $Id: PKGBUILD 60172 2011-12-06 14:17:13Z stephane $ # Maintainer : Stéphane Gaudreault <stephane@archlinux.org> # Contributor: Sebastien Binet <binet@cern.ch> pkgbase=python-mpi4py pkgname=('python-mpi4py' 'python2-mpi4py') pkgver=1.2.2 -pkgrel=4 +pkgrel=5 arch=('i686' 'x86_64' 'mips64el') url="http://mpi4py.scipy.org" license=('BSD') diff --git a/community/python-psycopg1/PKGBUILD b/community/python-psycopg1/PKGBUILD index 7a0acfefa..54244d526 100755 --- a/community/python-psycopg1/PKGBUILD +++ b/community/python-psycopg1/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 27290 2010-09-19 04:29:33Z ebelanger $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Contributor: William Rea <sillywilly@gmail.com> pkgname=python-psycopg1 diff --git a/community/python-pyro/PKGBUILD b/community/python-pyro/PKGBUILD index c978da9a2..72d738f24 100755 --- a/community/python-pyro/PKGBUILD +++ b/community/python-pyro/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 56634 2011-10-09 10:13:09Z angvp $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Angel Velasquez <angvp@archlinux.org> # Contributor: Douglas Soares de Andrade <dsa@aur.archlinux.br> pkgbase=python-pyro diff --git a/community/python2-cheetah/PKGBUILD b/community/python2-cheetah/PKGBUILD index fd6ebf4ed..d27faddb3 100755 --- a/community/python2-cheetah/PKGBUILD +++ b/community/python2-cheetah/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 56977 2011-10-17 13:24:23Z jelle $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Contributor: James Rayner <james@archlinux.org> # Contributor: Todd Maynard <arch@toddmaynard.com> diff --git a/community/qps/PKGBUILD b/community/qps/PKGBUILD index 6d7869391..d1ec3d9b7 100644 --- a/community/qps/PKGBUILD +++ b/community/qps/PKGBUILD @@ -1,24 +1,21 @@ -# $Id: PKGBUILD 54014 2011-08-11 18:04:13Z spupykin $ +# $Id: PKGBUILD 60157 2011-12-06 09:22:03Z spupykin $ # Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> # Contributor: David Rosenstrauch <darose@darose.net> pkgname=qps -pkgver=1.10.15 -_dlpkgver=5946 -pkgrel=2 +pkgver=1.10.16 +_dlpkgver=5963 +pkgrel=1 pkgdesc="a visual process manager, an X11 version of 'top' or 'ps'." url="http://qps.kldp.net/projects/qps" depends=('qt') arch=('i686' 'x86_64' 'mips64el') license="GPL" -source=(http://kldp.net/frs/download.php/${_dlpkgver}/qps-$pkgver.tar.bz2 - version-patch.diff) -md5sums=('25a6c6f8ac9172a6874e3514edf1eda1' - 'e323a796a3dbf44a99af386e867f7848') +source=(http://kldp.net/frs/download.php/${_dlpkgver}/qps-$pkgver.tar.bz2) +md5sums=('dc3396749ad9254fd60ca84b5c0b16b9') build() { cd $srcdir/$pkgname-$pkgver - patch -p0 <$srcdir/version-patch.diff qmake make } diff --git a/community/qstardict/PKGBUILD b/community/qstardict/PKGBUILD index 7a6e2487c..ad3c84abb 100755 --- a/community/qstardict/PKGBUILD +++ b/community/qstardict/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 54585 2011-08-20 18:29:13Z jlichtblau $ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ # Maintainer: Jaroslav Lichtblau <dragonlord@aur.archlinux.org> # Contributor: Alois Nespor <alois.nespor@gmail.com> diff --git a/community/spring/PKGBUILD b/community/spring/PKGBUILD index 2256dffb3..1f8d2451b 100644 --- a/community/spring/PKGBUILD +++ b/community/spring/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 59968 2011-12-02 21:01:02Z ibiru $ +# $Id: PKGBUILD 60207 2011-12-07 16:26:35Z svenstaro $ # Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com> # Contributor: Arkham <arkham at archlinux dot us> # Contributor: Christoph Zeiler <archNOSPAM_at_moonblade.dot.org> @@ -6,12 +6,12 @@ pkgname=spring pkgver=0.84.0 _pkgver=84.0 -pkgrel=1 +pkgrel=2 pkgdesc='A free 3D real-time-strategy (RTS) game engine' arch=('i686' 'x86_64' 'mips64el') url="http://springrts.com/" license=('GPL') -depends=('openal' 'glew' 'boost-libs' 'freetype2' 'devil' 'libvorbis') +depends=('openal' 'glew' 'boost-libs' 'freetype2' 'devil' 'libvorbis' 'sdl') makedepends=('boost' 'cmake' 'zip' 'lzma-utils' 'p7zip' 'python2') optdepends=('python2: python-based bots' 'java-runtime: java-based bots') diff --git a/community/sword/PKGBUILD b/community/sword/PKGBUILD index 3a3659dc6..950c35862 100644 --- a/community/sword/PKGBUILD +++ b/community/sword/PKGBUILD @@ -1,53 +1,57 @@ -# $Id: PKGBUILD 59377 2011-11-23 21:18:49Z andrea $ -# Maintainer: +# $Id: PKGBUILD 60193 2011-12-07 12:16:33Z arodseth $ +# Maintainer: Alexander Rødseth # Contributor: Stefan Husmann <stefan-husmann@t-online.de> # Contributor: TripleE <eric1548@yahoo.com> - pkgname=sword pkgver=1.6.2 -pkgrel=5 +pkgrel=6 pkgdesc="Libraries for Bible programs" -arch=('i686' 'x86_64' 'mips64el') -url="http://www.crosswire.org/sword/index.jsp" +arch=('x86_64' 'i686' 'mips64el') +url="http://www.crosswire.org/sword/" license=('GPL') depends=('curl' 'clucene' 'swig') makedepends=('cmake') backup=('etc/sword.conf') -source=("http://www.crosswire.org/ftpmirror/pub/${pkgname}/source/v1.6/${pkgname}-${pkgver}.tar.gz" curl.patch) +source=("http://www.crosswire.org/ftpmirror/pub/$pkgname/source/v1.6/$pkgname-$pkgver.tar.gz" + curl.patch) md5sums=('a7dc4456e20e915fec46d774b690e305' 'e84a226ce3697af33b9fdd9a22884a2a') build() { - cd "${srcdir}"/$pkgname-$pkgver - patch -p1 -i $srcdir/curl.patch + cd "$srcdir/$pkgname-$pkgver" + + patch -p1 -i ../curl.patch + + mkdir ../build + cd ../build - cd $srcdir - mkdir build - cd build - cmake ../${pkgname}-${pkgver} \ + cmake "../$pkgname-$pkgver" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release + make } package() { - cd "${srcdir}"/build - make DESTDIR="${pkgdir}" install + cd "$srcdir/build" + + make DESTDIR="$pkgdir" install - # Ugly workarounds to fix a weird cmakelists.txt - install -d "${pkgdir}"/usr/lib/sword - mv "${pkgdir}"/usr/lib/1.6.2_icu_4.8* "${pkgdir}"/usr/lib/sword/ + install -d "$pkgdir/usr/lib/sword" + mv "$pkgdir"/usr/lib/1.6.2_icu_4.8* "$pkgdir/usr/lib/sword/" - cd "${srcdir}"/${pkgname}-${pkgver}/locales.d/ + cd "$srcdir/$pkgname-$pkgver/locales.d/" for file in *.conf; do - install -Dm644 $file "${pkgdir}"/usr/share/sword/locales.d/$file + install -Dm644 "$file" "$pkgdir/usr/share/sword/locales.d/$file" done cd ../include - install -d "${pkgdir}"/usr/include/sword - install -Dm644 canon_{catholic{,2},synodalp}.h "${pkgdir}"/usr/include/sword + install -d "$pkgdir/usr/include/sword" + install -Dm644 canon_{catholic{,2},synodalp}.h "$pkgdir/usr/include/sword" cd ../samples - install -Dm644 mods.d/globals.conf "${pkgdir}"/usr/share/sword/mods.d/globals.conf - install -Dm644 recommended/sword.conf "${pkgdir}"/etc/sword.conf + install -Dm644 mods.d/globals.conf "$pkgdir/usr/share/sword/mods.d/globals.conf" + install -Dm644 recommended/sword.conf "$pkgdir/etc/sword.conf" } + +# vim:set ts=2 sw=2 et: diff --git a/community/xiphos/PKGBUILD b/community/xiphos/PKGBUILD index aca720a45..cb3864be4 100755 --- a/community/xiphos/PKGBUILD +++ b/community/xiphos/PKGBUILD @@ -1,31 +1,36 @@ -# $Id: PKGBUILD 49759 2011-06-20 22:11:59Z andrea $ -# Maintainer: Stefan Husmann <stefan-husmann@t-online.de> +# $Id: PKGBUILD 60197 2011-12-07 12:42:03Z arodseth $ +# Maintainer: Alexander Rødseth <rodseth@gmail.com> +# Contributor: Andrea Scarpino +# Contributor: Stefan Husmann <stefan-husmann@t-online.de> # Contributor: TripleE <eric1548@yahoo.com> - pkgname=xiphos pkgver=3.1.4 -pkgrel=8 -pkgdesc="A Bible study tool for gtk" -arch=('i686' 'x86_64' 'mips64el') -url="http://xiphos.org" +pkgrel=9 +pkgdesc="Bible study tool for GTK+" +arch=('x86_64' 'i686' 'mips64el') +url="http://xiphos.org/" license=('GPL') -depends=('libgsf' 'libglade' 'gtkhtml' 'sword' 'hicolor-icon-theme') +depends=('libgsf' 'libglade' 'gtkhtml' 'sword') makedepends=('gnome-doc-utils' 'intltool' 'python2') conflicts=('gnomesword') provides=('gnomesword') replaces=('gnomesword') -install=$pkgname.install +install=xiphos.install source=("http://downloads.sourceforge.net/gnomesword/$pkgname-$pkgver.tar.gz") md5sums=('4d6f7805c4c8185f5c4ac3bd95fc705a') build() { - cd $srcdir/$pkgname-$pkgver - sed -i '1s/python/python2/' waf + cd "$srcdir/$pkgname-$pkgver" + + sed -i '0,/on/s//on2/' waf ./waf configure --prefix=/usr --enable-gtkhtml ./waf build --prefix=/usr } package() { - cd $srcdir/$pkgname-$pkgver - GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 ./waf install --destdir=$pkgdir + cd "$srcdir/$pkgname-$pkgver" + + GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 ./waf install --destdir="$pkgdir" } + +# vim:set ts=2 sw=2 et: diff --git a/community/xiphos/xiphos.install b/community/xiphos/xiphos.install index ada2ca2f2..048e77780 100644 --- a/community/xiphos/xiphos.install +++ b/community/xiphos/xiphos.install @@ -1,5 +1,3 @@ -pkgname=xiphos - post_install() { gtk-update-icon-cache -q -t -f usr/share/icons/hicolor } @@ -11,3 +9,5 @@ post_upgrade() { post_remove() { post_install } + +# vim:set ts=2 sw=2 et: diff --git a/core/keyutils/PKGBUILD b/core/keyutils/PKGBUILD index 691cc0add..5a9db6545 100644 --- a/core/keyutils/PKGBUILD +++ b/core/keyutils/PKGBUILD @@ -1,8 +1,8 @@ -# $Id: PKGBUILD 142277 2011-11-07 20:10:07Z stephane $ +# $Id: PKGBUILD 144590 2011-12-07 12:54:45Z stephane $ # Maintainer: Tobias Powalowski <tpowa@archlinux.org> pkgname=keyutils -pkgver=1.5.2 -pkgrel=2 +pkgver=1.5.5 +pkgrel=1 pkgdesc="Linux Key Management Utilities" arch=(i686 x86_64 'mips64el') url="http://www.kernel.org" @@ -10,7 +10,7 @@ license=('GPL2' 'LGPL2.1') depends=('glibc' 'sh') backup=(etc/request-key.conf) source=(http://people.redhat.com/~dhowells/${pkgname}/${pkgname}-${pkgver}.tar.bz2) -md5sums=('19811ee31f683058a9aae3e6a3a23a7f') +md5sums=('9e8ab5164bc8f84be148761cc89e9d6f') build() { cd "${srcdir}/${pkgname}-${pkgver}" diff --git a/core/module-init-tools/PKGBUILD b/core/module-init-tools/PKGBUILD index d52b61042..1e3b467f9 100644 --- a/core/module-init-tools/PKGBUILD +++ b/core/module-init-tools/PKGBUILD @@ -1,23 +1,26 @@ -# $Id: PKGBUILD 142296 2011-11-08 00:38:05Z dreisner $ +# $Id: PKGBUILD 144465 2011-12-06 10:57:39Z dreisner $ # Maintainer: Dave Reisner <dreisner@archlinux.org> # Maintainer: Aaron Griffin <aaron@archlinux.org> # Contributor: judd <jvinet@zeroflux.org> pkgname=module-init-tools pkgver=3.16 -pkgrel=2 +pkgrel=3 pkgdesc="Utilities needed by Linux systems for managing loadable kernel modules" arch=('i686' 'x86_64' 'mips64el') url="https://modules.wiki.kernel.org" license=('GPL') depends=('glibc') makedepends=('docbook2x') -backup=('etc/modprobe.d/modprobe.conf') +backup=('etc/modprobe.d/modprobe.conf' + 'etc/depmod.d/depmod.conf') source=("http://www.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar.bz2" modprobe.conf + depmod.conf docfix.patch) md5sums=('bc44832c6e41707b8447e2847d2019f5' '325657db471b3190f685e5a89c9b90e3' + '4b8cbcbc54b9029c99fd730e257d4436' '4320d19902ded43bed55c804b065cdc7') build() { @@ -35,9 +38,12 @@ package() { make DESTDIR=$pkgdir install - # extra modprobe.d conf dir - install -dm755 "$pkgdir/lib/modprobe.d" + # extra modprobe.d and depmod.d conf dirs + install -dm755 "$pkgdir/lib/modprobe.d" "$pkgdir/etc/depmod.d" - # Install our custom (read: empty) modprobe.conf + # Install custom depmod config to allow searching extramodules/ + install -Dm644 "$srcdir/depmod.conf" "$pkgdir/etc/depmod.d/depmod.conf" + + # Install our custom (empty) modprobe.conf install -Dm644 "$srcdir/modprobe.conf" "$pkgdir/etc/modprobe.d/modprobe.conf" } diff --git a/core/module-init-tools/depmod.conf b/core/module-init-tools/depmod.conf new file mode 100644 index 000000000..3feb67b05 --- /dev/null +++ b/core/module-init-tools/depmod.conf @@ -0,0 +1,5 @@ +# +# /etc/depmod.d/depmod.conf +# + +search updates extramodules built-in diff --git a/core/shadow/PKGBUILD b/core/shadow/PKGBUILD index 45e945496..e46251076 100644 --- a/core/shadow/PKGBUILD +++ b/core/shadow/PKGBUILD @@ -1,9 +1,10 @@ -# $Id: PKGBUILD 129320 2011-06-26 16:36:48Z eric $ +# $Id: PKGBUILD 144463 2011-12-06 10:57:36Z dreisner $ +# Maintainer: Dave Reisner <dreisner@archlinux.org> # Maintainer: Aaron Griffin <aaron@archlinux.org> pkgname=shadow pkgver=4.1.4.3 -pkgrel=2 +pkgrel=5 pkgdesc="Password and account management tool suite with support for shadow files and PAM" arch=('i686' 'x86_64' 'mips64el') url='http://pkg-shadow.alioth.debian.org/' @@ -27,12 +28,12 @@ source=(ftp://ftp.archlinux.org/other/shadow/shadow_4.1.4.2+svn3283.orig.tar.gz sha1sums=('8b704b8f07718e329205f23d457c3121c0f3679e' '78ec184a499f9708adcfcf0b7a3b22a60bf39f91' '4ad0e059406a305c8640ed30d93c2a1f62c2f4ad' - 'd66096ed9477bd7242e8d2cc28eaa23170269788' + '12427b1ca92a9b85ca8202239f0d9f50198b818f' '0e56fed7fc93572c6bf0d8f3b099166558bb46f1' - '0b2d98a0ee3bfde8551ade48d4d35cc20ec702a1' + '895aad07c192b288b457e19dd7b8c55841b4ad22' 'e5cab2118ecb1e61874cde842d7d04d1003f35cb' - 'd66096ed9477bd7242e8d2cc28eaa23170269788' - '6f183bc7709b0a8d20ad17481a4ad025cf6e5056' + '12427b1ca92a9b85ca8202239f0d9f50198b818f' + '611be25d91c3f8f307c7fe2485d5f781e5dee75f' '5d83ba7e11c765c951867cbe00b0ae7ff57148fa' '9ae93de5987dd0ae428f0cc1a5a5a5cd53583f19' '33a6cf1e44a1410e5c9726c89e5de68b78f5f922' diff --git a/core/shadow/chpasswd b/core/shadow/chpasswd index bc14857dc..5d447985a 100644 --- a/core/shadow/chpasswd +++ b/core/shadow/chpasswd @@ -3,4 +3,4 @@ auth sufficient pam_rootok.so auth required pam_unix.so account required pam_unix.so session required pam_unix.so -password required pam_unix.so md5 shadow +password required pam_unix.so sha512 shadow diff --git a/core/shadow/login b/core/shadow/login index 51ff96a4a..b8555f89c 100644 --- a/core/shadow/login +++ b/core/shadow/login @@ -9,7 +9,7 @@ account required pam_access.so account required pam_time.so account required pam_unix.so #password required pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3 -#password required pam_unix.so md5 shadow use_authtok +#password required pam_unix.so sha512 shadow use_authtok session required pam_unix.so session required pam_env.so session required pam_motd.so @@ -18,3 +18,4 @@ session optional pam_mail.so dir=/var/spool/mail standard session optional pam_lastlog.so session optional pam_loginuid.so -session optional pam_ck_connector.so nox11 +-session optional pam_systemd.so diff --git a/core/shadow/newusers b/core/shadow/newusers index bc14857dc..5d447985a 100644 --- a/core/shadow/newusers +++ b/core/shadow/newusers @@ -3,4 +3,4 @@ auth sufficient pam_rootok.so auth required pam_unix.so account required pam_unix.so session required pam_unix.so -password required pam_unix.so md5 shadow +password required pam_unix.so sha512 shadow diff --git a/core/shadow/passwd b/core/shadow/passwd index 1ffd1bdd8..ab56da496 100644 --- a/core/shadow/passwd +++ b/core/shadow/passwd @@ -1,4 +1,4 @@ #%PAM-1.0 #password required pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3 -#password required pam_unix.so md5 shadow use_authtok -password required pam_unix.so md5 shadow nullok +#password required pam_unix.so sha512 shadow use_authtok +password required pam_unix.so sha512 shadow nullok diff --git a/core/shadow/shadow.install b/core/shadow/shadow.install index c1bd1066b..e990bfe39 100644 --- a/core/shadow/shadow.install +++ b/core/shadow/shadow.install @@ -1,8 +1,9 @@ post_upgrade() { - grpck -r &>/dev/null + grpck -r >/dev/null 2>&1 if [ $? -eq 2 ]; then - echo "Fixing gshadow file ..." - while :; do echo "y"; done | grpck &>/dev/null + printf '%s\n' \ + "==> Warning: /etc/group or /etc/gshadow are inconsistant." \ + " Run 'grpck' to correct this." fi return 0 } diff --git a/extra/amule/PKGBUILD b/extra/amule/PKGBUILD index 09c6fa9ae..aa6b6658b 100644 --- a/extra/amule/PKGBUILD +++ b/extra/amule/PKGBUILD @@ -1,11 +1,11 @@ -# $Id: PKGBUILD 143076 2011-11-22 12:47:07Z giovanni $ +# $Id: PKGBUILD 144467 2011-12-06 11:17:39Z giovanni $ # Maintainer: Giovanni Scafora <giovanni@archlinux.org> # Contributor: Henrik Ronellenfitsch <searinox@web.de> # Contributor: Alessio Sergi <sergi.alessio {at} gmail.com> # Contributor: Dario 'Dax' Vilardi <dax [at] deelab [dot] org> pkgname=amule -pkgver=10683 +pkgver=10688 pkgrel=1 pkgdesc="An eMule-like client for ed2k p2p network" arch=('i686' 'x86_64' 'mips64el') @@ -13,7 +13,7 @@ url="http://www.amule.org" license=('GPL') depends=('wxgtk' 'gd' 'geoip' 'libupnp' 'crypto++' 'libsm') source=("http://amule.sourceforge.net/tarballs/aMule-SVN-r${pkgver}.tar.bz2") -md5sums=('c9adbecbbec7831fc42b177c8b548e05') +md5sums=('0bb387c6aafa146e75130e1537a64066') build() { cd "${srcdir}/aMule-SVN-r${pkgver}" diff --git a/extra/bitlbee/PKGBUILD b/extra/bitlbee/PKGBUILD index ce74ff1bb..2153ff5ad 100644 --- a/extra/bitlbee/PKGBUILD +++ b/extra/bitlbee/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 144362 2011-12-05 08:15:00Z bisson $ +# $Id: PKGBUILD 144487 2011-12-06 22:43:42Z bisson $ # Contributor: FUBAR <mrfubar@gmail.com> # Contributor: simo <simo@archlinux.org> @@ -8,13 +8,16 @@ pkgname=bitlbee pkgver=3.0.4 -pkgrel=1 +pkgrel=3 pkgdesc='Brings instant messaging (XMPP, MSN, Yahoo!, AIM, ICQ, Twitter) to IRC' -arch=('i686' 'x86_64' 'mips64el') url='http://www.bitlbee.org/' license=('GPL') -depends=('openssl' 'glib2' 'libotr') -optdepends=('xinetd: to run bitlbee through xinetd') +arch=('i686' 'x86_64' 'mips64el') +depends=('openssl' 'glib2') +makedepends=('asciidoc' 'libotr') +optdepends=('skype4py: to use skyped' + 'libotr: for OTR encryption support' + 'xinetd: to run bitlbee through xinetd') source=("http://get.bitlbee.org/src/${pkgname}-${pkgver}.tar.gz" 'xinetd' 'rc.d') @@ -28,15 +31,15 @@ install=install build() { cd "${srcdir}/${pkgname}-${pkgver}" - ./configure --prefix=/usr \ + ./configure \ + --prefix=/usr \ --etcdir=/etc/bitlbee \ --pidfile=/var/run/bitlbee/bitlbee.pid \ --ipcsocket=/var/run/bitlbee/bitlbee.sock \ --systemdsystemunitdir=/lib/systemd/system \ --ssl=openssl \ --strip=0 \ - --otr=1 \ - --ssl=gnutls + --otr=plugin make } diff --git a/extra/bitlbee/install b/extra/bitlbee/install index 7b43c7885..b0dd5511d 100644 --- a/extra/bitlbee/install +++ b/extra/bitlbee/install @@ -10,4 +10,5 @@ post_upgrade() { post_remove() { getent passwd bitlbee &>/dev/null && userdel bitlbee >/dev/null getent group bitlbee &>/dev/null && groupdel bitlbee >/dev/null + true } diff --git a/extra/colord/PKGBUILD b/extra/colord/PKGBUILD index bdd3b1e7a..57e789067 100644 --- a/extra/colord/PKGBUILD +++ b/extra/colord/PKGBUILD @@ -1,23 +1,25 @@ -# $Id: PKGBUILD 144384 2011-12-05 13:01:04Z ibiru $ +# $Id: PKGBUILD 144475 2011-12-06 14:25:28Z ibiru $ # Maintainer: Jan "heftig" Steffens <jan.steffens@gmail.com> # Contributor: Ionut Biru <ibiru@archlinux.org> pkgname=colord pkgver=0.1.15 -pkgrel=2 +pkgrel=3 pkgdesc="Color daemon" arch=('i686' 'x86_64' 'mips64el') url="http://www.freedesktop.org/software/colord" license=('GPL2') -depends=('lcms2' 'libgusb' 'polkit' 'sane' 'sqlite3' 'udev') +depends=('lcms2' 'libgusb' 'polkit' 'sane' 'shared-color-profiles' 'sqlite3' 'udev') makedepends=('intltool' 'gobject-introspection' 'vala' 'docbook2x') -optdepends=('shared-color-profiles: color profiles') -source=($url/releases/$pkgname-$pkgver.tar.xz) +source=($url/releases/$pkgname-$pkgver.tar.xz + scan_only_color_profile_dir.patch) options=('!libtool') -sha1sums=('e83a68add3fac9c677829925794ee353743dc9c8') +sha1sums=('e83a68add3fac9c677829925794ee353743dc9c8' + 'b4b8ea1008ecfdc1084ec69d647127587a2a87f7') build() { cd "$srcdir/$pkgname-$pkgver" + patch -Np1 -i "$srcdir/scan_only_color_profile_dir.patch" ./configure --prefix=/usr \ --sysconfdir=/etc --libexecdir=/usr/lib/colord \ --localstatedir=/var --disable-static diff --git a/extra/colord/scan_only_color_profile_dir.patch b/extra/colord/scan_only_color_profile_dir.patch new file mode 100644 index 000000000..0591fc420 --- /dev/null +++ b/extra/colord/scan_only_color_profile_dir.patch @@ -0,0 +1,35 @@ +From 78b6dc7dbf865df6b0d30526293591fe5773029a Mon Sep 17 00:00:00 2001 +From: Richard Hughes <richard@hughsie.com> +Date: Tue, 6 Dec 2011 09:49:49 +0000 +Subject: [PATCH] If /usr/share/color appears at runtime, don't rescan the + parent dir + +Resolves https://bugs.freedesktop.org/show_bug.cgi?id=43542 +--- + src/cd-profile-store.c | 10 ++++++++-- + 1 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/cd-profile-store.c b/src/cd-profile-store.c +index ecad474..c662351 100644 +--- a/src/cd-profile-store.c ++++ b/src/cd-profile-store.c +@@ -260,8 +260,14 @@ cd_profile_store_file_monitor_changed_cb (GFileMonitor *monitor, + /* just rescan the correct directory */ + parent = g_file_get_parent (file); + parent_path = g_file_get_path (parent); +- g_debug ("CdProfileStore: %s was added, rescanning %s", path, parent_path); +- cd_profile_store_search_path (profile_store, parent_path); ++ if (g_strcmp0 (parent_path, DATADIR) == 0) { ++ g_debug ("CdProfileStore: %s was added, rescanning", path); ++ cd_profile_store_search_path (profile_store, path); ++ } else { ++ g_debug ("CdProfileStore: %s was added, rescanning parent %s", ++ path, parent_path); ++ cd_profile_store_search_path (profile_store, parent_path); ++ } + out: + if (parent != NULL) + g_object_unref (parent); +-- +1.7.6 + diff --git a/extra/convertlit/PKGBUILD b/extra/convertlit/PKGBUILD new file mode 100644 index 000000000..4c7477666 --- /dev/null +++ b/extra/convertlit/PKGBUILD @@ -0,0 +1,31 @@ +# $Id: PKGBUILD 144473 2011-12-06 12:35:16Z giovanni $ +# Maintainer: Giovanni Scafora <giovanni@archlinux.org> +# Contributor: gDD (usrgdd | gmail) +# Contributor: cantabile + +pkgname=convertlit +pkgver=1.8 +pkgrel=6 +pkgdesc="An extractor/converter for .LIT eBooks" +arch=('i686' 'x86_64') +url="http://www.convertlit.com/" +license=('GPL') +depends=('glibc') +makedepends=('libtommath') +source=("http://www.convertlit.com/clit18src.zip") +md5sums=('d691d4729485fe5d73e3f0937d8fb42e') + +build() { + cd ${srcdir}/lib + make + + cd ../clit18 + sed -i 's|../libtommath-0.30/|/usr/lib/|' Makefile + make +} + +package() { + cd ${srcdir}/clit18 + + install -Dm755 clit "$pkgdir/usr/bin/clit" +} diff --git a/extra/doxygen/PKGBUILD b/extra/doxygen/PKGBUILD index 38c885149..00d2269e5 100644 --- a/extra/doxygen/PKGBUILD +++ b/extra/doxygen/PKGBUILD @@ -1,17 +1,17 @@ -# $Id: PKGBUILD 136084 2011-08-22 14:13:59Z dan $ +# $Id: PKGBUILD 144489 2011-12-06 22:57:33Z dan $ # Maintainer: Dan McGee <dan@archlinux.org> pkgbase=doxygen pkgname=('doxygen' 'doxygen-docs') -pkgver=1.7.5.1 +pkgver=1.7.6 pkgrel=1 license=('GPL') arch=(i686 x86_64 'mips64el') url="http://www.doxygen.org/" makedepends=('gcc-libs' 'flex' 'qt' 'texlive-core' 'ghostscript' 'texlive-latexextra') source=(ftp://ftp.stack.nl/pub/users/dimitri/${pkgname}-${pkgver}.src.tar.gz) -md5sums=('f5355c442c5bc2481dbef7fdea8f0556') -sha1sums=('15671defd1eefe255aa564b6f3097e30ab07ff55') +md5sums=('79f67eea3d43a5c9964194786d786f37') +sha1sums=('6c63ece66875c9312b76bfe11d688e1b1ae2e3bb') build() { cd "${srcdir}/${pkgbase}-${pkgver}" diff --git a/extra/live-media/PKGBUILD b/extra/live-media/PKGBUILD index 5f5642c9e..d3ac44303 100644 --- a/extra/live-media/PKGBUILD +++ b/extra/live-media/PKGBUILD @@ -1,9 +1,9 @@ -# $Id: PKGBUILD 143899 2011-11-30 19:57:03Z giovanni $ +# $Id: PKGBUILD 144603 2011-12-07 21:23:41Z giovanni $ # Maintainer: Giovanni Scafora <giovanni@archlinux.org> # Contributor: Gilles CHAUVIN <gcnweb@gmail.com> pkgname=live-media -pkgver=2011.11.29 +pkgver=2011.12.02 pkgrel=1 pkgdesc="A set of C++ libraries for multimedia streaming" arch=('i686' 'x86_64' 'mips64el') @@ -11,7 +11,7 @@ license=('LGPL') url="http://live555.com/liveMedia" depends=('gcc-libs') source=("http://live555.com/liveMedia/public/live.${pkgver}.tar.gz") -md5sums=('ab422e32f2e0820ac5161cc3d842343d') +md5sums=('4f10d93d33f6714a980fd1655ead69cd') build() { cd ${srcdir}/live diff --git a/extra/most/PKGBUILD b/extra/most/PKGBUILD index 52a4e8806..5eeb3031d 100644 --- a/extra/most/PKGBUILD +++ b/extra/most/PKGBUILD @@ -1,23 +1,27 @@ -# $Id: PKGBUILD 125648 2011-05-27 17:52:54Z stephane $ -# Maintainer: juergen <juergen@archlinux.org> +# $Id: PKGBUILD 144477 2011-12-06 14:33:19Z stephane $ +# Maintainer: Stéphane Gaudreault <stephane@archlinux.org> +# Contributor: juergen <juergen@archlinux.org> # Contributor: Tom Newsom <Jeepster@gmx.co.uk> pkgname=most pkgver=5.0.0a -pkgrel=3 +pkgrel=4 pkgdesc="A terminal pager similar to 'more' and 'less'" arch=('i686' 'x86_64' 'mips64el') depends=('slang') license=('GPL') -url="ftp://space.mit.edu/pub/davis/most/" -source=(ftp://space.mit.edu/pub/davis/${pkgname}/${pkgname}-${pkgver}.tar.gz most-debian.patch) +url="http://www.jedsoft.org/most/index.html" +source=(ftp://space.mit.edu/pub/davis/${pkgname}/${pkgname}-${pkgver}.tar.gz + most-debian.patch + most-leak-fd.patch) sha1sums=('99eedb7169754b9a47c7755ac48949d76531e3b2' - '937796040c69bae3bf735fa3cd734775c582e7d0') - + '937796040c69bae3bf735fa3cd734775c582e7d0' + 'c5713e1278febdd0ed434e6e3044feb220b5d525') build() { cd "${srcdir}/${pkgname}-${pkgver}" patch -Np1 -i ../most-debian.patch + patch -Np1 -i ../most-leak-fd.patch ./configure --prefix=/usr --sysconfdir=/etc make } diff --git a/extra/most/most-leak-fd.patch b/extra/most/most-leak-fd.patch new file mode 100644 index 000000000..c8cd2af09 --- /dev/null +++ b/extra/most/most-leak-fd.patch @@ -0,0 +1,14 @@ +--- most-5.0.0a.orig/src/most.c 2007-06-03 00:03:59.000000000 -0400 ++++ most-5.0.0a/src/most.c 2010-12-31 04:42:08.000000000 -0500 +@@ -321,9 +321,11 @@ + { + fprintf (stderr, "fwrite returned %d, errno = %d\n", + m, errno); ++ (void) fclose (fp); + exit (1); + } + } ++ (void) fclose (fp); + } + + void most_initialize_most (void) diff --git a/extra/mpd/ChangeLog b/extra/mpd/ChangeLog index 40ba5e4e7..b22d95f8d 100644 --- a/extra/mpd/ChangeLog +++ b/extra/mpd/ChangeLog @@ -1,3 +1,6 @@ +2011-12-05 Angel Velasquez <angvp@archlinux.org> + * Version bump to 0.16.6 + 2011-09-03 Angel Velasquez <angvp@archlinux.org> * Version bump to 0.16.4 * Removed the patch mpd-0.16.3_ffmpeg_sigsegv.patch since is included upstream diff --git a/extra/mpd/PKGBUILD b/extra/mpd/PKGBUILD index 4578958de..afe78dfe7 100644 --- a/extra/mpd/PKGBUILD +++ b/extra/mpd/PKGBUILD @@ -1,12 +1,12 @@ -# $Id: PKGBUILD 142638 2011-11-12 17:15:35Z ibiru $ +# $Id: PKGBUILD 144459 2011-12-06 06:52:26Z angvp $ # Maintainer: Angel Velasquez <angvp@archlinux.org> # Contributor: Andrea Scarpino <andrea@archlinux.org> # Contributor: Damir Perisa <damir.perisa@bluewin.ch> # Contributor: Ben <ben@benmazer.net> pkgname=mpd -pkgver=0.16.5 -pkgrel=2 +pkgver=0.16.6 +pkgrel=1 pkgdesc="Music daemon that plays MP3, FLAC, and Ogg Vorbis files" arch=('i686' 'x86_64' 'mips64el') license=('GPL') @@ -19,7 +19,7 @@ install=${pkgname}.install changelog=ChangeLog source=("http://downloads.sourceforge.net/musicpd/$pkgname-$pkgver.tar.bz2" 'mpd') -md5sums=('f7564cff12035f6a1112cce770655df7' +md5sums=('5489dd327fba12c67f01558d2cfa6d57' 'e5669c2bff4031928531e52475addeb1') build() { diff --git a/extra/nicotine/PKGBUILD b/extra/nicotine/PKGBUILD index 2c6f54a83..96cf743d5 100644 --- a/extra/nicotine/PKGBUILD +++ b/extra/nicotine/PKGBUILD @@ -1,15 +1,15 @@ -# $Id: PKGBUILD 108389 2011-01-30 22:14:15Z angvp $ +# $Id: PKGBUILD 144457 2011-12-06 06:35:08Z angvp $ # Maintainer: Angel Velasquez <angvp@archlinux.org> # Contributor: Hugo Doria <hugo@archlinux.org> # Contributor: Andrew Wright <andreww@photism.org> pkgname=nicotine pkgver=1.2.16 -pkgrel=2 +pkgrel=3 pkgdesc="Soulseek music-sharing client, written in python" license=('GPL') arch=('i686' 'x86_64' 'mips64el') -depends=('pygtk>=2.14.1' 'mutagen' 'python-geoip>=1.2.4') +depends=('pygtk>=2.14.1' 'mutagen') conflicts=(nicotine-plus) replaces=(nicotine-plus) url="http://sourceforge.net/projects/nicotine-plus/" @@ -18,6 +18,9 @@ optdepends=('python-sexy: To enable spell checking' 'python-geoip: to enable Geographical blocker') md5sums=('ac7433c21ef619a37e079a7ae68da94a') + + + build() { cd ${srcdir}/${pkgname}+-${pkgver} sed -i -e "s/Icon=nicotine-plus/Icon=nicotine-plus-32px/" files/nicotine.desktop # Fixing FS#22476 @@ -25,6 +28,10 @@ build() { cd trayicon python2 autogen.py make +} + +package() { + cd ${srcdir}/${pkgname}+-${pkgver}/trayicon make DESTDIR=${pkgdir} install ln -s nicotine.py ${pkgdir}/usr/bin/nicotine } diff --git a/extra/polkit/PKGBUILD b/extra/polkit/PKGBUILD index 0fe7ea09b..60db8e35f 100644 --- a/extra/polkit/PKGBUILD +++ b/extra/polkit/PKGBUILD @@ -1,8 +1,8 @@ -# $Id: PKGBUILD 136695 2011-08-31 14:31:56Z jgc $ +# $Id: PKGBUILD 144479 2011-12-06 17:28:58Z ibiru $ # Maintainer: Jan de Groot <jgc@archlinux.org> pkgname=polkit -pkgver=0.102 +pkgver=0.103 pkgrel=1 pkgdesc="Application development toolkit for controlling system-wide privileges" arch=(i686 x86_64 'mips64el') @@ -14,7 +14,7 @@ replaces=('policykit') options=('!libtool') source=(http://hal.freedesktop.org/releases/${pkgname}-${pkgver}.tar.gz polkit.pam) -md5sums=('a3726bdb9728c103e58f62131e26693a' +md5sums=('aaacf2ef18774ea8a825a426a7cfe763' '6564f95878297b954f0572bc1610dd15') build() { diff --git a/extra/purple-plugin-pack/PKGBUILD b/extra/purple-plugin-pack/PKGBUILD index 7a46571da..4eeff18a7 100644 --- a/extra/purple-plugin-pack/PKGBUILD +++ b/extra/purple-plugin-pack/PKGBUILD @@ -1,25 +1,34 @@ -# $Id: PKGBUILD 77562 2010-04-15 22:34:21Z ibiru $ -# Maintainer : Ionut Biru <ibiru@archlinux.org> +# $Id: PKGBUILD 144607 2011-12-08 01:03:26Z foutrelis $ +# Maintainer: Evangelos Foutras <evangelos@foutrelis.com> +# Contributor: Ionut Biru <ibiru@archlinux.org> # Contributor: Alexander Fehr <pizzapunk gmail com> # Contributor: Dale Blount <dale@archlinux.org> pkgname=purple-plugin-pack -pkgver=2.6.3 +pkgver=2.7.0 pkgrel=1 -pkgdesc="Plugin pack for Pidgin" +pkgdesc="Compilation of plugins for the libpurple family of IM clients" arch=('i686' 'x86_64' 'mips64el') -url="http://plugins.guifications.org/trac/wiki/PluginPack" +url="https://www.guifications.org/projects/purple-plugin-pack" license=('GPL') -depends=('pidgin') -makedepends=('intltool' 'python') +depends=('libpurple') +makedepends=('intltool' 'gettext' 'python2' 'pidgin') options=('!libtool') -source=(http://plugins.guifications.org/trac/downloads/48) -md5sums=('2dccee28f087c7e81cef07ee845399bb') +source=(https://www.guifications.org/attachments/download/201/purple-plugin-pack-2.7.0.tar.bz2) +sha256sums=('2bbcf5e778a33968ba7f2864d2a6cb526a8984be3e4151642a583eee8eafb03c') build() { - cd "$srcdir/purple-plugin_pack-$pkgver" + cd "$srcdir/$pkgname-$pkgver" - ./configure --prefix=/usr || return 1 - make || return 1 - make DESTDIR="$pkgdir" install || return 1 + PYTHON=/usr/bin/python2 \ + ./configure --prefix=/usr } + +package() { + cd "$srcdir/$pkgname-$pkgver" + + make + make DESTDIR="$pkgdir" install +} + +# vim:set ts=2 sw=2 et: diff --git a/extra/zsh/PKGBUILD b/extra/zsh/PKGBUILD index 95eed637b..d11a75e9f 100644 --- a/extra/zsh/PKGBUILD +++ b/extra/zsh/PKGBUILD @@ -1,23 +1,23 @@ -# $Id: PKGBUILD 143828 2011-11-29 13:33:59Z stephane $ +# $Id: PKGBUILD 144599 2011-12-07 15:40:43Z pierre $ # Maintainer: Pierre Schmitz <pierre@archlinux.de> pkgname=zsh -pkgver=4.3.12 -pkgrel=3 +pkgver=4.3.14 +pkgrel=2 pkgdesc='A very advanced and programmable command interpreter (shell) for UNIX' arch=('i686' 'x86_64' 'mips64el') url='http://www.zsh.org/' license=('custom') depends=('pcre' 'libcap' 'gdbm') install=zsh.install -source=("ftp://ftp.zsh.org/pub/${pkgname}-${pkgver}.tar.bz2" 'modules.patch') -md5sums=('7a82c0bf0635e046ca4e9ec1bdef3811' - 'b367c1398b60242f7044a93a837227f9') +source=("ftp://ftp.zsh.org/pub/${pkgname}-${pkgver}.tar.bz2" + 'zprofile') +backup=('etc/zsh/zprofile') +md5sums=('1c819a3ff7302b42eba988e333e76109' + '24a9335edf77252a7b5f52e079f7aef7') build() { cd "${srcdir}/${pkgname}-${pkgver}" - # upstream patch to fix handling of compressed kernel modules - patch -p1 -i ${srcdir}/modules.patch # FS#16360 sed -i 's/init.d/rc.d/g' Doc/Zsh/compsys.yo \ Doc/zsh.texi \ @@ -29,7 +29,7 @@ build() { --enable-zshenv=/etc/zsh/zshenv \ --enable-zlogin=/etc/zsh/zlogin \ --enable-zlogout=/etc/zsh/zlogout \ - --enable-zprofile=/etc/profile \ + --enable-zprofile=/etc/zsh/zprofile \ --enable-zshrc=/etc/zsh/zshrc \ --enable-maildir-support \ --with-term-lib='ncursesw' \ @@ -54,5 +54,6 @@ check() { package() { cd "${srcdir}/${pkgname}-${pkgver}" make DESTDIR="${pkgdir}/" install + install -D -m644 "${srcdir}/zprofile" "${pkgdir}/etc/zsh/zprofile" install -D -m644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } diff --git a/extra/zsh/zprofile b/extra/zsh/zprofile new file mode 100644 index 000000000..6bfcdf7cb --- /dev/null +++ b/extra/zsh/zprofile @@ -0,0 +1 @@ +emulate sh -c 'source /etc/profile' diff --git a/multilib/lib32-curl/PKGBUILD b/multilib/lib32-curl/PKGBUILD new file mode 100755 index 000000000..264a41750 --- /dev/null +++ b/multilib/lib32-curl/PKGBUILD @@ -0,0 +1,56 @@ +# $Id: PKGBUILD 60201 2011-12-07 14:41:34Z arodseth $ +# Maintainer: Florian Pritz <flo@xssn.at> + +_pkgbasename=curl +pkgname=lib32-$_pkgbasename +pkgver=7.21.7 +pkgrel=1 +pkgdesc="An URL retrieval utility and library (32-bit)" +arch=('x86_64') +url="http://curl.haxx.se" +license=('MIT') +depends=('lib32-zlib' 'lib32-openssl' 'bash' 'ca-certificates' 'lib32-libssh2' $_pkgbasename) +makedepends=(gcc-multilib) +options=('!libtool') +source=("http://curl.haxx.se/download/${_pkgbasename}-${pkgver}.tar.bz2") +md5sums=('5f6d50c4d4ee38c57fe37e3cff75adbd') + + +build() { + export CC="gcc -m32" + export CXX="g++ -m32" + export PKG_CONFIG_PATH="/usr/lib32/pkgconfig" + + cd ${srcdir}/${_pkgbasename}-${pkgver} + + ./configure \ + --with-random=/dev/urandom \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --disable-dependency-tracking \ + --enable-ipv6 \ + --disable-ldaps \ + --disable-ldap \ + --disable-manual \ + --enable-versioned-symbols \ + --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \ + --without-libidn \ + --libdir=/usr/lib32 \ + --enable-threaded-resolver + make +} + +package() { + cd ${srcdir}/${_pkgbasename}-${pkgver} + + make DESTDIR=${pkgdir} install + + rm -rf "${pkgdir}"/usr/{share,bin} + #we need curlbuild.h + find ${pkgdir}/usr/include/curl -type f -not -name curlbuild.h -delete + #now save it as curlbuild-32.h + mv ${pkgdir}/usr/include/curl/curlbuild.h ${pkgdir}/usr/include/curl/curlbuild-32.h + + mkdir -p "$pkgdir/usr/share/licenses" + ln -s $_pkgbasename "$pkgdir/usr/share/licenses/$pkgname" +} diff --git a/multilib/lib32-glib2/PKGBUILD b/multilib/lib32-glib2/PKGBUILD new file mode 100644 index 000000000..b041355be --- /dev/null +++ b/multilib/lib32-glib2/PKGBUILD @@ -0,0 +1,40 @@ +# $Id: PKGBUILD 60174 2011-12-06 15:20:01Z bluewind $ +# Maintainer: Ionut Biru <ibiru@archlinux.org> +# Contributor: Pierre Schmitz <pierre@archlinux.de> +# Contributor: Mikko Seppälä <t-r-a-y@mbnet.fi> + +_pkgbasename=glib2 +pkgname=lib32-$_pkgbasename +pkgver=2.30.2 +pkgrel=1 +pkgdesc="Common C routines used by GTK+ 2.4 and other libs (32-bit)" +url="http://www.gtk.org/" +arch=('x86_64') +license=('LGPL') +depends=('lib32-pcre' 'lib32-zlib' 'lib32-dbus-core' lib32-libffi $_pkgbasename) +makedepends=('gcc-multilib' python2) +options=('!libtool' '!docs') +source=(http://ftp.gnome.org/pub/GNOME/sources/glib/2.30/glib-${pkgver}.tar.xz) +sha256sums=('f0e91e6333321ddb48fa12b5c66f56c3d5f05325748c66dd2e9016c278ff8e82') + +build() { + export CC="gcc -m32" + export CXX="g++ -m32" + export PKG_CONFIG_PATH="/usr/lib32/pkgconfig" + + cd "${srcdir}/glib-${pkgver}" + PYTHON=/usr/bin/python2 ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib32 \ + --enable-static --enable-shared --with-pcre=system --disable-fam + make +} + +package() { + cd "${srcdir}/glib-${pkgver}" + make DESTDIR="${pkgdir}" install + rm -rf "${pkgdir}"/{etc,usr/{share,include}} + + cd "${pkgdir}"/usr/bin + mv gio-querymodules gio-querymodules-32 + rm -f gdbus glib* gobject-query gsettings gtester* + rm -rf "$pkgdir"/usr/{bin/gdbus-codegen,lib32/gdbus-2.0} +} diff --git a/testing/krb5/PKGBUILD b/testing/krb5/PKGBUILD new file mode 100644 index 000000000..9cbe8c3d7 --- /dev/null +++ b/testing/krb5/PKGBUILD @@ -0,0 +1,90 @@ +# $Id: PKGBUILD 144605 2011-12-07 21:28:52Z stephane $ +# Maintainer: Stéphane Gaudreault <stephane@archlinux.org> + +pkgname=krb5 +pkgver=1.9.2 +pkgrel=2 +pkgdesc="The Kerberos network authentication system" +arch=('i686' 'x86_64') +url="http://web.mit.edu/kerberos/" +license=('custom') +depends=('e2fsprogs' 'libldap' 'keyutils') +makedepends=('perl') +provides=('heimdal') +replaces=('heimdal') +conflicts=('heimdal') +backup=('etc/krb5.conf' 'var/lib/krb5kdc/kdc.conf') +source=(http://web.mit.edu/kerberos/dist/${pkgname}/1.9/${pkgname}-${pkgver}-signed.tar + krb5-kadmind + krb5-kdc + krb5-kpropd + krb5-1.9.1-config-script.patch + krb5-1.9.1-2011-007.patch) +sha1sums=('aa06f778ee1f9791cd4c5cf4c9e9465769ffec92' + '2aa229369079ed1bbb201a1ef72c47bf143f4dbe' + '77d2312ecd8bf12a6e72cc8fd871a8ac93b23393' + '7f402078fa65bb9ff1beb6cbbbb017450df78560' + '7342410760cf44bfa01bb99bb4c49e12496cb46f' + 'ec917dd1d1c96fa331f512331d5aa37c2e9b9df7') +options=('!emptydirs') + +build() { + tar zxvf ${pkgname}-${pkgver}.tar.gz + cd "${srcdir}/${pkgname}-${pkgver}/src" + + # - Make krb5-config suppress CFLAGS output when called with --libs + # cf https://bugzilla.redhat.com/show_bug.cgi?id=544391 + # + # - Omit extra libraries because their interfaces are not exposed to applications + # by libkrb5, unless do_deps is set to 1, which indicates that the caller + # wants the whole list. + # + # Patch from upstream : + # http://anonsvn.mit.edu/viewvc/krb5/trunk/src/krb5-config.in?r1=23662&r2=25236 + patch -Np2 -i ${srcdir}/krb5-1.9.1-config-script.patch + + # Apply upstream patch to fix a null pointer dereference when processing TGS requests + # CVE-2011-1530 + # see http://web.mit.edu/kerberos/advisories/MITKRB5-SA-2011-007.txt + patch -Np2 -i ${srcdir}/krb5-1.9.1-2011-007.patch + + # FS#25384 + sed -i "/KRB5ROOT=/s/\/local//" util/ac_check_krb5.m4 + + export CFLAGS+=" -fPIC -fno-strict-aliasing -fstack-protector-all" + export CPPFLAGS+=" -I/usr/include/et" + ./configure --prefix=/usr \ + --mandir=/usr/share/man \ + --localstatedir=/var/lib \ + --enable-shared \ + --with-system-et \ + --with-system-ss \ + --disable-rpath \ + --without-tcl \ + --enable-dns-for-realm \ + --with-ldap + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}/src" + make DESTDIR="${pkgdir}" EXAMPLEDIR="/usr/share/doc/${pkgname}/examples" install + + # Sample KDC config file + install -dm 755 "${pkgdir}"/var/lib/krb5kdc + install -pm 644 config-files/kdc.conf "${pkgdir}"/var/lib/krb5kdc/kdc.conf + + # Default configuration file + install -dm 755 "${pkgdir}"/etc + install -pm 644 config-files/krb5.conf "${pkgdir}"/etc/krb5.conf + + install -dm 755 "${pkgdir}"/etc/rc.d + install -m 755 ../../krb5-kdc "${pkgdir}"/etc/rc.d + install -m 755 ../../krb5-kadmind "${pkgdir}"/etc/rc.d + install -m 755 ../../krb5-kpropd "${pkgdir}"/etc/rc.d + + install -dm 755 "${pkgdir}"/usr/share/aclocal + install -m 644 util/ac_check_krb5.m4 "${pkgdir}"/usr/share/aclocal + + install -Dm644 "${srcdir}"/${pkgname}-${pkgver}/NOTICE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE +} diff --git a/testing/krb5/krb5-1.9.1-2011-007.patch b/testing/krb5/krb5-1.9.1-2011-007.patch new file mode 100644 index 000000000..336a4ad31 --- /dev/null +++ b/testing/krb5/krb5-1.9.1-2011-007.patch @@ -0,0 +1,40 @@ +diff --git a/src/kdc/Makefile.in b/src/kdc/Makefile.in +index f46cad3..102fbaa 100644 +--- a/src/kdc/Makefile.in ++++ b/src/kdc/Makefile.in +@@ -67,6 +67,7 @@ check-unix:: rtest + + check-pytests:: + $(RUNPYTEST) $(srcdir)/t_workers.py $(PYTESTFLAGS) ++ $(RUNPYTEST) $(srcdir)/t_emptytgt.py $(PYTESTFLAGS) + + install:: + $(INSTALL_PROGRAM) krb5kdc ${DESTDIR}$(SERVER_BINDIR)/krb5kdc +diff --git a/src/kdc/do_tgs_req.c b/src/kdc/do_tgs_req.c +index c169c54..840a2ef 100644 +--- a/src/kdc/do_tgs_req.c ++++ b/src/kdc/do_tgs_req.c +@@ -243,7 +243,8 @@ tgt_again: + if (!tgs_1 || !data_eq(*server_1, *tgs_1)) { + errcode = find_alternate_tgs(request, &server); + firstpass = 0; +- goto tgt_again; ++ if (errcode == 0) ++ goto tgt_again; + } + } + status = "UNKNOWN_SERVER"; +diff --git a/src/kdc/t_emptytgt.py b/src/kdc/t_emptytgt.py +new file mode 100644 +index 0000000..1760bcd +--- /dev/null ++++ b/src/kdc/t_emptytgt.py +@@ -0,0 +1,8 @@ ++#!/usr/bin/python ++from k5test import * ++ ++realm = K5Realm(start_kadmind=False, create_host=False) ++output = realm.run_as_client([kvno, 'krbtgt/'], expected_code=1) ++if 'not found in Kerberos database' not in output: ++ fail('TGT lookup for empty realm failed in unexpected way') ++success('Empty tgt lookup.') diff --git a/testing/krb5/krb5-1.9.1-canonicalize-fallback.patch b/testing/krb5/krb5-1.9.1-canonicalize-fallback.patch new file mode 100644 index 000000000..e5a38498f --- /dev/null +++ b/testing/krb5/krb5-1.9.1-canonicalize-fallback.patch @@ -0,0 +1,58 @@ +diff -Naur krb5-1.9.1.ori/src/lib/krb5/krb/get_creds.c krb5-1.9.1/src/lib/krb5/krb/get_creds.c +--- krb5-1.9.1.ori/src/lib/krb5/krb/get_creds.c 2011-02-09 16:55:36.000000000 -0500 ++++ krb5-1.9.1/src/lib/krb5/krb/get_creds.c 2011-09-26 18:42:01.465190278 -0400 +@@ -470,13 +470,10 @@ + + /***** STATE_REFERRALS *****/ + +-/* +- * Possibly retry a request in the fallback realm after a referral request +- * failure in the local realm. Expects ctx->reply_code to be set to the error +- * from a referral request. +- */ ++/* Possibly try a non-referral request after a referral request failure. ++ * Expects ctx->reply_code to be set to the error from a referral request. */ + static krb5_error_code +-try_fallback_realm(krb5_context context, krb5_tkt_creds_context ctx) ++try_fallback(krb5_context context, krb5_tkt_creds_context ctx) + { + krb5_error_code code; + char **hrealms; +@@ -485,9 +482,10 @@ + if (ctx->referral_count > 1) + return ctx->reply_code; + +- /* Only fall back if the original request used the referral realm. */ ++ /* If the request used a specified realm, make a non-referral request to ++ * that realm (in case it's a KDC which rejects KDC_OPT_CANONICALIZE). */ + if (!krb5_is_referral_realm(&ctx->req_server->realm)) +- return ctx->reply_code; ++ return begin_non_referral(context, ctx); + + if (ctx->server->length < 2) { + /* We need a type/host format principal to find a fallback realm. */ +@@ -500,10 +498,10 @@ + if (code != 0) + return code; + +- /* Give up if the fallback realm isn't any different. */ ++ /* If the fallback realm isn't any different, use the existing TGT. */ + if (data_eq_string(ctx->server->realm, hrealms[0])) { + krb5_free_host_realm(context, hrealms); +- return ctx->reply_code; ++ return begin_non_referral(context, ctx); + } + + /* Rewrite server->realm to be the fallback realm. */ +@@ -540,9 +538,9 @@ + krb5_error_code code; + const krb5_data *referral_realm; + +- /* Possibly retry with the fallback realm on error. */ ++ /* Possibly try a non-referral fallback request on error. */ + if (ctx->reply_code != 0) +- return try_fallback_realm(context, ctx); ++ return try_fallback(context, ctx); + + if (krb5_principal_compare(context, ctx->reply_creds->server, + ctx->server)) { diff --git a/testing/krb5/krb5-1.9.1-config-script.patch b/testing/krb5/krb5-1.9.1-config-script.patch new file mode 100644 index 000000000..a72a75edf --- /dev/null +++ b/testing/krb5/krb5-1.9.1-config-script.patch @@ -0,0 +1,27 @@ +diff -Naur krb5-1.9.1.ori/src/krb5-config.in krb5-1.9.1/src/krb5-config.in +--- krb5-1.9.1.ori/src/krb5-config.in 2010-01-19 13:44:57.000000000 -0500 ++++ krb5-1.9.1/src/krb5-config.in 2011-09-26 18:27:09.018487087 -0400 +@@ -186,7 +186,7 @@ + -e 's#\$(RPATH_FLAG)#'"$RPATH_FLAG"'#' \ + -e 's#\$(LDFLAGS)#'"$LDFLAGS"'#' \ + -e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \ +- -e 's#\$(CFLAGS)#'"$CFLAGS"'#'` ++ -e 's#\$(CFLAGS)##'` + + if test $library = 'kdb'; then + lib_flags="$lib_flags -lkdb5 $KDB5_DB_LIB" +@@ -214,9 +214,13 @@ + fi + + if test $library = 'krb5'; then +- lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err $GEN_LIB $LIBS $DL_LIB" ++ lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err" + fi + ++ # If we ever support a flag to generate output suitable for static ++ # linking, we would output "-lkrb5support $GEN_LIB $LIBS $DL_LIB" ++ # here. ++ + echo $lib_flags + fi + diff --git a/testing/krb5/krb5-kadmind b/testing/krb5/krb5-kadmind new file mode 100644 index 000000000..04df0dcff --- /dev/null +++ b/testing/krb5/krb5-kadmind @@ -0,0 +1,40 @@ +#!/bin/bash + +# general config +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/sbin/kadmind` +case "$1" in + start) + stat_busy "Starting Kerberos Admin Daemon" + if [ -z "$PID" ]; then + /usr/sbin/kadmind + fi + if [ ! -z "$PID" -o $? -gt 0 ]; then + stat_fail + else + add_daemon krb5-kadmind + stat_done + fi + ;; + stop) + stat_busy "Stopping Kerberos Admin Daemon" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon krb5-kadmind + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" + ;; +esac +exit 0 diff --git a/testing/krb5/krb5-kdc b/testing/krb5/krb5-kdc new file mode 100644 index 000000000..05a03411e --- /dev/null +++ b/testing/krb5/krb5-kdc @@ -0,0 +1,40 @@ +#!/bin/bash + +# general config +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/sbin/krb5kdc` +case "$1" in + start) + stat_busy "Starting Kerberos Authentication" + if [ -z "$PID" ]; then + /usr/sbin/krb5kdc + fi + if [ ! -z "$PID" -o $? -gt 0 ]; then + stat_fail + else + add_daemon krb5-kdc + stat_done + fi + ;; + stop) + stat_busy "Stopping Kerberos Authentication" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon krb5-kdc + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" + ;; +esac +exit 0 diff --git a/testing/krb5/krb5-kpropd b/testing/krb5/krb5-kpropd new file mode 100644 index 000000000..a0077d68e --- /dev/null +++ b/testing/krb5/krb5-kpropd @@ -0,0 +1,40 @@ +#!/bin/bash + +# general config +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/sbin/kpropd` +case "$1" in + start) + stat_busy "Starting Kerberos Database Propagation Daemon" + if [ -z "$PID" ]; then + /usr/sbin/kpropd -S + fi + if [ ! -z "$PID" -o $? -gt 0 ]; then + stat_fail + else + add_daemon kpropd + stat_done + fi + ;; + stop) + stat_busy "Stopping Kerberos Database Propagation Daemon" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon kpropd + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" + ;; +esac +exit 0 diff --git a/testing/libdrm/COPYING b/testing/libdrm/COPYING new file mode 100644 index 000000000..6e74c337c --- /dev/null +++ b/testing/libdrm/COPYING @@ -0,0 +1,48 @@ + Copyright 2005 Adam Jackson. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation on the rights to use, copy, modify, merge, + publish, distribute, sub license, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice (including the + next paragraph) shall be included in all copies or substantial + portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NON-INFRINGEMENT. IN NO EVENT SHALL ADAM JACKSON BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------ + + Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. + Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. + All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice (including the + next paragraph) shall be included in all copies or substantial + portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS + SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. diff --git a/testing/libdrm/PKGBUILD b/testing/libdrm/PKGBUILD new file mode 100644 index 000000000..91583d99a --- /dev/null +++ b/testing/libdrm/PKGBUILD @@ -0,0 +1,56 @@ +# $Id: PKGBUILD 144601 2011-12-07 17:32:22Z andyrtr $ +# Maintainer: Jan de Groot <jgc@archlinux.org> + +pkgname=libdrm +pkgver=2.4.28 +pkgrel=1 +pkgdesc="Userspace interface to kernel DRM services" +arch=(i686 x86_64) +license=('custom') +depends=('glibc' 'libpciaccess') +makedepends=('cairo') +options=('!libtool') +url="http://dri.freedesktop.org/" +source=(http://dri.freedesktop.org/${pkgname}/${pkgname}-${pkgver}.tar.bz2 + no-pthread-stubs.patch + COPYING + git_fixes.diff + #missing files from http://cgit.freedesktop.org/mesa/drm/snapshot/drm-902ee661f1864aaf8325621085f6a1b5a6a3673a.tar.bz2 - https://bugs.freedesktop.org/show_bug.cgi?id=43538 + rbo.h list.h) +md5sums=('6488f64119c6439fa4038e9cd7b30b67' + 'c722c8406507b7e3a8da7a3030d1d9cf' + 'ba65e71c481b94ef0fb6c23c7f21ffa1' + '671b87f9670e709e54a19cd292c6330d' + '073846ea43fb4d6130062c1897d92e40' + 'ce867d3331862c2b87d1a37461b42dbe') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + patch -Np1 -i "${srcdir}/no-pthread-stubs.patch" + + # add a missing file in the release tarball + patch -Np1 -i ${srcdir}/git_fixes.diff + cp ${srcdir}/{rbo,list}.h "${srcdir}/${pkgname}-${pkgver}"/tests/radeon/ + + #libtoolize --force + autoreconf --force --install + ./configure --prefix=/usr \ + --enable-udev \ + --enable-intel \ + --enable-radeon \ + --enable-vmwgfx-experimental-api \ + --enable-nouveau-experimental-api + make +} + +check() { + cd "${srcdir}/${pkgname}-${pkgver}" + make -k check +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install + install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}" + install -m644 "${srcdir}/COPYING" "${pkgdir}/usr/share/licenses/${pkgname}/" +} diff --git a/testing/libdrm/git_fixes.diff b/testing/libdrm/git_fixes.diff new file mode 100644 index 000000000..5ebcb606a --- /dev/null +++ b/testing/libdrm/git_fixes.diff @@ -0,0 +1,19 @@ +From 902ee661f1864aaf8325621085f6a1b5a6a3673a Mon Sep 17 00:00:00 2001 +From: Dave Airlie <airlied@redhat.com> +Date: Mon, 05 Dec 2011 21:24:48 +0000 +Subject: test/radeon: add missing files for dist + +--- +diff --git a/tests/radeon/Makefile.am b/tests/radeon/Makefile.am +index 021ca72..1775669 100644 +--- a/tests/radeon/Makefile.am ++++ b/tests/radeon/Makefile.am +@@ -9,4 +9,6 @@ noinst_PROGRAMS = \ + + radeon_ttm_SOURCES = \ + rbo.c \ ++ rbo.h \ ++ list.h \ + radeon_ttm.c +-- +cgit v0.9.0.2-2-gbebe diff --git a/testing/libdrm/list.h b/testing/libdrm/list.h new file mode 100644 index 000000000..305c903e1 --- /dev/null +++ b/testing/libdrm/list.h @@ -0,0 +1,137 @@ +/* + * + * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND. USA. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + */ + +/** + * \file + * List macros heavily inspired by the Linux kernel + * list handling. No list looping yet. + * + * Is not threadsafe, so common operations need to + * be protected using an external mutex. + */ +#ifndef _U_DOUBLE_LIST_H_ +#define _U_DOUBLE_LIST_H_ + +#include <stddef.h> + +struct list_head +{ + struct list_head *prev; + struct list_head *next; +}; + +static void list_inithead(struct list_head *item) +{ + item->prev = item; + item->next = item; +} + +static void list_add(struct list_head *item, struct list_head *list) +{ + item->prev = list; + item->next = list->next; + list->next->prev = item; + list->next = item; +} + +static void list_addtail(struct list_head *item, struct list_head *list) +{ + item->next = list; + item->prev = list->prev; + list->prev->next = item; + list->prev = item; +} + +static void list_replace(struct list_head *from, struct list_head *to) +{ + to->prev = from->prev; + to->next = from->next; + from->next->prev = to; + from->prev->next = to; +} + +static void list_del(struct list_head *item) +{ + item->prev->next = item->next; + item->next->prev = item->prev; +} + +static void list_delinit(struct list_head *item) +{ + item->prev->next = item->next; + item->next->prev = item->prev; + item->next = item; + item->prev = item; +} + +#define LIST_INITHEAD(__item) list_inithead(__item) +#define LIST_ADD(__item, __list) list_add(__item, __list) +#define LIST_ADDTAIL(__item, __list) list_addtail(__item, __list) +#define LIST_REPLACE(__from, __to) list_replace(__from, __to) +#define LIST_DEL(__item) list_del(__item) +#define LIST_DELINIT(__item) list_delinit(__item) + +#define LIST_ENTRY(__type, __item, __field) \ + ((__type *)(((char *)(__item)) - offsetof(__type, __field))) + +#define LIST_IS_EMPTY(__list) \ + ((__list)->next == (__list)) + +#ifndef container_of +#define container_of(ptr, sample, member) \ + (void *)((char *)(ptr) \ + - ((char *)&(sample)->member - (char *)(sample))) +#endif + +#define LIST_FOR_EACH_ENTRY(pos, head, member) \ + for (pos = container_of((head)->next, pos, member); \ + &pos->member != (head); \ + pos = container_of(pos->member.next, pos, member)) + +#define LIST_FOR_EACH_ENTRY_SAFE(pos, storage, head, member) \ + for (pos = container_of((head)->next, pos, member), \ + storage = container_of(pos->member.next, pos, member); \ + &pos->member != (head); \ + pos = storage, storage = container_of(storage->member.next, storage, member)) + +#define LIST_FOR_EACH_ENTRY_SAFE_REV(pos, storage, head, member) \ + for (pos = container_of((head)->prev, pos, member), \ + storage = container_of(pos->member.prev, pos, member); \ + &pos->member != (head); \ + pos = storage, storage = container_of(storage->member.prev, storage, member)) + +#define LIST_FOR_EACH_ENTRY_FROM(pos, start, head, member) \ + for (pos = container_of((start), pos, member); \ + &pos->member != (head); \ + pos = container_of(pos->member.next, pos, member)) + +#define LIST_FOR_EACH_ENTRY_FROM_REV(pos, start, head, member) \ + for (pos = container_of((start), pos, member); \ + &pos->member != (head); \ + pos = container_of(pos->member.prev, pos, member)) + +#endif /*_U_DOUBLE_LIST_H_*/ diff --git a/testing/libdrm/no-pthread-stubs.patch b/testing/libdrm/no-pthread-stubs.patch new file mode 100644 index 000000000..348c2a795 --- /dev/null +++ b/testing/libdrm/no-pthread-stubs.patch @@ -0,0 +1,66 @@ +diff -ru libdrm-2.4.0/configure.ac libdrm-2.4.0-nostubs/configure.ac +--- libdrm-2.4.0/configure.ac 2008-10-09 21:57:09.000000000 +0200 ++++ libdrm-2.4.0-nostubs/configure.ac 2008-10-21 10:48:24.000000000 +0200 +@@ -47,10 +47,6 @@ + LT_INIT([disable-static]) + + +-PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs) +-AC_SUBST(PTHREADSTUBS_CFLAGS) +-AC_SUBST(PTHREADSTUBS_LIBS) +- + PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) + AC_SUBST(PCIACCESS_CFLAGS) + AC_SUBST(PCIACCESS_LIBS) +--- libdrm-2.4.16/intel/Makefile.am 2009-11-20 23:54:36.000000000 +0000 ++++ libdrm-2.4.16/intel/Makefile.am.new 2009-12-07 08:11:32.235748069 +0000 +@@ -26,14 +26,13 @@ + $(WARN_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/intel \ +- $(PTHREADSTUBS_CFLAGS) \ + $(PCIACCESS_CFLAGS) \ + -I$(top_srcdir)/include/drm + + libdrm_intel_la_LTLIBRARIES = libdrm_intel.la + libdrm_intel_ladir = $(libdir) + libdrm_intel_la_LDFLAGS = -version-number 1:0:0 -no-undefined +-libdrm_intel_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ @PCIACCESS_LIBS@ @CLOCK_LIB@ ++libdrm_intel_la_LIBADD = ../libdrm.la @PCIACCESS_LIBS@ @CLOCK_LIB@ + + libdrm_intel_la_SOURCES = \ + intel_bufmgr.c \ +--- libdrm-2.4.16/radeon/Makefile.am 2009-11-20 23:54:36.000000000 +0000 ++++ libdrm-2.4.16/radeon/Makefile.am.new 2009-12-07 08:12:31.889075388 +0000 +@@ -26,13 +26,12 @@ + $(WARN_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/radeon \ +- $(PTHREADSTUBS_CFLAGS) \ + -I$(top_srcdir)/include/drm + + libdrm_radeon_la_LTLIBRARIES = libdrm_radeon.la + libdrm_radeon_ladir = $(libdir) + libdrm_radeon_la_LDFLAGS = -version-number 1:0:0 -no-undefined +-libdrm_radeon_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ ++libdrm_radeon_la_LIBADD = ../libdrm.la + + libdrm_radeon_la_SOURCES = \ + radeon_bo_gem.c \ +--- libdrm-2.4.16/nouveau/Makefile.am 2009-11-20 23:54:36.000000000 +0000 ++++ libdrm-2.4.16/nouveau/Makefile.am.new 2009-12-07 08:13:01.489072320 +0000 +@@ -2,13 +2,12 @@ + $(WARN_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/nouveau \ +- $(PTHREADSTUBS_CFLAGS) \ + -I$(top_srcdir)/include/drm + + libdrm_nouveau_la_LTLIBRARIES = libdrm_nouveau.la + libdrm_nouveau_ladir = $(libdir) + libdrm_nouveau_la_LDFLAGS = -version-number 1:0:0 -no-undefined +-libdrm_nouveau_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ ++libdrm_nouveau_la_LIBADD = ../libdrm.la + + libdrm_nouveau_la_SOURCES = \ + nouveau_device.c \ diff --git a/testing/libdrm/rbo.h b/testing/libdrm/rbo.h new file mode 100644 index 000000000..c25c73a4c --- /dev/null +++ b/testing/libdrm/rbo.h @@ -0,0 +1,50 @@ +/* + * Copyright © 2011 Red Hat + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Jerome Glisse <j.glisse@gmail.com> + */ +#ifndef RBO_H +#define RBO_H + +#include "list.h" + +struct rbo { + struct list_head list; + int fd; + unsigned refcount; + unsigned mapcount; + unsigned handle; + unsigned size; + unsigned alignment; + void *data; +}; + +struct rbo *rbo(int fd, unsigned handle, unsigned size, + unsigned alignment, void *ptr); +int rbo_map(struct rbo *bo); +void rbo_unmap(struct rbo *bo); +struct rbo *rbo_incref(struct rbo *bo); +struct rbo *rbo_decref(struct rbo *bo); +int rbo_wait(struct rbo *bo); + +#endif diff --git a/testing/subversion/PKGBUILD b/testing/subversion/PKGBUILD new file mode 100644 index 000000000..9d587905d --- /dev/null +++ b/testing/subversion/PKGBUILD @@ -0,0 +1,79 @@ +# $Id: PKGBUILD 144461 2011-12-06 07:12:44Z eric $ +# Maintainer: Paul Mattal <paul@archlinux.org> +# Contributor: Jason Chu <jason@archlinux.org> + +pkgname=subversion +pkgver=1.7.2 +pkgrel=1 +pkgdesc="A Modern Concurrent Version Control System" +arch=('i686' 'x86_64') +license=('APACHE') +depends=('neon' 'apr-util' 'sqlite3' 'file') +optdepends=('libgnome-keyring' 'kdeutils-kwallet' 'bash-completion: for svn bash completion' \ + 'python2: for some hook scripts' 'ruby: for some hook scripts') +makedepends=('krb5' 'apache' 'python2' 'perl' 'swig' 'java-runtime' 'java-environment' + 'autoconf' 'db' 'e2fsprogs' 'libgnome-keyring' 'kdelibs') +backup=('etc/xinetd.d/svn' 'etc/conf.d/svnserve') +url="http://subversion.apache.org/" +provides=('svn') +options=('!makeflags' '!libtool') +source=(http://apache.mirror.rafal.ca/subversion/$pkgname-$pkgver.tar.bz2{,.asc} + svnserve svn svnserve.conf svnmerge.py + subversion.rpath.fix.patch) +sha1sums=('8c0824aeb7f42da1ff4f7cd296877af7f59812bb' + '66293923ddc1b12a43b0e86f6b6a3c23b70df6ae' + '64ba3e6ebafc08ac62f59d788f7a825fdce69573' + '73b36c046c09cec2093354911c89e3ba8056af6c' + 'ad117bf3b2a838a9a678a93fd8db1a066ad46c41' + 'd240228e5755495c26e89d7ef47a75fb097dd040' + '3d1e28408a9abb42af2e531adc0d01ce21acfad6') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + export PYTHON=/usr/bin/python2 + + patch -p0 -i ../subversion.rpath.fix.patch + sed -i 's|/usr/bin/env python|/usr/bin/env python2|' tools/hook-scripts/{,mailer/{,tests/}}*.py + + ./configure --prefix=/usr --with-apr=/usr --with-apr-util=/usr \ + --with-zlib=/usr --with-neon=/usr --with-apxs \ + --with-sqlite=/usr --with-berkeley-db=:/usr/include/:/usr/lib:db-5.2 \ + --enable-javahl --with-gnome-keyring --with-kwallet + + make external-all + make LT_LDFLAGS="-L$Fdestdir/usr/lib" local-all + make swig_pydir=/usr/lib/python2.7/site-packages/libsvn \ + swig_pydir_extra=/usr/lib/python2.7/site-packages/svn swig-py swig-pl javahl # swig-rb +} + +#check() { +# cd "${srcdir}/${pkgname}-${pkgver}" +# export LANG=C LC_ALL=C +# make check check-swig-pl check-swig-py check-javahl CLEANUP=yes # check-swig-rb +#} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + + export LD_LIBRARY_PATH="${pkgdir}"/usr/lib:$LD_LIBRARY_PATH + make DESTDIR="${pkgdir}" INSTALLDIRS=vendor \ + swig_pydir=/usr/lib/python2.7/site-packages/libsvn \ + swig_pydir_extra=/usr/lib/python2.7/site-packages/svn \ + install install-swig-py install-swig-pl install-javahl # install-swig-rb + + install -d "${pkgdir}"/usr/share/subversion + cp -a tools/hook-scripts "${pkgdir}"/usr/share/subversion/ + rm -f "${pkgdir}"/usr/share/subversion/hook-scripts/*.in + + rm -f "${pkgdir}"/usr/lib/perl5/vendor_perl/auto/SVN/_Core/.packlist + rm -rf "${pkgdir}"/usr/lib/perl5/core_perl + + install -D -m 755 "${srcdir}"/svnserve "${pkgdir}"/etc/rc.d/svnserve + install -D -m 644 "${srcdir}"/svn "${pkgdir}"/etc/xinetd.d/svn + install -D -m 644 "${srcdir}"/svnserve.conf "${pkgdir}"/etc/conf.d/svnserve + install -m 755 "${srcdir}"/svnmerge.py "${pkgdir}"/usr/bin/svnmerge + + # bash completion + install -Dm 644 tools/client-side/bash_completion \ + "${pkgdir}"/etc/bash_completion.d/subversion +} diff --git a/testing/subversion/subversion.rpath.fix.patch b/testing/subversion/subversion.rpath.fix.patch new file mode 100644 index 000000000..ba6ee9e4e --- /dev/null +++ b/testing/subversion/subversion.rpath.fix.patch @@ -0,0 +1,10 @@ +--- Makefile.in.orig 2009-02-16 14:10:48.000000000 -0200 ++++ Makefile.in 2009-06-04 00:56:29.000000000 -0300 +@@ -678,6 +678,7 @@ + + $(SWIG_PL_DIR)/native/Makefile: $(SWIG_PL_DIR)/native/Makefile.PL + cd $(SWIG_PL_DIR)/native; $(PERL) Makefile.PL ++ cd $(SWIG_PL_DIR)/native; sed -i 's|LD_RUN_PATH|DIE_RPATH_DIE|g' Makefile{,.{client,delta,fs,ra,repos,wc}} + + swig-pl_DEPS = autogen-swig-pl libsvn_swig_perl \ + $(SWIG_PL_DIR)/native/Makefile diff --git a/testing/subversion/svn b/testing/subversion/svn new file mode 100644 index 000000000..8988aaf63 --- /dev/null +++ b/testing/subversion/svn @@ -0,0 +1,11 @@ +service svn +{ + flags = REUSE + socket_type = stream + wait = no + user = root + server = /usr/bin/svnserve + server_args = -i + log_on_failure += USERID + disable = yes +} diff --git a/testing/subversion/svnmerge.py b/testing/subversion/svnmerge.py new file mode 100644 index 000000000..d8931648f --- /dev/null +++ b/testing/subversion/svnmerge.py @@ -0,0 +1,2370 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- +# Copyright (c) 2005, Giovanni Bajo +# Copyright (c) 2004-2005, Awarix, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +# +# Author: Archie Cobbs <archie at awarix dot com> +# Rewritten in Python by: Giovanni Bajo <rasky at develer dot com> +# +# Acknowledgments: +# John Belmonte <john at neggie dot net> - metadata and usability +# improvements +# Blair Zajac <blair at orcaware dot com> - random improvements +# Raman Gupta <rocketraman at fastmail dot fm> - bidirectional and transitive +# merging support +# Dustin J. Mitchell <dustin at zmanda dot com> - support for multiple +# location identifier formats +# +# $HeadURL$ +# $LastChangedDate$ +# $LastChangedBy$ +# $LastChangedRevision$ +# +# Requisites: +# svnmerge.py has been tested with all SVN major versions since 1.1 (both +# client and server). It is unknown if it works with previous versions. +# +# Differences from svnmerge.sh: +# - More portable: tested as working in FreeBSD and OS/2. +# - Add double-verbose mode, which shows every svn command executed (-v -v). +# - "svnmerge avail" now only shows commits in source, not also commits in +# other parts of the repository. +# - Add "svnmerge block" to flag some revisions as blocked, so that +# they will not show up anymore in the available list. Added also +# the complementary "svnmerge unblock". +# - "svnmerge avail" has grown two new options: +# -B to display a list of the blocked revisions +# -A to display both the blocked and the available revisions. +# - Improved generated commit message to make it machine parsable even when +# merging commits which are themselves merges. +# - Add --force option to skip working copy check +# - Add --record-only option to "svnmerge merge" to avoid performing +# an actual merge, yet record that a merge happened. +# - Can use a variety of location-identifier formats +# +# TODO: +# - Add "svnmerge avail -R": show logs in reverse order +# +# Information for Hackers: +# +# Identifiers for branches: +# A branch is identified in three ways within this source: +# - as a working copy (variable name usually includes 'dir') +# - as a fully qualified URL +# - as a path identifier (an opaque string indicating a particular path +# in a particular repository; variable name includes 'pathid') +# A "target" is generally user-specified, and may be a working copy or +# a URL. + +import sys, os, getopt, re, types, tempfile, time, locale +from bisect import bisect +from xml.dom import pulldom + +NAME = "svnmerge" +if not hasattr(sys, "version_info") or sys.version_info < (2, 0): + error("requires Python 2.0 or newer") + +# Set up the separator used to separate individual log messages from +# each revision merged into the target location. Also, create a +# regular expression that will find this same separator in already +# committed log messages, so that the separator used for this run of +# svnmerge.py will have one more LOG_SEPARATOR appended to the longest +# separator found in all the commits. +LOG_SEPARATOR = 8 * '.' +LOG_SEPARATOR_RE = re.compile('^((%s)+)' % re.escape(LOG_SEPARATOR), + re.MULTILINE) + +# Each line of the embedded log messages will be prefixed by LOG_LINE_PREFIX. +LOG_LINE_PREFIX = 2 * ' ' + +# Set python to the default locale as per environment settings, same as svn +# TODO we should really parse config and if log-encoding is specified, set +# the locale to match that encoding +locale.setlocale(locale.LC_ALL, '') + +# We want the svn output (such as svn info) to be non-localized +# Using LC_MESSAGES should not affect localized output of svn log, for example +if os.environ.has_key("LC_ALL"): + del os.environ["LC_ALL"] +os.environ["LC_MESSAGES"] = "C" + +############################################################################### +# Support for older Python versions +############################################################################### + +# True/False constants are Python 2.2+ +try: + True, False +except NameError: + True, False = 1, 0 + +def lstrip(s, ch): + """Replacement for str.lstrip (support for arbitrary chars to strip was + added in Python 2.2.2).""" + i = 0 + try: + while s[i] == ch: + i = i+1 + return s[i:] + except IndexError: + return "" + +def rstrip(s, ch): + """Replacement for str.rstrip (support for arbitrary chars to strip was + added in Python 2.2.2).""" + try: + if s[-1] != ch: + return s + i = -2 + while s[i] == ch: + i = i-1 + return s[:i+1] + except IndexError: + return "" + +def strip(s, ch): + """Replacement for str.strip (support for arbitrary chars to strip was + added in Python 2.2.2).""" + return lstrip(rstrip(s, ch), ch) + +def rsplit(s, sep, maxsplits=0): + """Like str.rsplit, which is Python 2.4+ only.""" + L = s.split(sep) + if not 0 < maxsplits <= len(L): + return L + return [sep.join(L[0:-maxsplits])] + L[-maxsplits:] + +############################################################################### + +def kwextract(s): + """Extract info from a svn keyword string.""" + try: + return strip(s, "$").strip().split(": ")[1] + except IndexError: + return "<unknown>" + +__revision__ = kwextract('$Rev$') +__date__ = kwextract('$Date$') + +# Additional options, not (yet?) mapped to command line flags +default_opts = { + "svn": "svn", + "prop": NAME + "-integrated", + "block-prop": NAME + "-blocked", + "commit-verbose": True, + "verbose": 0, +} +logs = {} + +def console_width(): + """Get the width of the console screen (if any).""" + try: + return int(os.environ["COLUMNS"]) + except (KeyError, ValueError): + pass + + try: + # Call the Windows API (requires ctypes library) + from ctypes import windll, create_string_buffer + h = windll.kernel32.GetStdHandle(-11) + csbi = create_string_buffer(22) + res = windll.kernel32.GetConsoleScreenBufferInfo(h, csbi) + if res: + import struct + (bufx, bufy, + curx, cury, wattr, + left, top, right, bottom, + maxx, maxy) = struct.unpack("hhhhHhhhhhh", csbi.raw) + return right - left + 1 + except ImportError: + pass + + # Parse the output of stty -a + if os.isatty(1): + out = os.popen("stty -a").read() + m = re.search(r"columns (\d+);", out) + if m: + return int(m.group(1)) + + # sensible default + return 80 + +def error(s): + """Subroutine to output an error and bail.""" + print >> sys.stderr, "%s: %s" % (NAME, s) + sys.exit(1) + +def report(s): + """Subroutine to output progress message, unless in quiet mode.""" + if opts["verbose"]: + print "%s: %s" % (NAME, s) + +def prefix_lines(prefix, lines): + """Given a string representing one or more lines of text, insert the + specified prefix at the beginning of each line, and return the result. + The input must be terminated by a newline.""" + assert lines[-1] == "\n" + return prefix + lines[:-1].replace("\n", "\n"+prefix) + "\n" + +def recode_stdout_to_file(s): + if locale.getdefaultlocale()[1] is None or not hasattr(sys.stdout, "encoding") \ + or sys.stdout.encoding is None: + return s + u = s.decode(sys.stdout.encoding) + return u.encode(locale.getdefaultlocale()[1]) + +class LaunchError(Exception): + """Signal a failure in execution of an external command. Parameters are the + exit code of the process, the original command line, and the output of the + command.""" + +try: + """Launch a sub-process. Return its output (both stdout and stderr), + optionally split by lines (if split_lines is True). Raise a LaunchError + exception if the exit code of the process is non-zero (failure). + + This function has two implementations, one based on subprocess (preferred), + and one based on popen (for compatibility). + """ + import subprocess + import shlex + + def launch(cmd, split_lines=True): + # Requiring python 2.4 or higher, on some platforms we get + # much faster performance from the subprocess module (where python + # doesn't try to close an exhorbitant number of file descriptors) + stdout = "" + stderr = "" + try: + if os.name == 'nt': + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, \ + close_fds=False, stderr=subprocess.PIPE) + else: + # Use shlex to break up the parameters intelligently, + # respecting quotes. shlex can't handle unicode. + args = shlex.split(cmd.encode('ascii')) + p = subprocess.Popen(args, stdout=subprocess.PIPE, \ + close_fds=False, stderr=subprocess.PIPE) + stdoutAndErr = p.communicate() + stdout = stdoutAndErr[0] + stderr = stdoutAndErr[1] + except OSError, inst: + # Using 1 as failure code; should get actual number somehow? For + # examples see svnmerge_test.py's TestCase_launch.test_failure and + # TestCase_launch.test_failurecode. + raise LaunchError(1, cmd, stdout + " " + stderr + ": " + str(inst)) + + if p.returncode == 0: + if split_lines: + # Setting keepends=True for compatibility with previous logic + # (where file.readlines() preserves newlines) + return stdout.splitlines(True) + else: + return stdout + else: + raise LaunchError(p.returncode, cmd, stdout + stderr) +except ImportError: + # support versions of python before 2.4 (slower on some systems) + def launch(cmd, split_lines=True): + if os.name not in ['nt', 'os2']: + import popen2 + p = popen2.Popen4(cmd) + p.tochild.close() + if split_lines: + out = p.fromchild.readlines() + else: + out = p.fromchild.read() + ret = p.wait() + if ret == 0: + ret = None + else: + ret >>= 8 + else: + i,k = os.popen4(cmd) + i.close() + if split_lines: + out = k.readlines() + else: + out = k.read() + ret = k.close() + + if ret is None: + return out + raise LaunchError(ret, cmd, out) + +def launchsvn(s, show=False, pretend=False, **kwargs): + """Launch SVN and grab its output.""" + username = password = configdir = "" + if opts.get("username", None): + username = "--username=" + opts["username"] + if opts.get("password", None): + password = "--password=" + opts["password"] + if opts.get("config-dir", None): + configdir = "--config-dir=" + opts["config-dir"] + cmd = ' '.join(filter(None, [opts["svn"], "--non-interactive", + username, password, configdir, s])) + if show or opts["verbose"] >= 2: + print cmd + if pretend: + return None + return launch(cmd, **kwargs) + +def svn_command(s): + """Do (or pretend to do) an SVN command.""" + out = launchsvn(s, show=opts["show-changes"] or opts["dry-run"], + pretend=opts["dry-run"], + split_lines=False) + if not opts["dry-run"]: + print out + +def check_dir_clean(dir): + """Check the current status of dir for local mods.""" + if opts["force"]: + report('skipping status check because of --force') + return + report('checking status of "%s"' % dir) + + # Checking with -q does not show unversioned files or external + # directories. Though it displays a debug message for external + # directories, after a blank line. So, practically, the first line + # matters: if it's non-empty there is a modification. + out = launchsvn("status -q %s" % dir) + if out and out[0].strip(): + error('"%s" has local modifications; it must be clean' % dir) + +class PathIdentifier: + """Abstraction for a path identifier, so that we can start talking + about it before we know the form that it takes in the properties (its + external_form). Objects are referenced in the class variable 'locobjs', + keyed by all known forms.""" + + # a map of UUID (or None) to repository root URL. + repo_hints = {} + + # a map from any known string form to the corresponding PathIdentifier + locobjs = {} + + def __init__(self, repo_relative_path, uuid=None, url=None, external_form=None): + self.repo_relative_path = repo_relative_path + self.uuid = uuid + self.url = url + self.external_form = external_form + + def __repr__(self): + return "<PathIdentifier " + ', '.join('%s=%r' % i for i in self.__dict__.items()) + '>' + + def __str__(self): + """Return a printable string representation""" + if self.external_form: + return self.external_form + if self.url: + return self.format('url') + if self.uuid: + return self.format('uuid') + return self.format('path') + + def from_pathid(pathid_str): + """convert pathid_str to a PathIdentifier""" + if not PathIdentifier.locobjs.has_key(pathid_str): + if is_url(pathid_str): + # we can determine every form; PathIdentifier.hint knows how to do that + PathIdentifier.hint(pathid_str) + elif pathid_str[:7] == 'uuid://': + mo = re.match('uuid://([^/]*)(.*)', pathid_str) + if not mo: + error("Invalid path identifier '%s'" % pathid_str) + uuid, repo_relative_path = mo.groups() + pathid = PathIdentifier(repo_relative_path, uuid=uuid) + # we can cache this by uuid:// pathid and by repo-relative path + PathIdentifier.locobjs[pathid_str] = PathIdentifier.locobjs[repo_relative_path] = pathid + elif pathid_str and pathid_str[0] == '/': + # strip any trailing slashes + pathid_str = pathid_str.rstrip('/') + pathid = PathIdentifier(repo_relative_path=pathid_str) + # we can only cache this by repo-relative path + PathIdentifier.locobjs[pathid_str] = pathid + else: + error("Invalid path identifier '%s'" % pathid_str) + return PathIdentifier.locobjs[pathid_str] + from_pathid = staticmethod(from_pathid) + + def from_target(target): + """Convert a target (either a working copy path or an URL) into a + path identifier.""" + # prime the cache first if we don't know about this target yet + if not PathIdentifier.locobjs.has_key(target): + PathIdentifier.hint(target) + + try: + return PathIdentifier.locobjs[target] + except KeyError: + error("Could not recognize path identifier '%s'" % target) + from_target = staticmethod(from_target) + + def hint(target): + """Cache some information about target, as it may be referenced by + repo-relative path in subversion properties; the cache can help to + expand such a relative path to a full path identifier.""" + if PathIdentifier.locobjs.has_key(target): return + if not is_url(target) and not is_wc(target): return + + url = target_to_url(target) + + root = get_repo_root(url) + assert root[-1] != "/" + assert url[:len(root)] == root, "url=%r, root=%r" % (url, root) + repo_relative_path = url[len(root):] + + try: + uuid = get_svninfo(target)['Repository UUID'] + uuid_pathid = 'uuid://%s%s' % (uuid, repo_relative_path) + except KeyError: + uuid = None + uuid_pathid = None + + locobj = PathIdentifier.locobjs.get(url) or \ + (uuid_pathid and PathIdentifier.locobjs.get(uuid_pathid)) + if not locobj: + locobj = PathIdentifier(repo_relative_path, uuid=uuid, url=url) + + PathIdentifier.repo_hints[uuid] = root # (uuid may be None) + + PathIdentifier.locobjs[target] = locobj + PathIdentifier.locobjs[url] = locobj + if uuid_pathid: + PathIdentifier.locobjs[uuid_pathid] = locobj + if not PathIdentifier.locobjs.has_key(repo_relative_path): + PathIdentifier.locobjs[repo_relative_path] = locobj + hint = staticmethod(hint) + + def format(self, fmt): + if fmt == 'path': + return self.repo_relative_path + elif fmt == 'uuid': + return "uuid://%s%s" % (self.uuid, self.repo_relative_path) + elif fmt == 'url': + return self.url + else: + error("Unkonwn path type '%s'" % fmt) + + def match_substring(self, str): + """Test whether str is a substring of any representation of this + PathIdentifier.""" + if self.repo_relative_path.find(str) >= 0: + return True + + if self.uuid: + if ("uuid://%s%s" % (self.uuid, self.repo_relative_path)).find(str) >= 0: + return True + + if self.url: + if (self.url + self.repo_relative_path).find(str) >= 0: + return True + + return False + + def get_url(self): + """Convert a pathid into a URL. If this is not possible, error out.""" + if self.url: + return self.url + # if we have a uuid and happen to know the URL for it, use that + elif self.uuid and PathIdentifier.repo_hints.has_key(self.uuid): + self.url = PathIdentifier.repo_hints[self.uuid] + self.repo_relative_path + PathIdentifier.locobjs[self.url] = self + return self.url + # if we've only seen one rep, use that (a guess, but an educated one) + elif not self.uuid and len(PathIdentifier.repo_hints) == 1: + uuid, root = PathIdentifier.repo_hints.items()[0] + if uuid: + self.uuid = uuid + PathIdentifier.locobjs['uuid://%s%s' % (uuid, self.repo_relative_path)] = self + self.url = root + self.repo_relative_path + PathIdentifier.locobjs[self.url] = self + report("Guessing that '%s' refers to '%s'" % (self, self.url)) + return self.url + else: + error("Cannot determine URL for '%s'; " % self + + "Explicit source argument (-S/--source) required.\n") + +class RevisionLog: + """ + A log of the revisions which affected a given URL between two + revisions. + """ + + def __init__(self, url, begin, end, find_propchanges=False): + """ + Create a new RevisionLog object, which stores, in self.revs, a list + of the revisions which affected the specified URL between begin and + end. If find_propchanges is True, self.propchange_revs will contain a + list of the revisions which changed properties directly on the + specified URL. URL must be the URL for a directory in the repository. + """ + self.url = url + + # Setup the log options (--quiet, so we don't show log messages) + log_opts = '--xml --quiet -r%s:%s "%s"' % (begin, end, url) + if find_propchanges: + # The --verbose flag lets us grab merge tracking information + # by looking at propchanges + log_opts = "--verbose " + log_opts + + # Read the log to look for revision numbers and merge-tracking info + self.revs = [] + self.propchange_revs = [] + repos_pathid = PathIdentifier.from_target(url) + for chg in SvnLogParser(launchsvn("log %s" % log_opts, + split_lines=False)): + self.revs.append(chg.revision()) + for p in chg.paths(): + if p.action() == 'M' and p.pathid() == repos_pathid.repo_relative_path: + self.propchange_revs.append(chg.revision()) + + # Save the range of the log + self.begin = int(begin) + if end == "HEAD": + # If end is not provided, we do not know which is the latest + # revision in the repository. So we set 'end' to the latest + # known revision. + self.end = self.revs[-1] + else: + self.end = int(end) + + self._merges = None + self._blocks = None + + def merge_metadata(self): + """ + Return a VersionedProperty object, with a cached view of the merge + metadata in the range of this log. + """ + + # Load merge metadata if necessary + if not self._merges: + self._merges = VersionedProperty(self.url, opts["prop"]) + self._merges.load(self) + + return self._merges + + def block_metadata(self): + if not self._blocks: + self._blocks = VersionedProperty(self.url, opts["block-prop"]) + self._blocks.load(self) + + return self._blocks + + +class VersionedProperty: + """ + A read-only, cached view of a versioned property. + + self.revs contains a list of the revisions in which the property changes. + self.values stores the new values at each corresponding revision. If the + value of the property is unknown, it is set to None. + + Initially, we set self.revs to [0] and self.values to [None]. This + indicates that, as of revision zero, we know nothing about the value of + the property. + + Later, if you run self.load(log), we cache the value of this property over + the entire range of the log by noting each revision in which the property + was changed. At the end of the range of the log, we invalidate our cache + by adding the value "None" to our cache for any revisions which fall out + of the range of our log. + + Once self.revs and self.values are filled, we can find the value of the + property at any arbitrary revision using a binary search on self.revs. + Once we find the last revision during which the property was changed, + we can lookup the associated value in self.values. (If the associated + value is None, the associated value was not cached and we have to do + a full propget.) + + An example: We know that the 'svnmerge' property was added in r10, and + changed in r21. We gathered log info up until r40. + + revs = [0, 10, 21, 40] + values = [None, "val1", "val2", None] + + What these values say: + - From r0 to r9, we know nothing about the property. + - In r10, the property was set to "val1". This property stayed the same + until r21, when it was changed to "val2". + - We don't know what happened after r40. + """ + + def __init__(self, url, name): + """View the history of a versioned property at URL with name""" + self.url = url + self.name = name + + # We know nothing about the value of the property. Setup revs + # and values to indicate as such. + self.revs = [0] + self.values = [None] + + # We don't have any revisions cached + self._initial_value = None + self._changed_revs = [] + self._changed_values = [] + + def load(self, log): + """ + Load the history of property changes from the specified + RevisionLog object. + """ + + # Get the property value before the range of the log + if log.begin > 1: + self.revs.append(log.begin-1) + try: + self._initial_value = self.raw_get(log.begin-1) + except LaunchError: + # The specified URL might not exist before the + # range of the log. If so, we can safely assume + # that the property was empty at that time. + self._initial_value = { } + self.values.append(self._initial_value) + else: + self._initial_value = { } + self.values[0] = self._initial_value + + # Cache the property values in the log range + old_value = self._initial_value + for rev in log.propchange_revs: + new_value = self.raw_get(rev) + if new_value != old_value: + self._changed_revs.append(rev) + self._changed_values.append(new_value) + self.revs.append(rev) + self.values.append(new_value) + old_value = new_value + + # Indicate that we know nothing about the value of the property + # after the range of the log. + if log.revs: + self.revs.append(log.end+1) + self.values.append(None) + + def raw_get(self, rev=None): + """ + Get the property at revision REV. If rev is not specified, get + the property at revision HEAD. + """ + return get_revlist_prop(self.url, self.name, rev) + + def get(self, rev=None): + """ + Get the property at revision REV. If rev is not specified, get + the property at revision HEAD. + """ + + if rev is not None: + + # Find the index using a binary search + i = bisect(self.revs, rev) - 1 + + # Return the value of the property, if it was cached + if self.values[i] is not None: + return self.values[i] + + # Get the current value of the property + return self.raw_get(rev) + + def changed_revs(self, key=None): + """ + Get a list of the revisions in which the specified dictionary + key was changed in this property. If key is not specified, + return a list of revisions in which any key was changed. + """ + if key is None: + return self._changed_revs + else: + changed_revs = [] + old_val = self._initial_value + for rev, val in zip(self._changed_revs, self._changed_values): + if val.get(key) != old_val.get(key): + changed_revs.append(rev) + old_val = val + return changed_revs + + def initialized_revs(self): + """ + Get a list of the revisions in which keys were added or + removed in this property. + """ + initialized_revs = [] + old_len = len(self._initial_value) + for rev, val in zip(self._changed_revs, self._changed_values): + if len(val) != old_len: + initialized_revs.append(rev) + old_len = len(val) + return initialized_revs + +class RevisionSet: + """ + A set of revisions, held in dictionary form for easy manipulation. If we + were to rewrite this script for Python 2.3+, we would subclass this from + set (or UserSet). As this class does not include branch + information, it's assumed that one instance will be used per + branch. + """ + def __init__(self, parm): + """Constructs a RevisionSet from a string in property form, or from + a dictionary whose keys are the revisions. Raises ValueError if the + input string is invalid.""" + + self._revs = {} + + revision_range_split_re = re.compile('[-:]') + + if isinstance(parm, types.DictType): + self._revs = parm.copy() + elif isinstance(parm, types.ListType): + for R in parm: + self._revs[int(R)] = 1 + else: + parm = parm.strip() + if parm: + for R in parm.split(","): + rev_or_revs = re.split(revision_range_split_re, R) + if len(rev_or_revs) == 1: + self._revs[int(rev_or_revs[0])] = 1 + elif len(rev_or_revs) == 2: + for rev in range(int(rev_or_revs[0]), + int(rev_or_revs[1])+1): + self._revs[rev] = 1 + else: + raise ValueError, 'Ill formatted revision range: ' + R + + def sorted(self): + revnums = self._revs.keys() + revnums.sort() + return revnums + + def normalized(self): + """Returns a normalized version of the revision set, which is an + ordered list of couples (start,end), with the minimum number of + intervals.""" + revnums = self.sorted() + revnums.reverse() + ret = [] + while revnums: + s = e = revnums.pop() + while revnums and revnums[-1] in (e, e+1): + e = revnums.pop() + ret.append((s, e)) + return ret + + def __str__(self): + """Convert the revision set to a string, using its normalized form.""" + L = [] + for s,e in self.normalized(): + if s == e: + L.append(str(s)) + else: + L.append(str(s) + "-" + str(e)) + return ",".join(L) + + def __contains__(self, rev): + return self._revs.has_key(rev) + + def __sub__(self, rs): + """Compute subtraction as in sets.""" + revs = {} + for r in self._revs.keys(): + if r not in rs: + revs[r] = 1 + return RevisionSet(revs) + + def __and__(self, rs): + """Compute intersections as in sets.""" + revs = {} + for r in self._revs.keys(): + if r in rs: + revs[r] = 1 + return RevisionSet(revs) + + def __nonzero__(self): + return len(self._revs) != 0 + + def __len__(self): + """Return the number of revisions in the set.""" + return len(self._revs) + + def __iter__(self): + return iter(self.sorted()) + + def __or__(self, rs): + """Compute set union.""" + revs = self._revs.copy() + revs.update(rs._revs) + return RevisionSet(revs) + +def merge_props_to_revision_set(merge_props, pathid): + """A converter which returns a RevisionSet instance containing the + revisions from PATH as known to BRANCH_PROPS. BRANCH_PROPS is a + dictionary of pathid -> revision set branch integration information + (as returned by get_merge_props()).""" + if not merge_props.has_key(pathid): + error('no integration info available for path "%s"' % pathid) + return RevisionSet(merge_props[pathid]) + +def dict_from_revlist_prop(propvalue): + """Given a property value as a string containing per-source revision + lists, return a dictionary whose key is a source path identifier + and whose value is the revisions for that source.""" + prop = {} + + # Multiple sources are separated by any whitespace. + for L in propvalue.split(): + # We use rsplit to play safe and allow colons in pathids. + pathid_str, revs = rsplit(L.strip(), ":", 1) + + pathid = PathIdentifier.from_pathid(pathid_str) + + # cache the "external" form we saw + pathid.external_form = pathid_str + + prop[pathid] = revs + return prop + +def get_revlist_prop(url_or_dir, propname, rev=None): + """Given a repository URL or working copy path and a property + name, extract the values of the property which store per-source + revision lists and return a dictionary whose key is a source path + identifier, and whose value is the revisions for that source.""" + + # Note that propget does not return an error if the property does + # not exist, it simply does not output anything. So we do not need + # to check for LaunchError here. + args = '--strict "%s" "%s"' % (propname, url_or_dir) + if rev: + args = '-r %s %s' % (rev, args) + out = launchsvn('propget %s' % args, split_lines=False) + + return dict_from_revlist_prop(out) + +def get_merge_props(dir): + """Extract the merged revisions.""" + return get_revlist_prop(dir, opts["prop"]) + +def get_block_props(dir): + """Extract the blocked revisions.""" + return get_revlist_prop(dir, opts["block-prop"]) + +def get_blocked_revs(dir, source_pathid): + p = get_block_props(dir) + if p.has_key(source_pathid): + return RevisionSet(p[source_pathid]) + return RevisionSet("") + +def format_merge_props(props, sep=" "): + """Formats the hash PROPS as a string suitable for use as a + Subversion property value.""" + assert sep in ["\t", "\n", " "] # must be a whitespace + props = props.items() + props.sort() + L = [] + for h, r in props: + L.append("%s:%s" % (h, r)) + return sep.join(L) + +def _run_propset(dir, prop, value): + """Set the property 'prop' of directory 'dir' to value 'value'. We go + through a temporary file to not run into command line length limits.""" + try: + fd, fname = tempfile.mkstemp() + f = os.fdopen(fd, "wb") + except AttributeError: + # Fallback for Python <= 2.3 which does not have mkstemp (mktemp + # suffers from race conditions. Not that we care...) + fname = tempfile.mktemp() + f = open(fname, "wb") + + try: + f.write(value) + f.close() + report("property data written to temp file: %s" % value) + svn_command('propset "%s" -F "%s" "%s"' % (prop, fname, dir)) + finally: + os.remove(fname) + +def set_props(dir, name, props): + props = format_merge_props(props) + if props: + _run_propset(dir, name, props) + else: + # Check if NAME exists on DIR before trying to delete it. + # As of 1.6 propdel no longer supports deleting a + # non-existent property. + out = launchsvn('propget "%s" "%s"' % (name, dir)) + if out: + svn_command('propdel "%s" "%s"' % (name, dir)) + +def set_merge_props(dir, props): + set_props(dir, opts["prop"], props) + +def set_block_props(dir, props): + set_props(dir, opts["block-prop"], props) + +def set_blocked_revs(dir, source_pathid, revs): + props = get_block_props(dir) + if revs: + props[source_pathid] = str(revs) + elif props.has_key(source_pathid): + del props[source_pathid] + set_block_props(dir, props) + +def is_url(url): + """Check if url looks like a valid url.""" + return re.search(r"^[a-zA-Z][-+\.\w]*://[^\s]+$", url) is not None and url[:4] != 'uuid' + +def check_url(url): + """Similar to is_url, but actually invoke get_svninfo to find out""" + return get_svninfo(url) != {} + +def is_pathid(pathid): + return isinstance(pathid, PathIdentifier) + +def is_wc(dir): + """Check if a directory is a working copy.""" + return os.path.isdir(os.path.join(dir, ".svn")) or \ + os.path.isdir(os.path.join(dir, "_svn")) + +_cache_svninfo = {} +def get_svninfo(target): + """Extract the subversion information for a target (through 'svn info'). + This function uses an internal cache to let clients query information + many times.""" + if _cache_svninfo.has_key(target): + return _cache_svninfo[target] + info = {} + for L in launchsvn('info "%s"' % target): + L = L.strip() + if not L: + continue + key, value = L.split(": ", 1) + info[key] = value.strip() + _cache_svninfo[target] = info + return info + +def target_to_url(target): + """Convert working copy path or repos URL to a repos URL.""" + if is_wc(target): + info = get_svninfo(target) + return info["URL"] + return target + +_cache_reporoot = {} +def get_repo_root(target): + """Compute the root repos URL given a working-copy path, or a URL.""" + # Try using "svn info WCDIR". This works only on SVN clients >= 1.3 + if not is_url(target): + try: + info = get_svninfo(target) + root = info["Repository Root"] + _cache_reporoot[root] = None + return root + except KeyError: + pass + url = target_to_url(target) + assert url[-1] != '/' + else: + url = target + + # Go through the cache of the repository roots. This avoids extra + # server round-trips if we are asking the root of different URLs + # in the same repository (the cache in get_svninfo() cannot detect + # that of course and would issue a remote command). + assert is_url(url) + for r in _cache_reporoot: + if url.startswith(r): + return r + + # Try using "svn info URL". This works only on SVN clients >= 1.2 + try: + info = get_svninfo(url) + # info may be {}, in which case we'll see KeyError here + root = info["Repository Root"] + _cache_reporoot[root] = None + return root + except (KeyError, LaunchError): + pass + + # Constrained to older svn clients, we are stuck with this ugly + # trial-and-error implementation. It could be made faster with a + # binary search. + while url: + temp = os.path.dirname(url) + try: + launchsvn('proplist "%s"' % temp) + except LaunchError: + _cache_reporoot[url] = None + return rstrip(url, "/") + url = temp + + error("svn repos root of %s not found" % target) + +class SvnLogParser: + """ + Parse the "svn log", going through the XML output and using pulldom (which + would even allow streaming the command output). + """ + def __init__(self, xml): + self._events = pulldom.parseString(xml) + def __getitem__(self, idx): + for event, node in self._events: + if event == pulldom.START_ELEMENT and node.tagName == "logentry": + self._events.expandNode(node) + return self.SvnLogRevision(node) + raise IndexError, "Could not find 'logentry' tag in xml" + + class SvnLogRevision: + def __init__(self, xmlnode): + self.n = xmlnode + def revision(self): + return int(self.n.getAttribute("revision")) + def author(self): + return self.n.getElementsByTagName("author")[0].firstChild.data + def paths(self): + return [self.SvnLogPath(n) + for n in self.n.getElementsByTagName("path")] + + class SvnLogPath: + def __init__(self, xmlnode): + self.n = xmlnode + def action(self): + return self.n.getAttribute("action") + def pathid(self): + return self.n.firstChild.data + def copyfrom_rev(self): + try: return self.n.getAttribute("copyfrom-rev") + except KeyError: return None + def copyfrom_pathid(self): + try: return self.n.getAttribute("copyfrom-path") + except KeyError: return None + +def get_copyfrom(target): + """Get copyfrom info for a given target (it represents the + repository-relative path from where it was branched). NOTE: + repos root has no copyfrom info. In this case None is returned. + + Returns the: + - source file or directory from which the copy was made + - revision from which that source was copied + - revision in which the copy was committed + """ + repos_path = PathIdentifier.from_target(target).repo_relative_path + for chg in SvnLogParser(launchsvn('log -v --xml --stop-on-copy "%s"' + % target, split_lines=False)): + for p in chg.paths(): + if p.action() == 'A' and p.pathid() == repos_path: + # These values will be None if the corresponding elements are + # not found in the log. + return p.copyfrom_pathid(), p.copyfrom_rev(), chg.revision() + return None,None,None + +def get_latest_rev(url): + """Get the latest revision of the repository of which URL is part.""" + try: + info = get_svninfo(url) + if not info.has_key("Revision"): + error("Not a valid URL: %s" % url) + return info["Revision"] + except LaunchError: + # Alternative method for latest revision checking (for svn < 1.2) + report('checking latest revision of "%s"' % url) + L = launchsvn('proplist --revprop -r HEAD "%s"' % opts["source-url"])[0] + rev = re.search("revision (\d+)", L).group(1) + report('latest revision of "%s" is %s' % (url, rev)) + return rev + +def get_created_rev(url): + """Lookup the revision at which the path identified by the + provided URL was first created.""" + oldest_rev = -1 + report('determining oldest revision for URL "%s"' % url) + ### TODO: Refactor this to use a modified RevisionLog class. + lines = None + cmd = "log -r1:HEAD --stop-on-copy -q " + url + try: + lines = launchsvn(cmd + " --limit=1") + except LaunchError: + # Assume that --limit isn't supported by the installed 'svn'. + lines = launchsvn(cmd) + if lines and len(lines) > 1: + i = lines[1].find(" ") + if i != -1: + oldest_rev = int(lines[1][1:i]) + if oldest_rev == -1: + error('unable to determine oldest revision for URL "%s"' % url) + return oldest_rev + +def get_commit_log(url, revnum): + """Return the log message for a specific integer revision + number.""" + out = launchsvn("log --incremental -r%d %s" % (revnum, url)) + return recode_stdout_to_file("".join(out[1:])) + +def construct_merged_log_message(url, revnums): + """Return a commit log message containing all the commit messages + in the specified revisions at the given URL. The separator used + in this log message is determined by searching for the longest + svnmerge separator existing in the commit log messages and + extending it by one more separator. This results in a new commit + log message that is clearer in describing merges that contain + other merges. Trailing newlines are removed from the embedded + log messages.""" + messages = [''] + longest_sep = '' + for r in revnums.sorted(): + message = get_commit_log(url, r) + if message: + message = re.sub(r'(\r\n|\r|\n)', "\n", message) + message = rstrip(message, "\n") + "\n" + messages.append(prefix_lines(LOG_LINE_PREFIX, message)) + for match in LOG_SEPARATOR_RE.findall(message): + sep = match[1] + if len(sep) > len(longest_sep): + longest_sep = sep + + longest_sep += LOG_SEPARATOR + "\n" + messages.append('') + return longest_sep.join(messages) + +def get_default_source(branch_target, branch_props): + """Return the default source for branch_target (given its branch_props). + Error out if there is ambiguity.""" + if not branch_props: + error("no integration info available") + + props = branch_props.copy() + pathid = PathIdentifier.from_target(branch_target) + + # To make bidirectional merges easier, find the target's + # repository local path so it can be removed from the list of + # possible integration sources. + if props.has_key(pathid): + del props[pathid] + + if len(props) > 1: + err_msg = "multiple sources found. " + err_msg += "Explicit source argument (-S/--source) required.\n" + err_msg += "The merge sources available are:" + for prop in props: + err_msg += "\n " + str(prop) + error(err_msg) + + return props.keys()[0] + +def should_find_reflected(branch_dir): + should_find_reflected = opts["bidirectional"] + + # If the source has integration info for the target, set find_reflected + # even if --bidirectional wasn't specified + if not should_find_reflected: + source_props = get_merge_props(opts["source-url"]) + should_find_reflected = source_props.has_key(PathIdentifier.from_target(branch_dir)) + + return should_find_reflected + +def analyze_revs(target_pathid, url, begin=1, end=None, + find_reflected=False): + """For the source of the merges in the source URL being merged into + target_pathid, analyze the revisions in the interval begin-end (which + defaults to 1-HEAD), to find out which revisions are changes in + the url, which are changes elsewhere (so-called 'phantom' + revisions), optionally which are reflected changes (to avoid + conflicts that can occur when doing bidirectional merging between + branches), and which revisions initialize merge tracking against other + branches. Return a tuple of four RevisionSet's: + (real_revs, phantom_revs, reflected_revs, initialized_revs). + + NOTE: To maximize speed, if "end" is not provided, the function is + not able to find phantom revisions following the last real + revision in the URL. + """ + + begin = str(begin) + if end is None: + end = "HEAD" + else: + end = str(end) + if long(begin) > long(end): + return RevisionSet(""), RevisionSet(""), \ + RevisionSet(""), RevisionSet("") + + logs[url] = RevisionLog(url, begin, end, find_reflected) + revs = RevisionSet(logs[url].revs) + + if end == "HEAD": + # If end is not provided, we do not know which is the latest revision + # in the repository. So return the phantom revision set only up to + # the latest known revision. + end = str(list(revs)[-1]) + + phantom_revs = RevisionSet("%s-%s" % (begin, end)) - revs + + if find_reflected: + reflected_revs = logs[url].merge_metadata().changed_revs(target_pathid) + reflected_revs += logs[url].block_metadata().changed_revs(target_pathid) + else: + reflected_revs = [] + + initialized_revs = RevisionSet(logs[url].merge_metadata().initialized_revs()) + reflected_revs = RevisionSet(reflected_revs) + + return revs, phantom_revs, reflected_revs, initialized_revs + +def analyze_source_revs(branch_target, source_url, **kwargs): + """For the given branch and source, extract the real and phantom + source revisions.""" + branch_url = target_to_url(branch_target) + branch_pathid = PathIdentifier.from_target(branch_target) + + # Extract the latest repository revision from the URL of the branch + # directory (which is already cached at this point). + end_rev = get_latest_rev(source_url) + + # Calculate the base of analysis. If there is a "1-XX" interval in the + # merged_revs, we do not need to check those. + base = 1 + r = opts["merged-revs"].normalized() + if r and r[0][0] == 1: + base = r[0][1] + 1 + + # See if the user filtered the revision set. If so, we are not + # interested in something outside that range. + if opts["revision"]: + revs = RevisionSet(opts["revision"]).sorted() + if base < revs[0]: + base = revs[0] + if end_rev > revs[-1]: + end_rev = revs[-1] + + return analyze_revs(branch_pathid, source_url, base, end_rev, **kwargs) + +def minimal_merge_intervals(revs, phantom_revs): + """Produce the smallest number of intervals suitable for merging. revs + is the RevisionSet which we want to merge, and phantom_revs are phantom + revisions which can be used to concatenate intervals, thus minimizing the + number of operations.""" + revnums = revs.normalized() + ret = [] + + cur = revnums.pop() + while revnums: + next = revnums.pop() + assert next[1] < cur[0] # otherwise it is not ordered + assert cur[0] - next[1] > 1 # otherwise it is not normalized + for i in range(next[1]+1, cur[0]): + if i not in phantom_revs: + ret.append(cur) + cur = next + break + else: + cur = (next[0], cur[1]) + + ret.append(cur) + ret.reverse() + return ret + +def display_revisions(revs, display_style, revisions_msg, source_url): + """Show REVS as dictated by DISPLAY_STYLE, either numerically, in + log format, or as diffs. When displaying revisions numerically, + prefix output with REVISIONS_MSG when in verbose mode. Otherwise, + request logs or diffs using SOURCE_URL.""" + if display_style == "revisions": + if revs: + report(revisions_msg) + print revs + elif display_style == "logs": + for start,end in revs.normalized(): + svn_command('log --incremental -v -r %d:%d %s' % \ + (start, end, source_url)) + elif display_style in ("diffs", "summarize"): + if display_style == 'summarize': + summarize = '--summarize ' + else: + summarize = '' + + for start, end in revs.normalized(): + print + if start == end: + print "%s: changes in revision %d follow" % (NAME, start) + else: + print "%s: changes in revisions %d-%d follow" % (NAME, + start, end) + print + + # Note: the starting revision number to 'svn diff' is + # NOT inclusive so we have to subtract one from ${START}. + svn_command("diff -r %d:%d %s %s" % (start - 1, end, summarize, + source_url)) + else: + assert False, "unhandled display style: %s" % display_style + +def action_init(target_dir, target_props): + """Initialize for merges.""" + # Check that directory is ready for being modified + check_dir_clean(target_dir) + + target_pathid = PathIdentifier.from_target(target_dir) + source_pathid = opts['source-pathid'] + if source_pathid == target_pathid: + error("cannot init integration source path '%s'\nIts path identifier does not " + "differ from the path identifier of the current directory, '%s'." + % (source_pathid, target_pathid)) + + source_url = opts['source-url'] + + # If the user hasn't specified the revisions to use, see if the + # "source" is a copy from the current tree and if so, we can use + # the version data obtained from it. + revision_range = opts["revision"] + if not revision_range: + # If source was originally copied from target, and we are merging + # changes from source to target (the copy target is the merge source, + # and the copy source is the merge target), then we want to mark as + # integrated up to the rev in which the copy was committed which + # created the merge source: + cf_source, cf_rev, copy_committed_in_rev = get_copyfrom(source_url) + + cf_pathid = None + if cf_source: + cf_url = get_repo_root(source_url) + cf_source + if is_url(cf_url) and check_url(cf_url): + cf_pathid = PathIdentifier.from_target(cf_url) + + if target_pathid == cf_pathid: + report('the source "%s" was copied from "%s" in rev %s and committed in rev %s' % + (source_url, target_dir, cf_rev, copy_committed_in_rev)) + revision_range = "1-" + str(copy_committed_in_rev) + + if not revision_range: + # If the reverse is true: copy source is the merge source, and + # the copy target is the merge target, then we want to mark as + # integrated up to the specific rev of the merge target from + # which the merge source was copied. (Longer discussion at: + # http://subversion.tigris.org/issues/show_bug.cgi?id=2810 ) + cf_source, cf_rev, copy_committed_in_rev = get_copyfrom(target_dir) + + cf_pathid = None + if cf_source: + cf_url = get_repo_root(target_dir) + cf_source + if is_url(cf_url) and check_url(cf_url): + cf_pathid = PathIdentifier.from_target(cf_url) + + source_pathid = PathIdentifier.from_target(source_url) + if source_pathid == cf_pathid: + report('the target "%s" was copied the source "%s" in rev %s and committed in rev %s' % + (target_dir, source_url, cf_rev, copy_committed_in_rev)) + revision_range = "1-" + cf_rev + + # When neither the merge source nor target is a copy of the other, and + # the user did not specify a revision range, then choose a default which is + # the current revision; saying, in effect, "everything has been merged, so + # mark as integrated up to the latest rev on source url). + if not revision_range: + revision_range = "1-" + get_latest_rev(source_url) + + revs = RevisionSet(revision_range) + + report('marking "%s" as already containing revisions "%s" of "%s"' % + (target_dir, revs, source_url)) + + revs = str(revs) + # If the local svnmerge-integrated property already has an entry + # for the source-pathid, simply error out. + if not opts["force"] and target_props.has_key(source_pathid): + error('Repository-relative path %s has already been initialized at %s\n' + 'Use --force to re-initialize' % (source_pathid, target_dir)) + # set the pathid's external_form based on the user's options + source_pathid.external_form = source_pathid.format(opts['location-type']) + + revs = str(revs) + target_props[source_pathid] = revs + + # Set property + set_merge_props(target_dir, target_props) + + # Write out commit message if desired + if opts["commit-file"]: + f = open(opts["commit-file"], "w") + print >>f, 'Initialized merge tracking via "%s" with revisions "%s" from ' \ + % (NAME, revs) + print >>f, '%s' % source_url + f.close() + report('wrote commit message to "%s"' % opts["commit-file"]) + +def action_avail(branch_dir, branch_props): + """Show commits available for merges.""" + source_revs, phantom_revs, reflected_revs, initialized_revs = \ + analyze_source_revs(branch_dir, opts["source-url"], + find_reflected= + should_find_reflected(branch_dir)) + report('skipping phantom revisions: %s' % phantom_revs) + if reflected_revs: + report('skipping reflected revisions: %s' % reflected_revs) + report('skipping initialized revisions: %s' % initialized_revs) + + blocked_revs = get_blocked_revs(branch_dir, opts["source-pathid"]) + avail_revs = source_revs - opts["merged-revs"] - blocked_revs - \ + reflected_revs - initialized_revs + + # Compose the set of revisions to show + revs = RevisionSet("") + report_msg = "revisions available to be merged are:" + if "avail" in opts["avail-showwhat"]: + revs |= avail_revs + if "blocked" in opts["avail-showwhat"]: + revs |= blocked_revs + report_msg = "revisions blocked are:" + + # Limit to revisions specified by -r (if any) + if opts["revision"]: + revs = revs & RevisionSet(opts["revision"]) + + display_revisions(revs, opts["avail-display"], + report_msg, + opts["source-url"]) + +def action_integrated(branch_dir, branch_props): + """Show change sets already merged. This set of revisions is + calculated from taking svnmerge-integrated property from the + branch, and subtracting any revision older than the branch + creation revision.""" + # Extract the integration info for the branch_dir + branch_props = get_merge_props(branch_dir) + revs = merge_props_to_revision_set(branch_props, opts["source-pathid"]) + + # Lookup the oldest revision on the branch path. + oldest_src_rev = get_created_rev(opts["source-url"]) + + # Subtract any revisions which pre-date the branch. + report("subtracting revisions which pre-date the source URL (%d)" % + oldest_src_rev) + revs = revs - RevisionSet(range(1, oldest_src_rev)) + + # Limit to revisions specified by -r (if any) + if opts["revision"]: + revs = revs & RevisionSet(opts["revision"]) + + display_revisions(revs, opts["integrated-display"], + "revisions already integrated are:", opts["source-url"]) + +def action_merge(branch_dir, branch_props): + """Record merge meta data, and do the actual merge (if not + requested otherwise via --record-only).""" + # Check branch directory is ready for being modified + check_dir_clean(branch_dir) + + source_revs, phantom_revs, reflected_revs, initialized_revs = \ + analyze_source_revs(branch_dir, opts["source-url"], + find_reflected= + should_find_reflected(branch_dir)) + + if opts["revision"]: + revs = RevisionSet(opts["revision"]) + else: + revs = source_revs + + blocked_revs = get_blocked_revs(branch_dir, opts["source-pathid"]) + merged_revs = opts["merged-revs"] + + # Show what we're doing + if opts["verbose"]: # just to avoid useless calculations + if merged_revs & revs: + report('"%s" already contains revisions %s' % (branch_dir, + merged_revs & revs)) + if phantom_revs: + report('memorizing phantom revision(s): %s' % phantom_revs) + if reflected_revs: + report('memorizing reflected revision(s): %s' % reflected_revs) + if blocked_revs & revs: + report('skipping blocked revisions(s): %s' % (blocked_revs & revs)) + if initialized_revs: + report('skipping initialized revision(s): %s' % initialized_revs) + + # Compute final merge set. + revs = revs - merged_revs - blocked_revs - reflected_revs - \ + phantom_revs - initialized_revs + if not revs: + report('no revisions to merge, exiting') + return + + # When manually marking revisions as merged, we only update the + # integration meta data, and don't perform an actual merge. + record_only = opts["record-only"] + + if record_only: + report('recording merge of revision(s) %s from "%s"' % + (revs, opts["source-url"])) + else: + report('merging in revision(s) %s from "%s"' % + (revs, opts["source-url"])) + + # Do the merge(s). Note: the starting revision number to 'svn merge' + # is NOT inclusive so we have to subtract one from start. + # We try to keep the number of merge operations as low as possible, + # because it is faster and reduces the number of conflicts. + old_block_props = get_block_props(branch_dir) + merge_metadata = logs[opts["source-url"]].merge_metadata() + block_metadata = logs[opts["source-url"]].block_metadata() + for start,end in minimal_merge_intervals(revs, phantom_revs): + if not record_only: + # Preset merge/blocked properties to the source value at + # the start rev to avoid spurious property conflicts + set_merge_props(branch_dir, merge_metadata.get(start - 1)) + set_block_props(branch_dir, block_metadata.get(start - 1)) + # Do the merge + svn_command("merge --force -r %d:%d %s %s" % \ + (start - 1, end, opts["source-url"], branch_dir)) + # TODO: to support graph merging, add logic to merge the property + # meta-data manually + + # Update the set of merged revisions. + merged_revs = merged_revs | revs | reflected_revs | phantom_revs | initialized_revs + branch_props[opts["source-pathid"]] = str(merged_revs) + set_merge_props(branch_dir, branch_props) + # Reset the blocked revs + set_block_props(branch_dir, old_block_props) + + # Write out commit message if desired + if opts["commit-file"]: + f = open(opts["commit-file"], "w") + if record_only: + print >>f, 'Recorded merge of revisions %s via %s from ' % \ + (revs, NAME) + else: + print >>f, 'Merged revisions %s via %s from ' % \ + (revs, NAME) + print >>f, '%s' % opts["source-url"] + if opts["commit-verbose"]: + print >>f + print >>f, construct_merged_log_message(opts["source-url"], revs), + + f.close() + report('wrote commit message to "%s"' % opts["commit-file"]) + +def action_block(branch_dir, branch_props): + """Block revisions.""" + # Check branch directory is ready for being modified + check_dir_clean(branch_dir) + + source_revs, phantom_revs, reflected_revs, initialized_revs = \ + analyze_source_revs(branch_dir, opts["source-url"]) + revs_to_block = source_revs - opts["merged-revs"] + + # Limit to revisions specified by -r (if any) + if opts["revision"]: + revs_to_block = RevisionSet(opts["revision"]) & revs_to_block + + if not revs_to_block: + error('no available revisions to block') + + # Change blocked information + blocked_revs = get_blocked_revs(branch_dir, opts["source-pathid"]) + blocked_revs = blocked_revs | revs_to_block + set_blocked_revs(branch_dir, opts["source-pathid"], blocked_revs) + + # Write out commit message if desired + if opts["commit-file"]: + f = open(opts["commit-file"], "w") + print >>f, 'Blocked revisions %s via %s' % (revs_to_block, NAME) + if opts["commit-verbose"]: + print >>f + print >>f, construct_merged_log_message(opts["source-url"], + revs_to_block), + + f.close() + report('wrote commit message to "%s"' % opts["commit-file"]) + +def action_unblock(branch_dir, branch_props): + """Unblock revisions.""" + # Check branch directory is ready for being modified + check_dir_clean(branch_dir) + + blocked_revs = get_blocked_revs(branch_dir, opts["source-pathid"]) + revs_to_unblock = blocked_revs + + # Limit to revisions specified by -r (if any) + if opts["revision"]: + revs_to_unblock = revs_to_unblock & RevisionSet(opts["revision"]) + + if not revs_to_unblock: + error('no available revisions to unblock') + + # Change blocked information + blocked_revs = blocked_revs - revs_to_unblock + set_blocked_revs(branch_dir, opts["source-pathid"], blocked_revs) + + # Write out commit message if desired + if opts["commit-file"]: + f = open(opts["commit-file"], "w") + print >>f, 'Unblocked revisions %s via %s' % (revs_to_unblock, NAME) + if opts["commit-verbose"]: + print >>f + print >>f, construct_merged_log_message(opts["source-url"], + revs_to_unblock), + f.close() + report('wrote commit message to "%s"' % opts["commit-file"]) + +def action_rollback(branch_dir, branch_props): + """Rollback previously integrated revisions.""" + + # Make sure the revision arguments are present + if not opts["revision"]: + error("The '-r' option is mandatory for rollback") + + # Check branch directory is ready for being modified + check_dir_clean(branch_dir) + + # Extract the integration info for the branch_dir + branch_props = get_merge_props(branch_dir) + # Get the list of all revisions already merged into this source-pathid. + merged_revs = merge_props_to_revision_set(branch_props, + opts["source-pathid"]) + + # At which revision was the src created? + oldest_src_rev = get_created_rev(opts["source-url"]) + src_pre_exist_range = RevisionSet("1-%d" % oldest_src_rev) + + # Limit to revisions specified by -r (if any) + revs = merged_revs & RevisionSet(opts["revision"]) + + # make sure there's some revision to rollback + if not revs: + report("Nothing to rollback in revision range r%s" % opts["revision"]) + return + + # If even one specified revision lies outside the lifetime of the + # merge source, error out. + if revs & src_pre_exist_range: + err_str = "Specified revision range falls out of the rollback range.\n" + err_str += "%s was created at r%d" % (opts["source-pathid"], + oldest_src_rev) + error(err_str) + + record_only = opts["record-only"] + + if record_only: + report('recording rollback of revision(s) %s from "%s"' % + (revs, opts["source-url"])) + else: + report('rollback of revision(s) %s from "%s"' % + (revs, opts["source-url"])) + + # Do the reverse merge(s). Note: the starting revision number + # to 'svn merge' is NOT inclusive so we have to subtract one from start. + # We try to keep the number of merge operations as low as possible, + # because it is faster and reduces the number of conflicts. + rollback_intervals = minimal_merge_intervals(revs, []) + # rollback in the reverse order of merge + rollback_intervals.reverse() + for start, end in rollback_intervals: + if not record_only: + # Do the merge + svn_command("merge --force -r %d:%d %s %s" % \ + (end, start - 1, opts["source-url"], branch_dir)) + + # Write out commit message if desired + # calculate the phantom revs first + if opts["commit-file"]: + f = open(opts["commit-file"], "w") + if record_only: + print >>f, 'Recorded rollback of revisions %s via %s from ' % \ + (revs , NAME) + else: + print >>f, 'Rolled back revisions %s via %s from ' % \ + (revs , NAME) + print >>f, '%s' % opts["source-url"] + + f.close() + report('wrote commit message to "%s"' % opts["commit-file"]) + + # Update the set of merged revisions. + merged_revs = merged_revs - revs + branch_props[opts["source-pathid"]] = str(merged_revs) + set_merge_props(branch_dir, branch_props) + +def action_uninit(branch_dir, branch_props): + """Uninit SOURCE URL.""" + # Check branch directory is ready for being modified + check_dir_clean(branch_dir) + + # If the source-pathid does not have an entry in the svnmerge-integrated + # property, simply error out. + if not branch_props.has_key(opts["source-pathid"]): + error('Repository-relative path "%s" does not contain merge ' + 'tracking information for "%s"' \ + % (opts["source-pathid"], branch_dir)) + + del branch_props[opts["source-pathid"]] + + # Set merge property with the selected source deleted + set_merge_props(branch_dir, branch_props) + + # Set blocked revisions for the selected source to None + set_blocked_revs(branch_dir, opts["source-pathid"], None) + + # Write out commit message if desired + if opts["commit-file"]: + f = open(opts["commit-file"], "w") + print >>f, 'Removed merge tracking for "%s" for ' % NAME + print >>f, '%s' % opts["source-url"] + f.close() + report('wrote commit message to "%s"' % opts["commit-file"]) + +############################################################################### +# Command line parsing -- options and commands management +############################################################################### + +class OptBase: + def __init__(self, *args, **kwargs): + self.help = kwargs["help"] + del kwargs["help"] + self.lflags = [] + self.sflags = [] + for a in args: + if a.startswith("--"): self.lflags.append(a) + elif a.startswith("-"): self.sflags.append(a) + else: + raise TypeError, "invalid flag name: %s" % a + if kwargs.has_key("dest"): + self.dest = kwargs["dest"] + del kwargs["dest"] + else: + if not self.lflags: + raise TypeError, "cannot deduce dest name without long options" + self.dest = self.lflags[0][2:] + if kwargs: + raise TypeError, "invalid keyword arguments: %r" % kwargs.keys() + def repr_flags(self): + f = self.sflags + self.lflags + r = f[0] + for fl in f[1:]: + r += " [%s]" % fl + return r + +class Option(OptBase): + def __init__(self, *args, **kwargs): + self.default = kwargs.setdefault("default", 0) + del kwargs["default"] + self.value = kwargs.setdefault("value", None) + del kwargs["value"] + OptBase.__init__(self, *args, **kwargs) + def apply(self, state, value): + assert value == "" + if self.value is not None: + state[self.dest] = self.value + else: + state[self.dest] += 1 + +class OptionArg(OptBase): + def __init__(self, *args, **kwargs): + self.default = kwargs["default"] + del kwargs["default"] + self.metavar = kwargs.setdefault("metavar", None) + del kwargs["metavar"] + OptBase.__init__(self, *args, **kwargs) + + if self.metavar is None: + if self.dest is not None: + self.metavar = self.dest.upper() + else: + self.metavar = "arg" + if self.default: + self.help += " (default: %s)" % self.default + def apply(self, state, value): + assert value is not None + state[self.dest] = value + def repr_flags(self): + r = OptBase.repr_flags(self) + return r + " " + self.metavar + +class CommandOpts: + class Cmd: + def __init__(self, *args): + self.name, self.func, self.usage, self.help, self.opts = args + def short_help(self): + return self.help.split(".")[0] + def __str__(self): + return self.name + def __call__(self, *args, **kwargs): + return self.func(*args, **kwargs) + + def __init__(self, global_opts, common_opts, command_table, version=None): + self.progname = NAME + self.version = version.replace("%prog", self.progname) + self.cwidth = console_width() - 2 + self.ctable = command_table.copy() + self.gopts = global_opts[:] + self.copts = common_opts[:] + self._add_builtins() + for k in self.ctable.keys(): + cmd = self.Cmd(k, *self.ctable[k]) + opts = [] + for o in cmd.opts: + if isinstance(o, types.StringType) or \ + isinstance(o, types.UnicodeType): + o = self._find_common(o) + opts.append(o) + cmd.opts = opts + self.ctable[k] = cmd + + def _add_builtins(self): + self.gopts.append( + Option("-h", "--help", help="show help for this command and exit")) + if self.version is not None: + self.gopts.append( + Option("-V", "--version", help="show version info and exit")) + self.ctable["help"] = (self._cmd_help, + "help [COMMAND]", + "Display help for a specific command. If COMMAND is omitted, " + "display brief command description.", + []) + + def _cmd_help(self, cmd=None, *args): + if args: + self.error("wrong number of arguments", "help") + if cmd is not None: + cmd = self._command(cmd) + self.print_command_help(cmd) + else: + self.print_command_list() + + def _paragraph(self, text, width=78): + chunks = re.split("\s+", text.strip()) + chunks.reverse() + lines = [] + while chunks: + L = chunks.pop() + while chunks and len(L) + len(chunks[-1]) + 1 <= width: + L += " " + chunks.pop() + lines.append(L) + return lines + + def _paragraphs(self, text, *args, **kwargs): + pars = text.split("\n\n") + lines = self._paragraph(pars[0], *args, **kwargs) + for p in pars[1:]: + lines.append("") + lines.extend(self._paragraph(p, *args, **kwargs)) + return lines + + def _print_wrapped(self, text, indent=0): + text = self._paragraphs(text, self.cwidth - indent) + print text.pop(0) + for t in text: + print " " * indent + t + + def _find_common(self, fl): + for o in self.copts: + if fl in o.lflags+o.sflags: + return o + assert False, fl + + def _compute_flags(self, opts, check_conflicts=True): + back = {} + sfl = "" + lfl = [] + for o in opts: + sapp = lapp = "" + if isinstance(o, OptionArg): + sapp, lapp = ":", "=" + for s in o.sflags: + if check_conflicts and back.has_key(s): + raise RuntimeError, "option conflict: %s" % s + back[s] = o + sfl += s[1:] + sapp + for l in o.lflags: + if check_conflicts and back.has_key(l): + raise RuntimeError, "option conflict: %s" % l + back[l] = o + lfl.append(l[2:] + lapp) + return sfl, lfl, back + + def _extract_command(self, args): + """ + Try to extract the command name from the argument list. This is + non-trivial because we want to allow command-specific options even + before the command itself. + """ + opts = self.gopts[:] + for cmd in self.ctable.values(): + opts.extend(cmd.opts) + sfl, lfl, _ = self._compute_flags(opts, check_conflicts=False) + + lopts,largs = getopt.getopt(args, sfl, lfl) + if not largs: + return None + return self._command(largs[0]) + + def _fancy_getopt(self, args, opts, state=None): + if state is None: + state= {} + for o in opts: + if not state.has_key(o.dest): + state[o.dest] = o.default + + sfl, lfl, back = self._compute_flags(opts) + try: + lopts,args = getopt.gnu_getopt(args, sfl, lfl) + except AttributeError: + # Before Python 2.3, there was no gnu_getopt support. + # So we can't parse intermixed positional arguments + # and options. + lopts,args = getopt.getopt(args, sfl, lfl) + + for o,v in lopts: + back[o].apply(state, v) + return state, args + + def _command(self, cmd): + if not self.ctable.has_key(cmd): + self.error("unknown command: '%s'" % cmd) + return self.ctable[cmd] + + def parse(self, args): + if not args: + self.print_small_help() + sys.exit(0) + + cmd = None + try: + cmd = self._extract_command(args) + opts = self.gopts[:] + if cmd: + opts.extend(cmd.opts) + args.remove(cmd.name) + state, args = self._fancy_getopt(args, opts) + except getopt.GetoptError, e: + self.error(e, cmd) + + # Handle builtins + if self.version is not None and state["version"]: + self.print_version() + sys.exit(0) + if state["help"]: # special case for --help + if cmd: + self.print_command_help(cmd) + sys.exit(0) + cmd = self.ctable["help"] + else: + if cmd is None: + self.error("command argument required") + if str(cmd) == "help": + cmd(*args) + sys.exit(0) + return cmd, args, state + + def error(self, s, cmd=None): + print >>sys.stderr, "%s: %s" % (self.progname, s) + if cmd is not None: + self.print_command_help(cmd) + else: + self.print_small_help() + sys.exit(1) + def print_small_help(self): + print "Type '%s help' for usage" % self.progname + def print_usage_line(self): + print "usage: %s <subcommand> [options...] [args...]\n" % self.progname + def print_command_list(self): + print "Available commands (use '%s help COMMAND' for more details):\n" \ + % self.progname + cmds = self.ctable.keys() + cmds.sort() + indent = max(map(len, cmds)) + for c in cmds: + h = self.ctable[c].short_help() + print " %-*s " % (indent, c), + self._print_wrapped(h, indent+6) + def print_command_help(self, cmd): + cmd = self.ctable[str(cmd)] + print 'usage: %s %s\n' % (self.progname, cmd.usage) + self._print_wrapped(cmd.help) + def print_opts(opts, self=self): + if not opts: return + flags = [o.repr_flags() for o in opts] + indent = max(map(len, flags)) + for f,o in zip(flags, opts): + print " %-*s :" % (indent, f), + self._print_wrapped(o.help, indent+5) + print '\nCommand options:' + print_opts(cmd.opts) + print '\nGlobal options:' + print_opts(self.gopts) + + def print_version(self): + print self.version + +############################################################################### +# Options and Commands description +############################################################################### + +global_opts = [ + Option("-F", "--force", + help="force operation even if the working copy is not clean, or " + "there are pending updates"), + Option("-n", "--dry-run", + help="don't actually change anything, just pretend; " + "implies --show-changes"), + Option("-s", "--show-changes", + help="show subversion commands that make changes"), + Option("-v", "--verbose", + help="verbose mode: output more information about progress"), + OptionArg("-u", "--username", + default=None, + help="invoke subversion commands with the supplied username"), + OptionArg("-p", "--password", + default=None, + help="invoke subversion commands with the supplied password"), + OptionArg("-c", "--config-dir", metavar="DIR", + default=None, + help="cause subversion commands to consult runtime config directory DIR"), +] + +common_opts = [ + Option("-b", "--bidirectional", + value=True, + default=False, + help="remove reflected and initialized revisions from merge candidates. " + "Not required but may be specified to speed things up slightly"), + OptionArg("-f", "--commit-file", metavar="FILE", + default="svnmerge-commit-message.txt", + help="set the name of the file where the suggested log message " + "is written to"), + Option("-M", "--record-only", + value=True, + default=False, + help="do not perform an actual merge of the changes, yet record " + "that a merge happened"), + OptionArg("-r", "--revision", + metavar="REVLIST", + default="", + help="specify a revision list, consisting of revision numbers " + 'and ranges separated by commas, e.g., "534,537-539,540"'), + OptionArg("-S", "--source", "--head", + default=None, + help="specify a merge source for this branch. It can be either " + "a working directory path, a full URL, or an unambiguous " + "substring of one of the locations for which merge tracking was " + "already initialized. Needed only to disambiguate in case of " + "multiple merge sources"), +] + +command_table = { + "init": (action_init, + "init [OPTION...] [SOURCE]", + """Initialize merge tracking from SOURCE on the current working + directory. + + If SOURCE is specified, all the revisions in SOURCE are marked as already + merged; if this is not correct, you can use --revision to specify the + exact list of already-merged revisions. + + If SOURCE is omitted, then it is computed from the "svn cp" history of the + current working directory (searching back for the branch point); in this + case, %s assumes that no revision has been integrated yet since + the branch point (unless you teach it with --revision).""" % NAME, + [ + "-f", "-r", # import common opts + OptionArg("-L", "--location-type", + dest="location-type", + default="path", + help="Use this type of location identifier in the new " + + "Subversion properties; 'uuid', 'url', or 'path' " + + "(default)"), + ]), + + "avail": (action_avail, + "avail [OPTION...] [PATH]", + """Show unmerged revisions available for PATH as a revision list. + If --revision is given, the revisions shown will be limited to those + also specified in the option. + + When svnmerge is used to bidirectionally merge changes between a + branch and its source, it is necessary to not merge the same changes + forth and back: e.g., if you committed a merge of a certain + revision of the branch into the source, you do not want that commit + to appear as available to merged into the branch (as the code + originated in the branch itself!). svnmerge will automatically + exclude these so-called "reflected" revisions.""", + [ + Option("-A", "--all", + dest="avail-showwhat", + value=["blocked", "avail"], + default=["avail"], + help="show both available and blocked revisions (aka ignore " + "blocked revisions)"), + "-b", + Option("-B", "--blocked", + dest="avail-showwhat", + value=["blocked"], + help="show the blocked revision list (see '%s block')" % NAME), + Option("-d", "--diff", + dest="avail-display", + value="diffs", + default="revisions", + help="show corresponding diff instead of revision list"), + Option("--summarize", + dest="avail-display", + value="summarize", + help="show summarized diff instead of revision list"), + Option("-l", "--log", + dest="avail-display", + value="logs", + help="show corresponding log history instead of revision list"), + "-r", + "-S", + ]), + + "integrated": (action_integrated, + "integrated [OPTION...] [PATH]", + """Show merged revisions available for PATH as a revision list. + If --revision is given, the revisions shown will be limited to + those also specified in the option.""", + [ + Option("-d", "--diff", + dest="integrated-display", + value="diffs", + default="revisions", + help="show corresponding diff instead of revision list"), + Option("-l", "--log", + dest="integrated-display", + value="logs", + help="show corresponding log history instead of revision list"), + "-r", + "-S", + ]), + + "rollback": (action_rollback, + "rollback [OPTION...] [PATH]", + """Rollback previously merged in revisions from PATH. The + --revision option is mandatory, and specifies which revisions + will be rolled back. Only the previously integrated merges + will be rolled back. + + When manually rolling back changes, --record-only can be used to + instruct %s that a manual rollback of a certain revision + already happened, so that it can record it and offer that + revision for merge henceforth.""" % (NAME), + [ + "-f", "-r", "-S", "-M", # import common opts + ]), + + "merge": (action_merge, + "merge [OPTION...] [PATH]", + """Merge in revisions into PATH from its source. If --revision is omitted, + all the available revisions will be merged. In any case, already merged-in + revisions will NOT be merged again. + + When svnmerge is used to bidirectionally merge changes between a + branch and its source, it is necessary to not merge the same changes + forth and back: e.g., if you committed a merge of a certain + revision of the branch into the source, you do not want that commit + to appear as available to merged into the branch (as the code + originated in the branch itself!). svnmerge will automatically + exclude these so-called "reflected" revisions. + + When manually merging changes across branches, --record-only can + be used to instruct %s that a manual merge of a certain revision + already happened, so that it can record it and not offer that + revision for merge anymore. Conversely, when there are revisions + which should not be merged, use '%s block'.""" % (NAME, NAME), + [ + "-b", "-f", "-r", "-S", "-M", # import common opts + ]), + + "block": (action_block, + "block [OPTION...] [PATH]", + """Block revisions within PATH so that they disappear from the available + list. This is useful to hide revisions which will not be integrated. + If --revision is omitted, it defaults to all the available revisions. + + Do not use this option to hide revisions that were manually merged + into the branch. Instead, use '%s merge --record-only', which + records that a merge happened (as opposed to a merge which should + not happen).""" % NAME, + [ + "-f", "-r", "-S", # import common opts + ]), + + "unblock": (action_unblock, + "unblock [OPTION...] [PATH]", + """Revert the effect of '%s block'. If --revision is omitted, all the + blocked revisions are unblocked""" % NAME, + [ + "-f", "-r", "-S", # import common opts + ]), + + "uninit": (action_uninit, + "uninit [OPTION...] [PATH]", + """Remove merge tracking information from PATH. It cleans any kind of merge + tracking information (including the list of blocked revisions). If there + are multiple sources, use --source to indicate which source you want to + forget about.""", + [ + "-f", "-S", # import common opts + ]), +} + + +def main(args): + global opts + + # Initialize default options + opts = default_opts.copy() + logs.clear() + + optsparser = CommandOpts(global_opts, common_opts, command_table, + version="%%prog r%s\n modified: %s\n\n" + "Copyright (C) 2004,2005 Awarix Inc.\n" + "Copyright (C) 2005, Giovanni Bajo" + % (__revision__, __date__)) + + cmd, args, state = optsparser.parse(args) + opts.update(state) + + source = opts.get("source", None) + branch_dir = "." + + if str(cmd) == "init": + if len(args) == 1: + source = args[0] + elif len(args) > 1: + optsparser.error("wrong number of parameters", cmd) + elif str(cmd) in command_table.keys(): + if len(args) == 1: + branch_dir = args[0] + elif len(args) > 1: + optsparser.error("wrong number of parameters", cmd) + else: + assert False, "command not handled: %s" % cmd + + # Validate branch_dir + if not is_wc(branch_dir): + if str(cmd) == "avail": + info = None + # it should be noted here that svn info does not error exit + # if an invalid target is specified to it (as is + # intuitive). so the try, except code is not absolutely + # necessary. but, I retain it to indicate the intuitive + # handling. + try: + info = get_svninfo(branch_dir) + except LaunchError: + pass + # test that we definitely targeted a subversion directory, + # mirroring the purpose of the earlier is_wc() call + if info is None or not info.has_key("Node Kind") or info["Node Kind"] != "directory": + error('"%s" is neither a valid URL, nor a working directory' % branch_dir) + else: + error('"%s" is not a subversion working directory' % branch_dir) + + # give out some hints as to potential pathids + PathIdentifier.hint(branch_dir) + if source: PathIdentifier.hint(source) + + # Extract the integration info for the branch_dir + branch_props = get_merge_props(branch_dir) + + # Calculate source_url and source_path + report("calculate source path for the branch") + if not source: + if str(cmd) == "init": + cf_source, cf_rev, copy_committed_in_rev = get_copyfrom(branch_dir) + if not cf_source: + error('no copyfrom info available. ' + 'Explicit source argument (-S/--source) required.') + opts["source-url"] = get_repo_root(branch_dir) + cf_source + opts["source-pathid"] = PathIdentifier.from_target(opts["source-url"]) + + if not opts["revision"]: + opts["revision"] = "1-" + cf_rev + else: + opts["source-pathid"] = get_default_source(branch_dir, branch_props) + opts["source-url"] = opts["source-pathid"].get_url() + + assert is_pathid(opts["source-pathid"]) + assert is_url(opts["source-url"]) + else: + # The source was given as a command line argument and is stored in + # SOURCE. Ensure that the specified source does not end in a /, + # otherwise it's easy to have the same source path listed more + # than once in the integrated version properties, with and without + # trailing /'s. + source = rstrip(source, "/") + if not is_wc(source) and not is_url(source): + # Check if it is a substring of a pathid recorded + # within the branch properties. + found = [] + for pathid in branch_props.keys(): + if pathid.match_substring(source): + found.append(pathid) + if len(found) == 1: + # (assumes pathid is a repository-relative-path) + source_pathid = found[0] + source = source_pathid.get_url() + else: + error('"%s" is neither a valid URL, nor an unambiguous ' + 'substring of a repository path, nor a working directory' + % source) + else: + source_pathid = PathIdentifier.from_target(source) + + source_pathid = PathIdentifier.from_target(source) + if str(cmd) == "init" and \ + source_pathid == PathIdentifier.from_target("."): + error("cannot init integration source path '%s'\n" + "Its repository-relative path must differ from the " + "repository-relative path of the current directory." + % source_pathid) + opts["source-pathid"] = source_pathid + opts["source-url"] = target_to_url(source) + + # Sanity check source_url + assert is_url(opts["source-url"]) + # SVN does not support non-normalized URL (and we should not + # have created them) + assert opts["source-url"].find("/..") < 0 + + report('source is "%s"' % opts["source-url"]) + + # Get previously merged revisions (except when command is init) + if str(cmd) != "init": + opts["merged-revs"] = merge_props_to_revision_set(branch_props, + opts["source-pathid"]) + + # Perform the action + cmd(branch_dir, branch_props) + + +if __name__ == "__main__": + try: + main(sys.argv[1:]) + except LaunchError, (ret, cmd, out): + err_msg = "command execution failed (exit code: %d)\n" % ret + err_msg += cmd + "\n" + err_msg += "".join(out) + error(err_msg) + except KeyboardInterrupt: + # Avoid traceback on CTRL+C + print "aborted by user" + sys.exit(1) diff --git a/testing/subversion/svnserve b/testing/subversion/svnserve new file mode 100755 index 000000000..670fee742 --- /dev/null +++ b/testing/subversion/svnserve @@ -0,0 +1,42 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/svnserve + +PID=`pidof -o %PPID /usr/bin/svnserve` +case "$1" in + start) + stat_busy "Starting svnserve" + if [ -z "$PID" ]; then + if [ -n "$SVNSERVE_USER" ]; then + su -s '/bin/sh' $SVNSERVE_USER -c "/usr/bin/svnserve -d $SVNSERVE_ARGS" & + else + /usr/bin/svnserve -d $SVNSERVE_ARGS & + fi + fi + if [ ! -z "$PID" -o $? -gt 0 ]; then + stat_fail + else + add_daemon svnserve + stat_done + fi + ;; + stop) + stat_busy "Stopping svnserve" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon svnserve + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac diff --git a/testing/subversion/svnserve.conf b/testing/subversion/svnserve.conf new file mode 100644 index 000000000..37fb7ea10 --- /dev/null +++ b/testing/subversion/svnserve.conf @@ -0,0 +1,7 @@ +# +# Parameters to be passed to svnserve +# +#SVNSERVE_ARGS="-r /path/to/some/repos" +SVNSERVE_ARGS="" + +#SVNSERVE_USER="svn" |