Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
0496e2c887 | |||
a450ff9708 | |||
dd0d7f7902 | |||
840ab9254c | |||
b2dc6c01d7 |
18
README.md
18
README.md
@@ -2,15 +2,15 @@ prm
|
|||||||
---
|
---
|
||||||
A very simple AUR/ABS helper. Doesn't build packages, only gets the sources.
|
A very simple AUR/ABS helper. Doesn't build packages, only gets the sources.
|
||||||
|
|
||||||
Usage: prm [flags] <package>
|
Usage: prm [flags] <package>
|
||||||
Flags:
|
Flags:
|
||||||
-h Show this message.
|
-h Show this message.
|
||||||
-s Search for <package>.
|
-s Search for <package>.
|
||||||
-S Search only in the sync db. Implies -s.
|
-S Search only in the sync db. Implies -s.
|
||||||
-A Search only in AUR. Implies -s.
|
-A Search only in AUR. Implies -s.
|
||||||
-d Get the package sources (default). Set twice to also get the dependencies.
|
-d Get the package sources (default). Set twice to also get the dependencies.
|
||||||
-f Force downloading package sources even if they are already present in the working directory.
|
-f Force downloading package sources even if they are already present in the working directory.
|
||||||
-w <dir> Set the working directory.
|
-w <dir> Set the working directory.
|
||||||
|
|
||||||
You can override any value in the script in \$HOME/.config/prm.rc.sh
|
You can override any value in the script in \$HOME/.config/prm.rc.sh
|
||||||
By default prm downloads the sources into the current directory. Controlled by `$cfg_workdir`.
|
By default prm downloads the sources into the current directory. Controlled by `$cfg_workdir`.
|
||||||
|
20
prm
20
prm
@@ -6,8 +6,7 @@
|
|||||||
_self="${0##*/}"
|
_self="${0##*/}"
|
||||||
|
|
||||||
cfg_workdir="$PWD"
|
cfg_workdir="$PWD"
|
||||||
cfg_aur_url='https://aur.archlinux.org'
|
cfg_aur_url="https://aur.archlinux.org"
|
||||||
cfg_aur_api="${cfg_aur_url}/rpc.php"
|
|
||||||
|
|
||||||
err() { printf "$@" >&2; }
|
err() { printf "$@" >&2; }
|
||||||
|
|
||||||
@@ -66,12 +65,9 @@ aur.get() {
|
|||||||
|
|
||||||
read -r pkg_aur_info
|
read -r pkg_aur_info
|
||||||
|
|
||||||
{
|
# A temporary hack till AUR4 becomes the main version
|
||||||
read -r pkg_base
|
read -r pkg_base < <( jshon -e results -e PackageBase -u <<< "$pkg_aur_info" )
|
||||||
read -r tarball_path
|
tarball_path="/cgit/aur.git/snapshot/${pkg_base}.tar.gz"
|
||||||
} < <(
|
|
||||||
jshon -e results -e PackageBase -u -p -e URLPath -u <<< "$pkg_aur_info"
|
|
||||||
)
|
|
||||||
|
|
||||||
(( flag_force )) || {
|
(( flag_force )) || {
|
||||||
[[ -d "${cfg_workdir}/${pkg_base}" ]] && {
|
[[ -d "${cfg_workdir}/${pkg_base}" ]] && {
|
||||||
@@ -131,7 +127,7 @@ abs.get() {
|
|||||||
svn_repo='packages';;
|
svn_repo='packages';;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
svn checkout "svn://svn.archlinux.org/${svn_repo}/${1}/trunk" "${cfg_workdir}/${1}"
|
svn export "svn://svn.archlinux.org/${svn_repo}/${1}/trunk" "${cfg_workdir}/${1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
set_argv() {
|
set_argv() {
|
||||||
@@ -188,6 +184,10 @@ main() {
|
|||||||
action='search'
|
action='search'
|
||||||
flag_search_syncdb=1;;
|
flag_search_syncdb=1;;
|
||||||
|
|
||||||
|
(-u)
|
||||||
|
cfg_aur_url="$2"
|
||||||
|
shift;;
|
||||||
|
|
||||||
(-d)
|
(-d)
|
||||||
if [[ "$action" == 'get' ]]; then
|
if [[ "$action" == 'get' ]]; then
|
||||||
flag_get_deps=1
|
flag_get_deps=1
|
||||||
@@ -217,6 +217,8 @@ main() {
|
|||||||
unset flag_search_aur flag_search_syncdb
|
unset flag_search_aur flag_search_syncdb
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cfg_aur_api="${cfg_aur_url}/rpc.php"
|
||||||
|
|
||||||
[[ "$action" ]] || {
|
[[ "$action" ]] || {
|
||||||
usage
|
usage
|
||||||
return 1
|
return 1
|
||||||
|
Reference in New Issue
Block a user