Skip to content

Commit

Permalink
fix archiver (ar) on 32 bit systems
Browse files Browse the repository at this point in the history
update package script
  • Loading branch information
tpoechtrager committed Dec 15, 2013
1 parent 3a59671 commit 8f2c1bc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
6 changes: 3 additions & 3 deletions cctools/ar/archive.c
Expand Up @@ -340,21 +340,21 @@ put_arobj(cfp, sb)
(void)sprintf(hb, HDR3, name, (long int)tv_sec,
(unsigned int)(u_short)sb->st_uid,
(unsigned int)(u_short)sb->st_gid,
sb->st_mode, sb->st_size, ARFMAG);
sb->st_mode, (int64_t)sb->st_size, ARFMAG);
lname = 0;
} else if (lname > sizeof(hdr->ar_name) || strchr(name, ' '))
(void)sprintf(hb, HDR1, AR_EFMT1, (lname + 3) & ~3,
(long int)tv_sec,
(unsigned int)(u_short)sb->st_uid,
(unsigned int)(u_short)sb->st_gid,
sb->st_mode, sb->st_size + ((lname + 3) & ~3),
sb->st_mode, (int64_t)sb->st_size + (int64_t)((lname + 3) & ~3),
ARFMAG);
else {
lname = 0;
(void)sprintf(hb, HDR2, name, (long int)tv_sec,
(unsigned int)(u_short)sb->st_uid,
(unsigned int)(u_short)sb->st_gid,
sb->st_mode, sb->st_size, ARFMAG);
sb->st_mode, (int64_t)sb->st_size, ARFMAG);
}
size = sb->st_size;
} else {
Expand Down
37 changes: 27 additions & 10 deletions package.sh
@@ -1,12 +1,29 @@
#!/usr/bin/env bash

dir=`pwd`
packagetmp=`mktemp -d`
cp -r . $packagetmp || exit $?
pushd $packagetmp >/dev/null
./cleanup.sh 2>/dev/null
rm -rf .git 2>/dev/null
rm cctools*.tar.* 2>/dev/null
tar -pczf $dir/cctools-XXX-ld64-XXX.tar.gz * || exit $?
popd >/dev/null
rm -rf $packagetmp || exit $?
set -ex

DIR=`pwd`
PACKAGETMP=`mktemp -d`

REVHASH=`git rev-parse --short HEAD`
CCTOOLSVER=`cat README.md | grep "Current Version: " | awk '{print $3}'`
LD64VER=`cat README.md | grep "Current Version: " | awk '{print $5}'`

PACKAGE=cctools-${CCTOOLSVER}-${LD64VER}_$REVHASH

mkdir $PACKAGETMP/$PACKAGE
cp -r . $PACKAGETMP/$PACKAGE

pushd $PACKAGETMP &>/dev/null

pushd $PACKAGE &>/dev/null
rm -rf .git
rm -f cctools*.tar.*
rm -f package.sh
popd &>/dev/null

XZ_OPT=-9 tar cJf $DIR/$PACKAGE.tar.xz *

popd &>/dev/null

rm -rf $PACKAGETMP

0 comments on commit 8f2c1bc

Please sign in to comment.