squidpm

the squid package manager
git clone git://squid-tech.com/squidpm.git
Log | Files | Refs | README | LICENSE

commit 3f8a756371184c4a0b380d9ebb14784af40275e2
parent ae2aff991f869a039d4b107628d9dfee8f52e895
Author: Josh Moore <jxm5210@rit.edu>
Date:   Wed, 15 Jan 2020 09:13:05 -0500

Fix syntax errors

Diffstat:
Mpackages/all | 8++++----
Mpackages/direwolf | 8++++----
Mpackages/example | 8++++----
Mpackages/squidpm | 8++++----
Msquidpm.sh | 24+++++++++++++-----------
5 files changed, 29 insertions(+), 27 deletions(-)

diff --git a/packages/all b/packages/all @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # This is a special package that performs the specified operation # on all available packages. @@ -8,7 +8,7 @@ me=$(basename "$0") # the directory of this package mydir=$(dirname "$0") -if [ $1 == "install" ]; then +if [ $1 = "install" ]; then # installation behavior for this package # make, make install, etc echo "Installing all squidpm packages..." @@ -18,7 +18,7 @@ if [ $1 == "install" ]; then squidpm install $(basename $f) fi done -elif [ $1 == "uninstall" ]; then +elif [ $1 = "uninstall" ]; then # uninstallation behavior for this package echo "Uninstalling all installed packages..." @@ -28,7 +28,7 @@ elif [ $1 == "uninstall" ]; then squidpm uninstall $(basename $f) fi done -elif [ $1 == "update" ]; then +elif [ $1 = "update" ]; then # update behavior for this package echo "Updating all installed packages..." diff --git a/packages/direwolf b/packages/direwolf @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # set this to the public git url of the package GITURL=https://github.com/wb2osz/direwolf.git @@ -11,7 +11,7 @@ mydir=$(dirname "$0") mkdir -p $mydir/../repos/$me cd $mydir/../repos/$me -if [ $1 == "install" ]; then +if [ $1 = "install" ]; then # clone the repo git clone $GITURL . @@ -20,7 +20,7 @@ if [ $1 == "install" ]; then sudo make install make install-conf echo "Installed direwolf." -elif [ $1 == "uninstall" ]; then +elif [ $1 = "uninstall" ]; then # uninstallation behavior for this package make clean @@ -35,7 +35,7 @@ elif [ $1 == "uninstall" ]; then rm -f ~/telem-m0xer-3.txt echo "Uninstalled direwolf." -elif [ $1 == "update" ]; then +elif [ $1 = "update" ]; then # update behavior for this package git pull make diff --git a/packages/example b/packages/example @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # This is an example package management script that could serve as a @@ -28,21 +28,21 @@ mydir=$(dirname "$0") mkdir -p $mydir/../repos/$me cd $mydir/../repos/$me -if [ $1 == "install" ]; then +if [ $1 = "install" ]; then # clone the repo #git clone $GITURL . # installation behavior for this package # make, make install, etc echo "Installed example package!" -elif [ $1 == "uninstall" ]; then +elif [ $1 = "uninstall" ]; then # uninstallation behavior for this package cd .. rm -rf $me echo "Uninstalled example package!" -elif [ $1 == "update" ]; then +elif [ $1 = "update" ]; then # update behavior for this package echo "Updated example package!" fi diff --git a/packages/squidpm b/packages/squidpm @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # set this to the public git url of the package GITURL=https://github.com/joshiemoore/squidpm.git @@ -10,14 +10,14 @@ mydir=$(dirname "$0") cd $mydir/../ -if [ $1 == "install" ]; then +if [ $1 = "install" ]; then # installation behavior for this package # create symlinks sudo ln -s $PWD/squidpm.sh /usr/bin/squidpm sudo ln -s $PWD $PWD/repos/squidpm echo "Installed squidpm!" -elif [ $1 == "uninstall" ]; then +elif [ $1 = "uninstall" ]; then # uninstallation behavior for this package # remove symlinks @@ -25,7 +25,7 @@ elif [ $1 == "uninstall" ]; then sudo rm $PWD/repos/squidpm echo "Uninstalled squidpm." -elif [ $1 == "update" ]; then +elif [ $1 = "update" ]; then # update behavior for this package git pull fi diff --git a/squidpm.sh b/squidpm.sh @@ -1,3 +1,5 @@ +#!/bin/bash + # The Squid Package Manager # Copyright (C) 2020 Joshua Moore # @@ -31,7 +33,7 @@ fi SPMDIR=$(dirname $(readlink -f "$0")) if [ "$#" -eq 1 ]; then - if [ $1 == "list" ]; then + if [ $1 = "list" ]; then # list all installed packages ls -1 $SPMDIR/repos/ exit @@ -52,7 +54,7 @@ fi mkdir -p $SPMDIR/repos/ -if [ $1 == "install" ]; then +if [ $1 = "install" ]; then # verify the package isn't already installed if [ -d $SPMDIR/repos/$2 ]; then echo "Package '$2' already installed." @@ -60,29 +62,29 @@ if [ $1 == "install" ]; then fi # if not, install the package - /bin/sh $SPMDIR/packages/$2 install -elif [ $1 == "uninstall" ]; then + /bin/bash $SPMDIR/packages/$2 install +elif [ $1 = "uninstall" ]; then # verify that the package is installed - if [[ (! -d $SPMDIR/repos/$2 && $2 != "all") ]]; then + if [[ ! -d $SPMDIR/repos/$2 && $2 != "all" ]]; then echo "Package '$2' is not installed." exit fi # if so, uninstall the package - /bin/sh $SPMDIR/packages/$2 uninstall -elif [ $1 == "update" ]; then + /bin/bash $SPMDIR/packages/$2 uninstall +elif [ $1 = "update" ]; then # verify that the package is installed - if [[ (! -d $SPMDIR/repos/$2 && $2 != "all") ]]; then + if [[ ! -d $SPMDIR/repos/$2 && $2 != "all" ]]; then echo "Package '$2' is not installed." exit fi # if so, update the package - /bin/sh $SPMDIR/packages/$2 update -elif [ $1 == "check" ]; then + /bin/bash $SPMDIR/packages/$2 update +elif [ $1 = "check" ]; then # check whether the package is installed -if [[ -d $SPMDIR/repos/$2 ]]; then + if [[ -d $SPMDIR/repos/$2 ]]; then exit 1 else exit 0