diff options
author | Joseph Graham <joseph@xylon.me.uk> | 2017-06-22 11:22:42 +0100 |
---|---|---|
committer | Joseph Graham <joseph@xylon.me.uk> | 2017-06-22 11:22:42 +0100 |
commit | c6a3c2e4c06ce86f4f40852f31fd2a37ec672a09 (patch) | |
tree | 528376eb9ced89c440ecb33b87cfaf49f9d972fe /pacman2pacman-get | |
parent | e704be65c4d8df9906e1a715c0ab58986a520be0 (diff) |
Added a config file and made it read the default cache location from
/etc/pacman.conf
Diffstat (limited to 'pacman2pacman-get')
-rw-r--r-- | pacman2pacman-get | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/pacman2pacman-get b/pacman2pacman-get index 581c793..929b6ca 100644 --- a/pacman2pacman-get +++ b/pacman2pacman-get @@ -29,15 +29,20 @@ shopt -s extglob torrent_folder='/srv/pacman2pacman/torrents' -pkg_cache_location='/var/cache/pacman/pkg' - prog_check_freq=1.4 # seconds to update download progress torrent_search_time=6 # seconds to spend scanning the mirrors for a torrent -# These variables to be moved into a config file -mirrorlist_location="/etc/pacman.d/mirrorlist" -stall_time=60 # if download is still at 0% after this much time, consider download stalled +# Find out the cache location +pkg_cache_location='/var/cache/pacman/pkg' # default location + +if cachesearch=$(grep '^[[:space:]]*CacheDir' /etc/pacman.conf) # uncommented 'CacheDir' +then + pkg_cache_location="${cachesearch##*[[:space:]=]}" # everything before the last space or = +fi + +# Read the config +source /etc/pacman2pacman.conf # Pacman2pacman should be called like this from /etc/pacman.conf: # XferCommand = /usr/bin/pacman2pacman-get %u %o |