summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-02-23 14:07:22 +0000
committerdavidovski <david@davidovski.xyz>2022-02-23 14:07:22 +0000
commita0711a7be35f6efc10d23169e22a73e38cff1e90 (patch)
tree8bafdb0eb8d809e7d279b269953ba4e48a6862a3
parenteafdfcf7020757b12651a71660f2e1a12af7bc97 (diff)
made all scripts posix compliant
-rwxr-xr-xbuild.sh4
-rwxr-xr-xxibuild/build_all.sh14
-rwxr-xr-xxibuild/build_order.pm2
-rwxr-xr-xxibuild/build_package.sh7
-rwxr-xr-xxibuild/make_infos.sh10
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"