summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-02-24 11:16:43 +0000
committerdavidovski <david@davidovski.xyz>2022-02-24 11:16:43 +0000
commitb8ed545a143872e641bd4728aad98279f4a4a311 (patch)
treea267af180c96c23d2e1a7baafcd837f07b254b0c
parenta0711a7be35f6efc10d23169e22a73e38cff1e90 (diff)
made scripts posix compatible
-rwxr-xr-xxibuild/build_all.sh4
-rwxr-xr-xxibuild/build_package.sh16
-rwxr-xr-xxibuild/make_infos.sh2
3 files changed, 11 insertions, 11 deletions
diff --git a/xibuild/build_all.sh b/xibuild/build_all.sh
index dfeccd2..ee266fe 100755
--- a/xibuild/build_all.sh
+++ b/xibuild/build_all.sh
@@ -32,7 +32,7 @@ run_postinstall () {
#
install_package () {
printf "${INFO}${TABCHAR}install "
- xi -nyulq -r ${XIB_CHROOT} install $1 >> printf "${PASS}${CHECKMARK}\n"
+ xi -nyulq -r ${XIB_CHROOT} install $1 && printf "${PASS}${CHECKMARK}\n"
}
# build a package by its name
@@ -74,7 +74,7 @@ if build_all; then
exit 0
else
printf "${ERROR} Something went wrong!${NEUTRAL} Press enter to view recent log"
- read;
+ read out;
less $(ls -1 --sort time $XIB_EXPORT/repo/*/*.log | head -1 | xargs realpath)
exit 1
diff --git a/xibuild/build_package.sh b/xibuild/build_package.sh
index f81f6b8..a688cc3 100755
--- a/xibuild/build_package.sh
+++ b/xibuild/build_package.sh
@@ -58,10 +58,10 @@ fetch_source () {
if [ ! -z ${SOURCE} ]; then
- if git ls-remote -q $SOURCE $BRANCH &> /dev/null; then
+ if git ls-remote -q $SOURCE $BRANCH 2>/dev/null; then
# the source is a git repo
- git clone $SOURCE . &> /dev/null
- git checkout $BRANCH &> /dev/null
+ git clone $SOURCE . 2>/dev/null
+ git checkout $BRANCH 2>/dev/null
else
# otherwise the source is a file
@@ -116,8 +116,8 @@ make_buildscript () {
cat $BUILD_PROFILE > "$XIB_CHROOT/build/profile"
cat > "$XIB_CHROOT/build/build.sh" << "EOF"
-#!/bin/bash
-source /build/profile
+#!/bin/sh
+. /build/profile
export PKG_NAME=$(cat /build/name)
export PKG_DEST=/export
@@ -139,7 +139,7 @@ package () {
cd /build
ls
-source $PKG_NAME.xibuild
+. ./$PKG_NAME.xibuild
cd /build/source
echo "==========================PREPARE STAGE=========================="
@@ -207,7 +207,7 @@ build_pkg () {
printf "${GREEN}${CHECKMARK}\n"
printf "${BLUE}${TABCHAR}build "
- xichroot $XIB_CHROOT /build/build.sh &> $log_file || return 1
+ xichroot $XIB_CHROOT /build/build.sh > $log_file 2>&1 || return 1
printf "${GREEN}${CHECKMARK}\n"
printf "${BLUE}${TABCHAR}package "
@@ -227,7 +227,7 @@ build_pkg () {
[ -z "${XIB_CHROOT}" ] && echo "${RED}CRITICAL! ${RESET}No chroot env variable set!" && exit 1;
# import all of the functions and constants in the build file, so we know what to do
-source $BUILDFILE
+. $BUILDFILE
package_exists || build_pkg
diff --git a/xibuild/make_infos.sh b/xibuild/make_infos.sh
index 57c770d..d2601b3 100755
--- a/xibuild/make_infos.sh
+++ b/xibuild/make_infos.sh
@@ -76,7 +76,7 @@ for pkg in $list; do
info_file="$XIB_EXPORT/repo/$repo/$name.xipkg.info"
build_file="$XIB_EXPORT/repo/$repo/$name.xibuild"
- source $build_file
+ . $build_file
get_info $pkg > $info_file
sign $pkg >> $info_file