2014-10-19 15:27:33 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-01-10 07:39:34 +00:00
|
|
|
for pkg in "$@"; do
|
|
|
|
if [ -e "$pkg" ]; then
|
|
|
|
pkg_archive="/tmp/$pkg"
|
|
|
|
cp "$pkg" "$pkg_archive"
|
|
|
|
sudo chown repo:repo "$pkg_archive"
|
|
|
|
shift
|
|
|
|
|
|
|
|
name="$(pacman -Qi --file $pkg_archive | awk -e '/Name/ { print $3 } ')"
|
|
|
|
sudo -u repo HOME=/data/repo sh -c "
|
|
|
|
cd /
|
|
|
|
local-repo repo -r \"$name\"
|
|
|
|
local-repo repo -a \"$pkg_archive\"
|
|
|
|
"
|
|
|
|
|
|
|
|
else
|
|
|
|
name="$@"
|
|
|
|
|
|
|
|
sudo -u repo HOME=/data/repo sh -c "
|
|
|
|
cd /
|
|
|
|
local-repo repo -r \"$pkg\"
|
|
|
|
local-repo repo -A \"$pkg\"
|
|
|
|
"
|
|
|
|
fi
|
|
|
|
|
|
|
|
[[ "$?" != "0" ]] && exit $?
|
|
|
|
echo Now you can install the package
|
|
|
|
echo \$ pacman -Sy $name
|
|
|
|
done
|