iglu.sh: fix usage

This commit is contained in:
Ella-0 2021-05-21 09:27:37 +01:00
parent 2f236e6c10
commit eb7df4e1d2

10
iglu.sh
View file

@ -27,7 +27,7 @@ NOT IMPLEMENTED:
usage() { usage() {
echo usage: $(basename "$0") printf "${HELP}" 1>&2 echo usage: $(basename "$0") '[-biu|-l|-f|-d|-h]' '[target]' "${HELP}" 1>&2
exit 1 exit 1
} }
@ -135,7 +135,7 @@ elif [ "$iu" = "1" ]; then
# Extract new package and verify # Extract new package and verify
mkdir -p /tmp/iglunix/$bname_we || exit 1 mkdir -p /tmp/iglunix/$bname_we || exit 1
tar -xf $1 -C /tmp/iglunix/$bname_we || tar_fail tar -I zstd -xf $1 -C /tmp/iglunix/$bname_we || tar_fail
stat /tmp/iglunix/$bname_we/usr/share/iglupkg/$bname >/dev/null || stat_fail stat /tmp/iglunix/$bname_we/usr/share/iglupkg/$bname >/dev/null || stat_fail
# Check deps # Check deps
@ -151,7 +151,7 @@ elif [ "$iu" = "1" ]; then
grep -v "\[fs\]" | awk '{print length, $0}' | sort -rn | cut -d " " -f2-) grep -v "\[fs\]" | awk '{print length, $0}' | sort -rn | cut -d " " -f2-)
# Extract tar # Extract tar
tar -xf $1 -C / tar -I zstd -xf $1 -C /
rm -r /tmp/iglunix/$bname_we rm -r /tmp/iglunix/$bname_we
@ -181,13 +181,13 @@ elif [ "$i" = "1" ]; then
echo "Installing $bname_we" echo "Installing $bname_we"
continue_interactive continue_interactive
mkdir -p /tmp/iglunix/$bname_we || exit 1 mkdir -p /tmp/iglunix/$bname_we || exit 1
tar -xf $1 -C /tmp/iglunix/$bname_we || tar_fail tar -I zstd -xf $1 -C /tmp/iglunix/$bname_we || tar_fail
stat /tmp/iglunix/$bname_we/usr/share/iglupkg/$bname >/dev/null || stat_fail stat /tmp/iglunix/$bname_we/usr/share/iglupkg/$bname >/dev/null || stat_fail
deps=$(grep deps /tmp/iglunix/$bname_we/usr/share/iglupkg/$bname | tr '=' '\n' | grep -v deps | tr ':' '\n') deps=$(grep deps /tmp/iglunix/$bname_we/usr/share/iglupkg/$bname | tr '=' '\n' | grep -v deps | tr ':' '\n')
for dep in $deps; do for dep in $deps; do
stat /usr/share/iglupkg/$dep > /dev/null 2> /dev/null || dep_not_found $dep stat /usr/share/iglupkg/$dep > /dev/null 2> /dev/null || dep_not_found $dep
done done
tar -xf $1 -C / tar -I zstd -xf $1 -C /
rm -r /tmp/iglunix/$bname_we rm -r /tmp/iglunix/$bname_we
elif [ "$f" = "1" ]; then elif [ "$f" = "1" ]; then
#LIST INSTALLED FILES #LIST INSTALLED FILES