From a0711a7be35f6efc10d23169e22a73e38cff1e90 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 23 Feb 2022 14:07:22 +0000 Subject: made all scripts posix compliant --- build.sh | 4 ++-- xibuild/build_all.sh | 14 ++------------ xibuild/build_order.pm | 2 +- xibuild/build_package.sh | 7 ++++--- xibuild/make_infos.sh | 10 +++++----- 5 files changed, 14 insertions(+), 23 deletions(-) diff --git a/build.sh b/build.sh index 2340de4..30ce94a 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source xib_env +. ./xib_env cd xibuild ./prepare.sh diff --git a/xibuild/build_all.sh b/xibuild/build_all.sh index cf99f05..dfeccd2 100755 --- a/xibuild/build_all.sh +++ b/xibuild/build_all.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh ERROR="\033[0;31m" INFO="\033[0;34m" @@ -32,17 +32,7 @@ run_postinstall () { # install_package () { printf "${INFO}${TABCHAR}install " - local checksum=$(md5sum $1 | cut -d' ' -f1) - - if grep -q "^${checksum}$" $INSTALLED_PACKAGES; then - printf "${RESET}${CHECKMARK}\n" - else - tar -h --no-overwrite-dir -xf $1 -C $XIB_CHROOT - echo $checksum >> $INSTALLED_PACKAGES - - printf "${PASS}${CHECKMARK}\n" - return 0 - fi + xi -nyulq -r ${XIB_CHROOT} install $1 >> printf "${PASS}${CHECKMARK}\n" } # build a package by its name diff --git a/xibuild/build_order.pm b/xibuild/build_order.pm index 606839c..c3f31f6 100755 --- a/xibuild/build_order.pm +++ b/xibuild/build_order.pm @@ -38,7 +38,7 @@ sub list_dependencies{ open (my $fh, "<", $file) or warn "Cannot open $file"; while (my $line = <$fh>) { - if ($line =~ /DEPS=\((.+)\)/) { + if ($line =~ /DEPS="(.+)"/) { my @words = split(/ /, $1); push(@deps, @words); } diff --git a/xibuild/build_package.sh b/xibuild/build_package.sh index 7152464..f81f6b8 100755 --- a/xibuild/build_package.sh +++ b/xibuild/build_package.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh GREEN="\033[0;32m" BLUE="\033[0;34m" @@ -78,9 +78,10 @@ fetch_source () { fi fi + set -- ${ADDITIONAL} # download additional files - if [ ! -z ${ADDITIONAL} ]; then - for url in ${ADDITIONAL[*]}; do + if [ "$#" != 0 ]; then + for url in $@; do local name=$(basename $url) curl -SsL $url > $src_dir/$name done diff --git a/xibuild/make_infos.sh b/xibuild/make_infos.sh index 9c57910..57c770d 100755 --- a/xibuild/make_infos.sh +++ b/xibuild/make_infos.sh @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh # TODO remember to update this if there are ever changes -XIPKG_INFO_VERSION='02' +XIPKG_INFO_VERSION='03' get_info() { local name=$(basename -s ".xipkg" $1) @@ -20,8 +20,8 @@ get_info() { echo "VERSION=$pkg_ver" echo "SOURCE=$SOURCE" echo "DATE=$(date -r $1)" - echo "DEPS=(${DEPS[*]})" - echo "MAKE_DEPS=(${MAKE_DEPS[*]})" + echo "DEPS=${DEPS}" + echo "MAKE_DEPS=${MAKE_DEPS}" } sign () { @@ -44,7 +44,7 @@ list_line() { list_deps() { local info_file=$1 - local deps=$(grep -a "^DEPS=(" $info_file | sed -rn "s/DEPS=\((.*)\)/\1/p") + local deps=$(grep -a "^DEPS=\"" $info_file | sed -rn "s/DEPS=\"(.*)\"/\1/p") local name=$(basename -s ".xipkg.info" $info_file) echo "$name: $deps" -- cgit v1.2.1