1 |
mgorny 13/10/30 19:21:12 |
2 |
|
3 |
Modified: ChangeLog git-r3.eclass |
4 |
Log: |
5 |
Fix parallel checkout race conditions, bug #489280. |
6 |
|
7 |
Revision Changes Path |
8 |
1.1041 eclass/ChangeLog |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1041&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1041&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1040&r2=1.1041 |
13 |
|
14 |
Index: ChangeLog |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v |
17 |
retrieving revision 1.1040 |
18 |
retrieving revision 1.1041 |
19 |
diff -u -r1.1040 -r1.1041 |
20 |
--- ChangeLog 30 Oct 2013 19:14:02 -0000 1.1040 |
21 |
+++ ChangeLog 30 Oct 2013 19:21:12 -0000 1.1041 |
22 |
@@ -1,6 +1,9 @@ |
23 |
# ChangeLog for eclass directory |
24 |
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1040 2013/10/30 19:14:02 mgorny Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1041 2013/10/30 19:21:12 mgorny Exp $ |
27 |
+ |
28 |
+ 30 Oct 2013; Michał Górny <mgorny@g.o> git-r3.eclass: |
29 |
+ Fix parallel checkout race conditions, bug #489280. |
30 |
|
31 |
30 Oct 2013; Michał Górny <mgorny@g.o> python-r1.eclass, |
32 |
python-single-r1.eclass, python-utils-r1.eclass: |
33 |
|
34 |
|
35 |
|
36 |
1.22 eclass/git-r3.eclass |
37 |
|
38 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/git-r3.eclass?rev=1.22&view=markup |
39 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/git-r3.eclass?rev=1.22&content-type=text/plain |
40 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/git-r3.eclass?r1=1.21&r2=1.22 |
41 |
|
42 |
Index: git-r3.eclass |
43 |
=================================================================== |
44 |
RCS file: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v |
45 |
retrieving revision 1.21 |
46 |
retrieving revision 1.22 |
47 |
diff -u -r1.21 -r1.22 |
48 |
--- git-r3.eclass 27 Oct 2013 13:44:35 -0000 1.21 |
49 |
+++ git-r3.eclass 30 Oct 2013 19:21:12 -0000 1.22 |
50 |
@@ -1,6 +1,6 @@ |
51 |
# Copyright 1999-2013 Gentoo Foundation |
52 |
# Distributed under the terms of the GNU General Public License v2 |
53 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.21 2013/10/27 13:44:35 mgorny Exp $ |
54 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.22 2013/10/30 19:21:12 mgorny Exp $ |
55 |
|
56 |
# @ECLASS: git-r3.eclass |
57 |
# @MAINTAINER: |
58 |
@@ -579,9 +579,25 @@ |
59 |
fi |
60 |
fi |
61 |
|
62 |
+ # Note: this is a hack to avoid parallel checkout issues. |
63 |
+ # I will try to handle it without locks when I have more time. |
64 |
+ local lockfile=${GIT_DIR}/.git-r3_checkout_lock |
65 |
+ local lockfile_l=${lockfile}.${BASHPID} |
66 |
+ touch "${lockfile_l}" || die |
67 |
+ until ln "${lockfile_l}" "${lockfile}" &>/dev/null; do |
68 |
+ sleep 1 |
69 |
+ done |
70 |
+ rm "${lockfile_l}" || die |
71 |
+ |
72 |
set -- git checkout -f "${local_id}"/__main__ . |
73 |
echo "${@}" >&2 |
74 |
- "${@}" || die "git checkout ${local_id}/__main__ failed" |
75 |
+ "${@}" |
76 |
+ local ret=${?} |
77 |
+ |
78 |
+ # Remove the lock! |
79 |
+ rm "${lockfile}" || die |
80 |
+ |
81 |
+ [[ ${ret} == 0 ]] || die "git checkout ${local_id}/__main__ failed" |
82 |
|
83 |
# diff against previous revision (if any) |
84 |
local new_commit_id=$(git rev-parse --verify "${local_id}"/__main__) |