scripts/functions: Fix CT_ExtractGit function.
Change CT_ExtractGit so that it clones the repository, instead of just
symlinking it. After cloning, any given ref is checked out, or if no
ref is given, the HEAD of the repository is checked out.
This makes CT_Extract behave similar for git repositories as it does
for tarballs, so that it for example can be used for passing glibc-ports
as a git repository.
Signed-off-by: "Esben Haabendal" <esben.haabendal@prevas.dk>
[yann.morin.1998@anciens.enib.fr: fix incomplete var rename]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
1 Propagate the patch from base glibc that changes lll_lock_t into a plain int,
2 without using a typedef, as glibc-2.7 now does.
4 diff -durN glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
5 --- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2006-08-04 20:56:15.000000000 +0200
6 +++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h 2008-07-28 23:49:29.000000000 +0200
8 /* Our internal lock implementation is identical to the binary-compatible
9 mutex implementation. */
11 -/* Type for lock object. */
12 -typedef int lll_lock_t;
14 /* Initializers for lock. */
15 #define LLL_LOCK_INITIALIZER (0)
16 #define LLL_LOCK_INITIALIZER_LOCKED (1)
17 diff -durN glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
18 --- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c 2006-07-14 15:51:24.000000000 +0200
19 +++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c 2008-07-28 23:49:56.000000000 +0200
24 -__lll_lock_wait (lll_lock_t *futex)
25 +__lll_lock_wait (int *futex)
33 -__lll_timedlock_wait (lll_lock_t *futex, const struct timespec *abstime)
34 +__lll_timedlock_wait (int *futex, const struct timespec *abstime)
36 /* Reject invalid timeouts. */
37 if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
39 /* These don't get included in libc.so */
40 #ifdef IS_IN_libpthread
42 -lll_unlock_wake_cb (lll_lock_t *futex)
43 +lll_unlock_wake_cb (int *futex)
45 int val = atomic_exchange_rel (futex, 0);
47 diff -durN glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
48 --- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h 2006-09-07 18:34:43.000000000 +0200
49 +++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h 2008-07-28 23:50:54.000000000 +0200
51 /* Initialize locks to zero. */
52 #define LLL_MUTEX_LOCK_INITIALIZER (0)
55 -/* Type for lock object. */
56 -typedef int lll_lock_t;
59 #define lll_futex_wait(futexp, val) \
61 INTERNAL_SYSCALL_DECL (__err); \
65 static inline int __attribute__((always_inline))
66 -__lll_mutex_trylock(lll_lock_t *futex)
67 +__lll_mutex_trylock(int *futex)
69 return atomic_compare_and_exchange_val_acq (futex, 1, 0) != 0;
74 static inline int __attribute__((always_inline))
75 -__lll_mutex_cond_trylock(lll_lock_t *futex)
76 +__lll_mutex_cond_trylock(int *futex)
78 return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0;
80 #define lll_mutex_cond_trylock(lock) __lll_mutex_cond_trylock (&(lock))
83 -extern void __lll_lock_wait (lll_lock_t *futex) attribute_hidden;
84 +extern void __lll_lock_wait (int *futex) attribute_hidden;
86 static inline void __attribute__((always_inline))
87 -__lll_mutex_lock(lll_lock_t *futex)
88 +__lll_mutex_lock(int *futex)
90 if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
91 __lll_lock_wait (futex);
93 __lll_robust_mutex_lock (&(futex), id)
95 static inline void __attribute__ ((always_inline))
96 -__lll_mutex_cond_lock (lll_lock_t *futex)
97 +__lll_mutex_cond_lock (int *futex)
99 if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0)
100 __lll_lock_wait (futex);
101 @@ -167,13 +162,13 @@
102 __lll_robust_mutex_lock (&(futex), (id) | FUTEX_WAITERS)
105 -extern int __lll_timedlock_wait (lll_lock_t *futex, const struct timespec *)
106 +extern int __lll_timedlock_wait (int *futex, const struct timespec *)
108 extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *)
111 static inline int __attribute__ ((always_inline))
112 -__lll_mutex_timedlock (lll_lock_t *futex, const struct timespec *abstime)
113 +__lll_mutex_timedlock (int *futex, const struct timespec *abstime)
116 if (atomic_compare_and_exchange_bool_acq (futex, 1, 0) != 0)
120 static inline void __attribute__ ((always_inline))
121 -__lll_mutex_unlock (lll_lock_t *futex)
122 +__lll_mutex_unlock (int *futex)
124 int val = atomic_exchange_rel (futex, 0);
125 if (__builtin_expect (val > 1, 0))
129 static inline void __attribute__ ((always_inline))
130 -__lll_mutex_unlock_force (lll_lock_t *futex)
131 +__lll_mutex_unlock_force (int *futex)
133 (void) atomic_exchange_rel (futex, 0);
134 lll_futex_wake (futex, 1);
136 #define THREAD_INIT_LOCK(PD, LOCK) \
137 (PD)->LOCK = LLL_LOCK_INITIALIZER
139 -extern int lll_unlock_wake_cb (lll_lock_t *__futex) attribute_hidden;
140 +extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
142 /* The states of a lock are:
144 diff -durN glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
145 --- glibc-2.6.1.orig/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h 2006-08-04 20:54:56.000000000 +0200
146 +++ glibc-2.6.1/glibc-ports-2.6.1/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h 2008-07-28 23:51:14.000000000 +0200
148 /* Our internal lock implementation is identical to the binary-compatible
149 mutex implementation. */
151 -/* Type for lock object. */
152 -typedef int lll_lock_t;
154 /* Initializers for lock. */
155 #define LLL_LOCK_INITIALIZER (0)
156 #define LLL_LOCK_INITIALIZER_LOCKED (1)