diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2018-02-17 09:57:35 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2018-02-17 09:57:35 +0100 |
commit | f196c39e26f58a561f5c127cba0734f488612c5c (patch) | |
tree | 045da57395e4e1b4f71379c7fe78d3f18baa2684 /create_glibc_shim.sh | |
parent | afcf6e9a9d006a2697c92b1069af97708a281a36 (diff) | |
download | bootstrap32-f196c39e26f58a561f5c127cba0734f488612c5c.tar.xz |
fixed all shellcheck bugs
Diffstat (limited to 'create_glibc_shim.sh')
-rwxr-xr-x | create_glibc_shim.sh | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/create_glibc_shim.sh b/create_glibc_shim.sh index d91104b..ac0c7d9 100755 --- a/create_glibc_shim.sh +++ b/create_glibc_shim.sh @@ -1,18 +1,21 @@ #!/bin/sh +# shellcheck source=./default.conf . "./default.conf" # the glibc-shim shim if test ! -f $STAGE1_CHROOT/packages/$TARGET_CPU/glibc-shim-2.26-1-$TARGET_CPU.pkg.tar.xz; then - cd $STAGE1_BUILD + cd $STAGE1_BUILD || exit 1 sudo rm -rf glibc-shim mkdir glibc-shim - cd glibc-shim + cd glibc-shim || exit 1 mkdir -p pkg/glibc-shim/usr/include cp -a $XTOOLS_ARCH/$TARGET_ARCH/sysroot/usr/include/* pkg/glibc-shim/usr/include - sudo rm -rf pkg/glibc-shim/usr/include/{linux,misc,mtd,rdma,scsi,sound,video,xen,asm,asm-generic} + for dir in linux misc mtd rdma scsi sound video xen asm asm-generic; do + sudo rm -rf pkg/glibc-shim/usr/include/$dir + done mkdir -p pkg/glibc-shim/etc cp -a $XTOOLS_ARCH/$TARGET_ARCH/sysroot/etc/rpc pkg/glibc-shim/etc/. mkdir -p pkg/glibc-shim/usr/bin @@ -52,7 +55,7 @@ if test ! -f $STAGE1_CHROOT/packages/$TARGET_CPU/glibc-shim-2.26-1-$TARGET_CPU.p cp -a $XTOOLS_ARCH/$TARGET_ARCH/sysroot/usr/share/locale pkg/glibc-shim/usr/share/. BUILDDATE=$(date '+%s') - size=`du -sk --apparent-size pkg/` + size=$(du -sk --apparent-size pkg/) size="$(( ${size%%[^0-9]*} * 1024 ))" cat > pkg/glibc-shim/.PKGINFO <<EOF pkgname = glibc @@ -64,9 +67,10 @@ size = $size arch = $TARGET_CPU EOF - cd pkg/glibc-shim + cd pkg/glibc-shim || exit 1 + # shellcheck disable=SC2035 tar cJvf - .PKGINFO * | xz > ../../glibc-shim-2.26-1-$TARGET_CPU.pkg.tar.xz - cd ../.. + cd ../.. || exit 1 cp -v ./*.pkg.tar.xz $STAGE1_CHROOT/packages/$TARGET_CPU/. rm -rf $STAGE1_CHROOT/var/cache/pacman/pkg/* |