summaryrefslogtreecommitdiff
path: root/scripts/mkipkg
Unidiff
Diffstat (limited to 'scripts/mkipkg') (more/less context) (show whitespace changes)
-rwxr-xr-xscripts/mkipkg8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/mkipkg b/scripts/mkipkg
index a336371..2f020f4 100755
--- a/scripts/mkipkg
+++ b/scripts/mkipkg
@@ -223,81 +223,85 @@ createFileList()
223 break; 223 break;
224 fi 224 fi
225 done 225 done
226 226
227 if [ $containedInList = 0 ]; then 227 if [ $containedInList = 0 ]; then
228 if ! [ -e $file -o -L $file ]; then 228 if ! [ -e $file -o -L $file ]; then
229 echo "$self: $file not found" 229 echo "$self: $file not found"
230 missing=1 230 missing=1
231 fi 231 fi
232 realFileList=$file" $realFileList" 232 realFileList=$file" $realFileList"
233 fi 233 fi
234 done 234 done
235 235
236 _popd 236 _popd
237 237
238 if [ $missing = 1 ]; then 238 if [ $missing = 1 ]; then
239 return 1 239 return 1
240 fi 240 fi
241 241
242 setVar $2 "$realFileList" 242 setVar $2 "$realFileList"
243} 243}
244 244
245stripFile() 245stripFile()
246{ 246{
247 if [ -f $1 -a -x $1 ]; then 247 if [ ! -h $1 -a -f $1 -a -x $1 ]; then
248 $strip --strip-all $1 248 $strip -p --strip-all $1
249 fi 249 fi
250} 250}
251 251
252substFile() 252substFile()
253{ 253{
254 local oldfile=$1 254 local oldfile=$1
255 255
256 if [ ! -e $2 ]; then return 1; fi 256 if [ ! -e $2 ]; then return 1; fi
257 257
258 if [ -e $oldfile -o -L $oldfile ]; then 258 if [ -e $oldfile -o -L $oldfile ]; then
259 newfile=`echo $oldfile|sed -f $2|sed -e's,^/,,g'` 259 newfile=`echo $oldfile|sed -f $2|sed -e's,^/,,g'`
260 olddir=`dirname $oldfile` 260 olddir=`dirname $oldfile`
261 base=`basename $oldfile` 261 base=`basename $oldfile`
262 newdir=`dirname $newfile` 262 newdir=`dirname $newfile`
263 263
264# echo >&2 moving $oldfile to $newfile 264# echo >&2 moving $oldfile to $newfile
265 265
266 if [ "$newdir" = "$olddir" ]; then 266 if [ "$newdir" = "$olddir" ]; then
267 return 0 267 return 0
268 fi 268 fi
269 269
270 mkdir -p $newdir 270 mkdir -p $newdir
271 mv $olddir/$base $newfile 271 mv $olddir/$base $newfile
272 rmdir -p $olddir 2>/dev/null 272 rmdir -p $olddir 2>/dev/null
273 fi 273 fi
274} 274}
275 275
276stripFiles() 276stripFiles()
277{ 277{
278 for f in $1; do 278 for f in $1; do
279 # do not strip links
280 if [ ! -h ./$f ]
281 then
279 stripFile ./$f 282 stripFile ./$f
283 fi
280 done 284 done
281} 285}
282 286
283substFiles() 287substFiles()
284{ 288{
285 for f in $1; do 289 for f in $1; do
286 substFile ./$f 290 substFile ./$f
287 done 291 done
288} 292}
289 293
290substAndStripFiles() 294substAndStripFiles()
291{ 295{
292 for f in $1; do 296 for f in $1; do
293 stripFile ./$f 297 stripFile ./$f
294 substFile ./$f $2 298 substFile ./$f $2
295 done 299 done
296} 300}
297 301
298installScript() 302installScript()
299{ 303{
300 if [ -n "$1" -a -f "$1" ]; then 304 if [ -n "$1" -a -f "$1" ]; then
301 destfile=`basename $1` 305 destfile=`basename $1`
302 filetype=`echo $destfile|cut -d. -f2` 306 filetype=`echo $destfile|cut -d. -f2`
303 if [ -n "$filetype" ]; then destfile=$filetype; fi 307 if [ -n "$filetype" ]; then destfile=$filetype; fi