mirror of
https://github.com/outbackdingo/scratchpkg.git
synced 2026-02-06 09:26:35 +00:00
40 lines
646 B
Bash
Executable File
40 lines
646 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
INDEX_DIR="/var/lib/scratchpkg/index"
|
|
|
|
source "/usr/share/scratchpkg/color"
|
|
source "/usr/share/scratchpkg/message"
|
|
|
|
if [ ! "$1" ]; then
|
|
msgerr "Please specify list file."
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f "$1" ]; then
|
|
msgerr "File '$1' not exist."
|
|
exit 1
|
|
fi
|
|
|
|
list=$(cat $1)
|
|
|
|
for i in $list; do
|
|
if [ -d $INDEX_DIR/$i ]; then
|
|
msg "$i is installed"
|
|
else
|
|
echo
|
|
msg "installing $i..."
|
|
if [ $UID != 0 ]; then
|
|
sudo scratch -p $i -i
|
|
else
|
|
scratch -p $i -i
|
|
fi
|
|
if [ ! -d $INDEX_DIR/$i ]; then
|
|
msgerr "Failed installing $i."
|
|
msgerr "Press ENTER to skip and continue, press CTRL + C to cancel."
|
|
read
|
|
fi
|
|
fi
|
|
done
|
|
|
|
exit 0
|