aur-add: support for multiple packages, remove before add
This commit is contained in:
parent
2c4f981b6c
commit
c5013ba3d7
40
aur-add
40
aur-add
@ -1,14 +1,30 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ -e $1 ]; then
|
for pkg in "$@"; do
|
||||||
pkg=/tmp/$1
|
if [ -e "$pkg" ]; then
|
||||||
cp $1 $pkg
|
pkg_archive="/tmp/$pkg"
|
||||||
sudo chown repo:repo $pkg
|
cp "$pkg" "$pkg_archive"
|
||||||
shift
|
sudo chown repo:repo "$pkg_archive"
|
||||||
sudo -u repo HOME=/data/repo local-repo repo -a $pkg "$@"
|
shift
|
||||||
else
|
|
||||||
sudo -u repo HOME=/data/repo local-repo repo -A "$@"
|
name="$(pacman -Qi --file $pkg_archive | awk -e '/Name/ { print $3 } ')"
|
||||||
fi
|
sudo -u repo HOME=/data/repo sh -c "
|
||||||
[[ "$?" != "0" ]] && exit $?
|
cd /
|
||||||
echo Now you can install the package
|
local-repo repo -r \"$name\"
|
||||||
echo $ pacman -Sy $@
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user