Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch-update: add paru support for aur packages #541

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions arch-update/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ QUIET=true
WATCH=^linux.* ^pacman.*
BASE_COLOR=#5fff5f
UPDATE_COLOR=#FFFF85
# Should only have one AUR method at a time
AUR=true
#AUR_YAY=true
#AUR_PARU=true
LABEL=
```
# Configuration
Expand All @@ -51,4 +54,6 @@ _Use the environment variables above instead of these deprecated command line op
- `-b`/`--base_color`: set the base color of the output (when your system is up to date)
- `-u`/`--updates_available_color`: set the color of the output when updates are available
- `-a`/`--aur`: activate AUR update support
- `-y`/`--aur_yay`: activate AUR update support using yay
- `-p`/`--aur_paru`: activate AUR update support using paru
For the latest options call `$SCRIPT_DIR/arch-update -h`.
18 changes: 18 additions & 0 deletions arch-update/arch-update
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ def create_argparse():
default = _default('AUR_YAY', 'False', strbool),
help='Include AUR packages. Attn: Yay must be installed'
)
parser.add_argument(
'-p',
'--aur_paru',
action = 'store_const',
const = True,
default = _default('AUR_PARU', 'False', strbool),
help='Include AUR packages. Attn: Paru must be installed'
)
parser.add_argument(
'-q',
'--quiet',
Expand Down Expand Up @@ -115,6 +123,14 @@ def get_aur_yay_updates():

return aur_updates

def get_aur_paru_updates():
output = check_output(['paru', '-Qua']).decode('utf-8')
if not output:
return []

aur_updates = [line.split(' ')[0] for line in output.split('\n') if line]

return aur_updates

def matching_updates(updates, watch_list):
matches = set()
Expand All @@ -135,6 +151,8 @@ if args.aur:
updates += get_aur_yaourt_updates()
elif args.aur_yay:
updates += get_aur_yay_updates()
elif args.aur_paru:
updates += get_aur_paru_updates()

update_count = len(updates)
if update_count > 0:
Expand Down