From f196c39e26f58a561f5c127cba0734f488612c5c Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 17 Feb 2018 09:57:35 +0100 Subject: fixed all shellcheck bugs --- create_glibc_shim.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'create_glibc_shim.sh') 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 < ../../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/* -- cgit v1.2.3-54-g00ecf