Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11657 - main/trunk/bin
Date: Wed, 08 Oct 2008 18:03:14
Message-Id: E1KndNL-0005S8-St@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-10-08 18:03:07 +0000 (Wed, 08 Oct 2008)
3 New Revision: 11657
4
5 Modified:
6 main/trunk/bin/doins
7 Log:
8 Use separate temp directories in order to avoid potential name collisions.
9
10
11 Modified: main/trunk/bin/doins
12 ===================================================================
13 --- main/trunk/bin/doins 2008-10-08 16:16:35 UTC (rev 11656)
14 +++ main/trunk/bin/doins 2008-10-08 18:03:07 UTC (rev 11657)
15 @@ -25,8 +25,9 @@
16 exit 1
17 fi
18
19 -TMP=$T/.doins_tmp
20 -mkdir "$TMP"
21 +export TMP=$T/.doins_tmp
22 +# Use separate directories to avoid potential name collisions.
23 +mkdir -p "$TMP"/{1,2}
24
25 [[ ! -d ${D}${INSDESTTREE} ]] && dodir "${INSDESTTREE}"
26
27 @@ -34,8 +35,8 @@
28 local mysrc="$1" mydir="$2" cleanup="" rval
29
30 if [ -L "$mysrc" ] ; then
31 - cp "$mysrc" "$TMP"
32 - mysrc="$TMP/${mysrc##*/}"
33 + cp "$mysrc" "$TMP/2"
34 + mysrc="$TMP/2/${mysrc##*/}"
35 cleanup=${mysrc}
36 fi
37
38 @@ -77,14 +78,14 @@
39 pushd "${PWD%/*}" >/dev/null
40 done
41 if [[ $x != $x_orig ]] ; then
42 - mv "$x" "$TMP/$x_orig"
43 - pushd "$TMP" >/dev/null
44 + mv "$x" "$TMP/1/$x_orig"
45 + pushd "$TMP/1" >/dev/null
46 fi
47 find "$x_orig" -type d -exec dodir "${INSDESTTREE}/{}" \;
48 find "$x_orig" \( -type f -or -type l \) -print0 | _xdoins
49 if [[ $x != $x_orig ]] ; then
50 popd >/dev/null
51 - mv "$TMP/$x_orig" "$x"
52 + mv "$TMP/1/$x_orig" "$x"
53 fi
54 while popd >/dev/null 2>&1 ; do true ; done
55 ((++success))