From c7818ab379eb936d535e63f573f2bc093aefcf95 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Thu, 10 May 2018 09:30:10 -0700 Subject: [PATCH] Yeah, unar's a package, just use Debian's The Unarchiver for UNIX is available on Debian, Ubuntu, Fedora, and on macOS under the package name "unar". It's in Arch Linux as well called "unarchiver". What this means is we really have no need whatsoever to download the source code and compile it, so we won't. Also made install_archive_tools ignore args it doesn't understand. --- scripts/install_archive_tools | 53 +++++++++++------------------------ 1 file changed, 17 insertions(+), 36 deletions(-) diff --git a/scripts/install_archive_tools b/scripts/install_archive_tools index 21f974d..4efff4e 100755 --- a/scripts/install_archive_tools +++ b/scripts/install_archive_tools @@ -90,52 +90,33 @@ install_shk2image() { } install_unar() { + # Remove locally installed unar if found + if [[ -f /usr/local/bin/unar ]]; then + echo "Removing local unar in favor of the system package" + sudo rm -f /usr/local/bin/lsar + sudo rm -f /usr/local/bin/unar + sudo rm -f /usr/local/man/man1/lsar.1 + sudo rm -f /usr/local/man/man1/unar.1 + fi + # http://wakaba.c3.cx/s/apps/unarchiver.html if ! hash unar 2> /dev/null; then - - ### ArchiveTools: Install unar package - echo "A2CLOUD: Installing The Unarchiver..." - - # jessie and later: Just use the unar package + echo "a2cloud: Installing unar (The Unarchiver)..." sudo apt-get -y install unar sudo apt-get clean - - # If all else fails, compile from source. - if ! hash unar 2> /dev/null; then - # Dependencies: build-deps for unar - sudo apt-get -y install build-essential libgnustep-base-dev libz-dev libbz2-dev libssl-dev libicu-dev unzip - sudo apt-get clean - - local unarWork="$(mktemp -d /tmp/unar.XXXXXXXXXXXX)" - pushd "$unarWork" >/dev/null - if [[ $useExternalURL ]]; then - wget -O unar-1.8.1.zip https://github.com/incbee/Unarchiver/archive/unar-1.8.1.zip - unzip -o unar-1.8.1.zip &> /dev/null - fi - if [ ! -d *Unarchiver*/XADMaster ]; then # need single bracket for glob - wget -O unar-1.8.1.zip "${a2cBinaryURL}/source/unar-1.8.1.zip" - unzip -o unar-1.8.1.zip &> /dev/null - fi - cd *Unarchiver*/XADMaster - make -f Makefile.linux - sudo mv lsar unar /usr/local/bin - cd ../Extra - sudo mkdir -p /usr/local/man/man1 - sudo mv lsar.1 unar.1 /usr/local/man/man1 - popd >/dev/null - rm -rf "$unarWork" - sudo mandb &> /dev/null - fi else - echo "A2CLOUD: The Unarchiver has already been installed." + echo "a2cloud: unar has already been installed." fi } noPicoPkg= -if [[ $1 == -c ]]; then - noPicoPkg=1 -fi +while [[ $1 ]]; do + if [[ $1 == -c ]]; then + noPicoPkg=1 + fi + shift +done install_nulib2 install_sciibin install_shk2image