/[gentoo-x86]/eclass/git-r3.eclass
Gentoo

Diff of /eclass/git-r3.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.21 Revision 1.22
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.21 2013/10/27 13:44:35 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.22 2013/10/30 19:21:12 mgorny Exp $
4 4
5# @ECLASS: git-r3.eclass 5# @ECLASS: git-r3.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Michał Górny <mgorny@gentoo.org> 7# Michał Górny <mgorny@gentoo.org>
8# @BLURB: Eclass for fetching and unpacking git repositories. 8# @BLURB: Eclass for fetching and unpacking git repositories.
577 else 577 else
578 die "Logic error: no local clone of ${repos[0]}. git-r3_fetch not used?" 578 die "Logic error: no local clone of ${repos[0]}. git-r3_fetch not used?"
579 fi 579 fi
580 fi 580 fi
581 581
582 # Note: this is a hack to avoid parallel checkout issues.
583 # I will try to handle it without locks when I have more time.
584 local lockfile=${GIT_DIR}/.git-r3_checkout_lock
585 local lockfile_l=${lockfile}.${BASHPID}
586 touch "${lockfile_l}" || die
587 until ln "${lockfile_l}" "${lockfile}" &>/dev/null; do
588 sleep 1
589 done
590 rm "${lockfile_l}" || die
591
582 set -- git checkout -f "${local_id}"/__main__ . 592 set -- git checkout -f "${local_id}"/__main__ .
583 echo "${@}" >&2 593 echo "${@}" >&2
594 "${@}"
595 local ret=${?}
596
597 # Remove the lock!
598 rm "${lockfile}" || die
599
584 "${@}" || die "git checkout ${local_id}/__main__ failed" 600 [[ ${ret} == 0 ]] || die "git checkout ${local_id}/__main__ failed"
585 601
586 # diff against previous revision (if any) 602 # diff against previous revision (if any)
587 local new_commit_id=$(git rev-parse --verify "${local_id}"/__main__) 603 local new_commit_id=$(git rev-parse --verify "${local_id}"/__main__)
588 local old_commit_id=$( 604 local old_commit_id=$(
589 git rev-parse --verify "${local_id}"/__old__ 2>/dev/null 605 git rev-parse --verify "${local_id}"/__old__ 2>/dev/null

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.20