PROJET AUTOBLOG


Shaarli - Les discussions de Shaarli

Archivé

Site original : Shaarli - Les discussions de Shaarli du 23/07/2013

⇐ retour index

Easily working with multiple repositories (git, hg, etc)

samedi 14 février 2015 à 08:47
CAFAI Liens en Vrac 14/02/2015
There are situations where it is ueful to checkout multiple repositories, which might use different revision control systems, and operate upon them as a group. This is what the mr tool was designed for.

The mr tool allows you to operate upon multiple repositoresi, regardless of whether they use git, mercurial, bzr, darcs, etc.

=====================================
BONUS: PKGBUILD à jour:

# Maintainer: Jimmy Tang <jtang@tchpc.tcd.ie>
# cafai

pkgname=mr-git
pkgver=20150211
pkgrel=1
pkgdesc="The mr(1) command can checkout, update, or perform other actions on a set of repositories as if they were one combined respository."
arch=('i686' 'x86_64')
url="http://joeyh.name/code/mr/";
license=('GPL')
makedepends=('git')
depends=('perl' 'perl-libwww' 'perl-html-parser' 'perl-uri')
optdepends=('git: support for git repositories'
   'cvs: support for cvs repositories'
   'svn: support for subversion repositories'
   'mercurial: support for mercurial repositories'
   'bzr: support for bzr repositories'
   'darcs: support for darcs repositories')

_gitroot="https://github.com/joeyh/myrepos";
_gitname="myrepos"

pkgver() {
   cd "$srcdir"/$_gitname
   git log -1 --format="%cd.g%h" --date=short | sed 's/-/./g'
}


build() {
 cd "$srcdir"
 msg "Connecting to GIT server...."

 if [ -d $_gitname ] ; then
   cd $_gitname && git pull origin
   msg "The local files are updated."
 else
   git clone $_gitroot
 fi

 msg "GIT checkout done or server timeout"
 msg "Starting make..."
}

package() {
 rm -rf "$srcdir/$_gitname-build"
 git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
 cd "$srcdir/$_gitname-build"

 #
 # BUILD HERE
 #
 make || exit 1
 make test || exit 1
 install -d -m 0755 $pkgdir/usr/share/man/man1 $pkgdir/usr/bin $pkgdir/usr/lib
 install -Dm 755 mr webcheckout $pkgdir/usr/bin
 install -D mr.1 webcheckout.1 $pkgdir/usr/share/man/man1
 install -D lib/* $pkgdir/usr/lib
#git-fake-bare  git-svn  unison
}
# vim:set ts=2 sw=2 et:
(Permalink)