1 |
Author: zmedico |
2 |
Date: 2008-03-30 19:51:53 +0000 (Sun, 30 Mar 2008) |
3 |
New Revision: 9635 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.2/bin/doins |
7 |
main/branches/2.1.2/bin/newins |
8 |
Log: |
9 |
* Fix broken return value for doins. |
10 |
* Make newins cleanup temp files after itself. |
11 |
(trunk r9634) |
12 |
|
13 |
|
14 |
Modified: main/branches/2.1.2/bin/doins |
15 |
=================================================================== |
16 |
--- main/branches/2.1.2/bin/doins 2008-03-30 19:51:32 UTC (rev 9634) |
17 |
+++ main/branches/2.1.2/bin/doins 2008-03-30 19:51:53 UTC (rev 9635) |
18 |
@@ -28,7 +28,7 @@ |
19 |
[[ ! -d ${D}${INSDESTTREE} ]] && dodir "${INSDESTTREE}" |
20 |
|
21 |
_doins() { |
22 |
- local mysrc="$1" mydir="$2" cleanup="" |
23 |
+ local mysrc="$1" mydir="$2" cleanup="" rval |
24 |
|
25 |
if [ -L "$mysrc" ] ; then |
26 |
cp "$mysrc" "${T}" |
27 |
@@ -37,7 +37,9 @@ |
28 |
fi |
29 |
|
30 |
install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}/${mydir}" |
31 |
+ rval=$? |
32 |
[[ -n ${cleanup} ]] && rm -f "${cleanup}" |
33 |
+ return $rval |
34 |
} |
35 |
|
36 |
_xdoins() { |
37 |
@@ -46,6 +48,8 @@ |
38 |
done |
39 |
} |
40 |
|
41 |
+success=0 |
42 |
+ |
43 |
for x in "$@" ; do |
44 |
if [ -d "$x" ] ; then |
45 |
if [ "${DOINSRECUR}" == "n" ] ; then |
46 |
@@ -63,7 +67,10 @@ |
47 |
find "${x##*/}" -type d -exec dodir "${INSDESTTREE}/{}" \; |
48 |
find "${x##*/}" \( -type f -or -type l \) -print0 | _xdoins |
49 |
popd >/dev/null |
50 |
+ ((++success)) |
51 |
else |
52 |
- _doins "${x}" |
53 |
+ _doins "${x}" && ((++success)) |
54 |
fi |
55 |
done |
56 |
+ |
57 |
+[ $success -gt 0 ] && exit 0 || exit 1 |
58 |
|
59 |
Modified: main/branches/2.1.2/bin/newins |
60 |
=================================================================== |
61 |
--- main/branches/2.1.2/bin/newins 2008-03-30 19:51:32 UTC (rev 9634) |
62 |
+++ main/branches/2.1.2/bin/newins 2008-03-30 19:51:53 UTC (rev 9635) |
63 |
@@ -8,6 +8,9 @@ |
64 |
exit 1 |
65 |
fi |
66 |
|
67 |
-rm -rf "${T}/${2}" && \ |
68 |
-cp -f "${1}" "${T}/${2}" && \ |
69 |
-exec doins "${T}/${2}" |
70 |
+rm -rf "${T}/${2}" || exit $? |
71 |
+cp -f "${1}" "${T}/${2}" || exit $? |
72 |
+doins "${T}/${2}" |
73 |
+ret=$? |
74 |
+rm -rf "${T}/${2}" |
75 |
+exit $ret |
76 |
|
77 |
-- |
78 |
gentoo-commits@l.g.o mailing list |