config/shell/debian: check for add-apt-repository
This commit is contained in:
parent
50f3d4bef1
commit
d4f0258695
|
@ -33,17 +33,6 @@ uma() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
alias aptrepo='sudo add-apt-repository'
|
|
||||||
_aptrepo_n="$(test "$OSTYPE" != "cygwin" && add-apt-repository --help | grep -- "-n")"
|
|
||||||
aptrepon() {
|
|
||||||
test $_aptrepo_n && aptrepo -y -n "$@" || aptrepo -y "$@"
|
|
||||||
}
|
|
||||||
aptrepos() {
|
|
||||||
for repo in "$@"
|
|
||||||
do aptrepon $repo
|
|
||||||
done
|
|
||||||
aptupdate
|
|
||||||
}
|
|
||||||
alias aptinstall='sudo apt-get install'
|
alias aptinstall='sudo apt-get install'
|
||||||
aptinstalls() {
|
aptinstalls() {
|
||||||
apt-cache show "$1" | grep --color=never '\(Version\|Description\):'
|
apt-cache show "$1" | grep --color=never '\(Version\|Description\):'
|
||||||
|
@ -53,6 +42,19 @@ aptinstalli() {
|
||||||
apt download $1
|
apt download $1
|
||||||
sudo dpkg --ignore-depends=$2 -i $1*.deb
|
sudo dpkg --ignore-depends=$2 -i $1*.deb
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if which add-apt-repository >/dev/null; then
|
||||||
|
alias aptrepo='sudo add-apt-repository'
|
||||||
|
_aptrepo_n="$(add-apt-repository --help | grep -- "-n")"
|
||||||
|
aptrepon() {
|
||||||
|
test $_aptrepo_n && aptrepo -y -n "$@" || aptrepo -y "$@"
|
||||||
|
}
|
||||||
|
aptrepos() {
|
||||||
|
for repo in "$@"
|
||||||
|
do aptrepon $repo
|
||||||
|
done
|
||||||
|
aptupdate
|
||||||
|
}
|
||||||
aptrepoinstall() {
|
aptrepoinstall() {
|
||||||
aptrepo -yu $1
|
aptrepo -yu $1
|
||||||
if (( $# > 1 ))
|
if (( $# > 1 ))
|
||||||
|
@ -60,6 +62,7 @@ aptrepoinstall() {
|
||||||
else aptinstall "${1##*/}"
|
else aptinstall "${1##*/}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
# Gets the download url for the latest release of a package provided via GitHub Releases
|
# Gets the download url for the latest release of a package provided via GitHub Releases
|
||||||
# Usage: ghrelease USER REPO [PATTERN]
|
# Usage: ghrelease USER REPO [PATTERN]
|
||||||
|
|
Loading…
Reference in New Issue