diff options
author | davidovski <david@davidovski.xyz> | 2022-03-12 22:58:22 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-03-12 22:58:22 +0000 |
commit | 0c0496130f64b4ebe051172af86c0c332db9d5e9 (patch) | |
tree | e407edf9f03bc820068223fb84b3b28e6f4353ce /src/install.sh | |
parent | 39e1b942910758aceb83c966ff1bba976261ba0e (diff) |
made changed to make it more posix compliantv1.1.2
Diffstat (limited to 'src/install.sh')
-rw-r--r-- | src/install.sh | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/install.sh b/src/install.sh index 737f07d..198b4e5 100644 --- a/src/install.sh +++ b/src/install.sh @@ -50,7 +50,7 @@ total_filecount() { local packages=$@ local count=0 for package in $packages; do - local name=$(basename -s .xipkg $package | cut -d. -f2) + local name=$(basename $package .xipkg | cut -d. -f2) local c=$(get_package_filecount $name) count=$((count+c)) done @@ -71,12 +71,13 @@ run_postinstall () { else xichroot ${SYSROOT} "/var/lib/xipkg/postinstall/$f" fi - - rm $file && - printf "${GREEN}run postinstall for $f!\n" - + if [ "$?" == "0" ]; then + rm $file && + printf "${GREEN}run postinstall for $f!\n" + else + printf "${RED}failed running postinstall for $f!\n" + fi done - rmdir $postinstall 2> /dev/null fi } @@ -103,7 +104,7 @@ install () { local total=$(total_filecount $packages 2>/dev/null || echo 1) local files_files="" for package in $packages; do - local name=$(basename -s .xipkg $package | cut -d. -f2) + local name=$(basename package .xipkg | cut -d. -f2) ${VERBOSE} && printf "${BLACK}installing $name from $package \n${RESET}" install_package $package $name & |