mirror of
https://github.com/outbackdingo/scratchpkg.git
synced 2026-02-06 17:30:19 +00:00
38 lines
595 B
Bash
Executable File
38 lines
595 B
Bash
Executable File
#!/bin/bash
|
|
|
|
index_dir="/var/spkg/index"
|
|
|
|
if [ ! "$1" ]; then
|
|
echo "specify list file"
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f "$1" ]; then
|
|
echo "file $1 not exist"
|
|
exit 1
|
|
fi
|
|
|
|
list=$(cat $1)
|
|
|
|
for i in $list; do
|
|
if [ -d $index_dir/$i ]; then
|
|
echo "$i is installed"
|
|
else
|
|
echo "installing $i..."
|
|
if [ $UID != 0 ]; then
|
|
if [ -x /usr/bin/fakeroot ]; then
|
|
echo "==> Build using fakeroot"
|
|
fakeroot scratch -p $i && sudo scratch -p $i -i
|
|
else
|
|
sudo scratch -p $i -i
|
|
fi
|
|
else
|
|
scratch -p $i -i
|
|
fi
|
|
if [ ! -d $index_dir/$i ]; then
|
|
echo "Error installing $i..."
|
|
read
|
|
fi
|
|
fi
|
|
done
|