[PHP4BETA] CVS update: php4/scripts
| From: | ssb | Date: | Wed, 21 Apr 1999 20:30:48 +0000 |
| Subject: | [PHP4BETA] CVS update: php4/scripts | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-255@lists.php.net to get a copy of this message | ||
Date: Wednesday April 21, 1999 @ 16:30
Author: ssb
Update of /repository/php4/scripts
In directory php:/tmp/cvs-serv19291
Modified Files:
armerge
Log Message:
merge the object files in a temporary directory
Index: php4/scripts/armerge
diff -c php4/scripts/armerge:1.2 php4/scripts/armerge:1.3
*** php4/scripts/armerge:1.2 Fri Apr 16 22:01:20 1999
--- php4/scripts/armerge Wed Apr 21 16:30:47 1999
***************
*** 34,42 ****
# merged into the output archive. The prefix used is the same as the
# directory name with "/" replaced by "_" and a "_" at the end.
#
! # $Id: armerge,v 1.2 1999/04/17 02:01:20 ssb Exp $
#
if test "$#" -lt "2"; then
echo "Usage: "
basename $0" <out-archive>
<in-archives...>"
exit 1
--- 34,47 ----
# merged into the output archive. The prefix used is the same as the
# directory name with "/" replaced by "_" and a "_" at the end.
#
! # $Id: armerge,v 1.3 1999/04/21 20:30:47 ssb Exp $
#
+ die() {
+ echo $@
+ exit 1
+ }
+
if test "$#" -lt "2"; then
echo "Usage: "basename $0" <out-archive>
<in-archives...>"
exit 1
***************
*** 44,55 ****
out_archive=$1; shift
in_archives=$@
rm -f $out_archive
for archive in $in_archives; do
! files=ar t $archive
! ar x $archive
dir=dirname $archive
if test "$dir" = "."; then
ext_files=$files
--- 49,66 ----
out_archive=$1; shift
in_archives=$@
+ cwd=pwd
+ tmpdir=/tmp/armerge$$
rm -f $out_archive
+ mkdir $tmpdir || die "can not create temporary directory $tmpdir"
+
+ ( cd $tmpdir;
+
for archive in $in_archives; do
! files=ar t $cwd/$archive
! ar x $cwd/$archive
dir=dirname $archive
if test "$dir" = "."; then
ext_files=$files
***************
*** 58,67 ****
prefix=echo $prefix | sed -e 's#^\.\._##g'
ext_files=""
for file in $files; do
! mv "$file" "$prefix$file"
ext_files="$ext_files $prefix$file"
done
fi
! ar r $out_archive $ext_files
! rm -f $ext_files
! done
--- 69,83 ----
prefix=echo $prefix | sed -e 's#^\.\._##g'
ext_files=""
for file in $files; do
! if test "$file" != "$prefix$file"; then
! mv "$file" "$prefix$file"
! fi
ext_files="$ext_files $prefix$file"
done
fi
! ar r out.a $ext_files
! done )
!
! mv $tmpdir/out.a $out_archive || die "can not create $out_archive"
! rm -rf $tmpdir
!
--
PHP 4 Beta