summaryrefslogtreecommitdiffstats
path: root/meta-filesystems/recipes-utils/xfsprogs/files/remove-install-as-user.patch
blob: e761db371fb137537c7f3f3e235e368cb3c47461 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
remove install as user

Upstream-Status: Inappropriate [configuration]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 include/buildmacros |  2 +-
 include/install-sh  | 95 ++++++++---------------------------------------------
 2 files changed, 14 insertions(+), 83 deletions(-)

diff --git a/include/buildmacros b/include/buildmacros
index 7a01880..0840d55 100644
--- a/include/buildmacros
+++ b/include/buildmacros
@@ -30,7 +30,7 @@ OBJECTS = $(ASFILES:.s=.o) \
 	  $(LFILES:.l=.o) \
 	  $(YFILES:%.y=%.tab.o)
 
-INSTALL	= $(TOPDIR)/install-sh -o $(PKG_USER) -g $(PKG_GROUP)
+INSTALL	= $(TOPDIR)/install-sh
 
 IMAGES_DIR = $(TOPDIR)/all-images
 DIST_DIR = $(TOPDIR)/dist
diff --git a/include/install-sh b/include/install-sh
index c952a71..b9d66f7 100755
--- a/include/install-sh
+++ b/include/install-sh
@@ -24,11 +24,11 @@
 #       set           set      |    yes        yes
 #
 _usage() {
-    echo "Usage: $prog [-o owner] [-g group] [-m mode] -d directory"
-    echo "or     $prog [-D] [-o owner] [-g group] [-m mode] file directory/file"
-    echo "or     $prog [-o owner] [-g group] [-m mode] file [file ...] directory"
+    echo "Usage: $prog [-m mode] -d directory"
+    echo "or     $prog [-m mode] file directory/file"
+    echo "or     $prog [-m mode] file [file ...] directory"
     echo "or     $prog -S file target  (creates \"target\" symlink)"
-    echo "or     $prog -T lt_arg [-o owner] [-g group] [-m mode] libtool.lai directory"
+    echo "or     $prog -T lt_arg [-m mode] libtool.lai directory"
     echo ""
     echo "The \$DIST_MANIFEST and \$DIST_ROOT environment variables affect the"
     echo "behaviour of this command - see comments in the script."
@@ -38,32 +38,6 @@ _usage() {
     exit 1
 }
 
-_chown ()
-{
-    _st=255
-    if [ $# -eq 3 ] ; then
-	chown $1:$2 $3
-	_st=$?
-	if [ $_st -ne 0 ] ; then
-	    if [ $REAL_UID != '0' ] ; then
-		if [ ! -f $DIST_ROOT/.chown.quiet ] ; then
-		    echo '==============================================='
-		    echo Ownership of files under ${DIST_ROOT:-/}
-		    echo cannot be changed
-		    echo '==============================================='
-		    if [ -n "$DIST_ROOT" ] ; then
-			touch $DIST_ROOT/.chown.quiet
-		    fi
-		fi
-	       _st=0
-	    fi     
-	fi
-    fi
-
-    return $_st
-}
-
-
 _manifest ()
 { 
     echo $* | sed -e 's/\/\//\//g' >>${DIST_MANIFEST:-/dev/null}
@@ -77,9 +51,6 @@ Sflag=false
 Tflag=false
 DIRMODE=755
 FILEMODE=644
-OWNER=`id -u`
-GROUP=`id -g`
-REAL_UID=$OWNER
 
 # default is to install and don't append manifest
 INSTALL=true
@@ -94,24 +65,16 @@ MANIFEST=:
 
 if $INSTALL
 then
-    CP=cp; LN=ln; MKDIR=mkdir; CHMOD=chmod; CHOWN=_chown
+    CP=cp; LN=ln; MKDIR=mkdir; CHMOD=chmod;
 else
-    CP=true; LN=true; MKDIR=true; CHMOD=true; CHOWN=true
+    CP=true; LN=true; MKDIR=true; CHMOD=true;
 fi
 
-[ -n "$DIST_ROOT" -a $REAL_UID -ne 0 ] && CHOWN=true
-
-while getopts "Dcm:d:S:o:g:T:" c $*
+while getopts "Dcm:d:S:T:" c $*
 do
    case $c in
    c)
 	;;
-   g)
-	GROUP=$OPTARG
-	;;
-   o)
-	OWNER=$OPTARG
-	;;
    m)
 	DIRMODE=`expr $OPTARG`
 	FILEMODE=$DIRMODE
@@ -146,18 +109,7 @@ then
     # first usage
     #
     $MKDIR -p $dir 
-    status=$?
-    if [ $status -eq 0 ]
-    then
-	$CHMOD $DIRMODE $dir
-	status=$?
-    fi
-    if [ $status -eq 0 ]
-    then
-	$CHOWN $OWNER $GROUP $dir
-	status=$?
-    fi
-    $MANIFEST d $DIRMODE $OWNER $GROUP ${dir#$DIST_ROOT}
+    $MANIFEST d $DIRMODE ${dir#$DIST_ROOT}
 elif $Sflag
 then
     #
@@ -203,7 +155,7 @@ then
 			install_name=$target/$solib
 			$CP $solib $install_name
 			status=$?
-			$MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$solib ${install_name#$DIST_ROOT}
+			$MANIFEST f $FILEMODE $HERE/$solib ${install_name#$DIST_ROOT}
 			break
 		fi
 	done
@@ -254,7 +206,7 @@ then
 	install_name=$target/$old_library
 	$CP $old_library $install_name
 	status=$?
-	$MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$old_library ${install_name#$DIST_ROOT}
+	$MANIFEST f $FILEMODE $HERE/$old_library ${install_name#$DIST_ROOT}
 	;;
     *)
 	echo "$prog: -T $lt_install invalid"
@@ -267,7 +219,6 @@ then
 	if [ $status -eq 0 ]
 	then
 		$CHMOD $FILEMODE $install_name
-		$CHOWN $OWNER $GROUP $install_name
 	fi
 	;;
     esac
@@ -292,23 +243,10 @@ else
 	then 
 	    if [ -f $dir/$f ]
 	    then
-		$CHMOD $FILEMODE $dir/$f
-		status=$?
-		if [ $status -eq 0 ]
-		then
-		    $CHOWN $OWNER $GROUP $dir/$f
-		    status=$?
-		fi
-		$MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f
+		$MANIFEST f $FILEMODE $HERE/$f ${dir#$DIST_ROOT}/$f
 	    else
 		$CHMOD $FILEMODE $dir
-		status=$?
-		if [ $status -eq 0 ]
-		then
-		    $CHOWN $OWNER $GROUP $dir
-		    status=$?
-		fi
-		$MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$dir ${dir#$DIST_ROOT}
+		$MANIFEST f $FILEMODE $HERE/$dir ${dir#$DIST_ROOT}
 	    fi
 	fi
     else
@@ -334,14 +272,7 @@ else
 	    status=$?
 	    if [ $status -eq 0 ]
 	    then
-		$CHMOD $FILEMODE $dir/$f
-		status=$?
-		if [ $status -eq 0 ]
-		then
-		    $CHOWN $OWNER $GROUP $dir/$f
-		    status=$?
-		fi
-		$MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f
+		$MANIFEST f $FILEMODE $HERE/$f ${dir#$DIST_ROOT}/$f
 	    fi
 	    [ $status -ne 0 ] && break
 	done
-- 
1.8.1.2