Skip to content
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
4 changes: 3 additions & 1 deletion data/completion/bash_completion.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ _pamac()

checkupdates)
COMPREPLY=( $( compgen -W '
--builddir
--builddir
-a --aur
--no-aur
-q --quiet
--devel
--no-devel
--aur-update-delay
' -- "$cur" ) )
return 0
;;
Expand Down Expand Up @@ -196,6 +197,7 @@ _pamac()
--no-confirm
--no-devel
--overwrite
--aur-update-delay
' -- "$cur" ) )
return 0
;;
Expand Down
6 changes: 6 additions & 0 deletions data/completion/fish_completion.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ __fish_pamac_subcommand upgrade -d 'Upgrade packages'

__fish_pamac_subcommand update -d 'Update your system'

# Checkupdates options
complete -c pamac -n "__fish_seen_subcommand_from checkupdates" -l aur-update-delay -x -d 'number of days to wait before showing AUR updates (0 to disable)'

# Update/Upgrade options
complete -c pamac -n "__fish_seen_subcommand_from upgrade update" -l aur-update-delay -x -d 'number of days to wait before showing AUR updates (0 to disable)'

__fish_pamac_subcommand list -r -d 'List packages, groups, repositories or files'

__fish_pamac_subcommand clone -r -d 'Clone or sync packages build files from AUR'
Expand Down
2 changes: 2 additions & 0 deletions data/completion/zsh_completion.in
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ _pamac_opts_checkupdates=(
{-q,--quiet}'[only print one line per update]'
"--devel[also check development packages updates (use with --aur)]"
"--no-devel[do not check development packages updates]"
"--aur-update-delay[number of days to wait before showing AUR updates (0 to disable)]:days:"
)

_pamac_checkupdates() {
Expand Down Expand Up @@ -214,6 +215,7 @@ _pamac_opts_updategrade=(
"--devel[also upgrade development packages (use with --aur)]"
"--no-devel[do not upgrade development packages]"
"--builddir[build directory (use with --aur), if no directory is given the one specified in pamac.conf file is used]:dir:_files"
"--aur-update-delay[number of days to wait before showing AUR updates (0 to disable)]:days:"
)

_pamac_updategrade() {
Expand Down
2 changes: 2 additions & 0 deletions data/doc/pamac.8.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ given the one specified in `pamac.conf` is used
*--quiet, -q* ::: only print one line per update
*--devel* ::: also check development packages updates (use with *--aur*)
*--no-devel* ::: do not check development packages updates
*--aur-update-delay* <days> ::: number of days to wait before showing AUR updates (0 to disable)

Exit code is 100 if updates are available.

Expand All @@ -185,6 +186,7 @@ specified by separating them with comma
*--no-devel* ::: do not upgrade development packages
*--builddir* <dir> ::: build directory (use with *--aur*), if no directory is
given the one specified in `pamac.conf` file is used
*--aur-update-delay* <days> ::: number of days to wait before showing AUR updates (0 to disable)

[[_clone]]
=== CLONE ===
Expand Down
4 changes: 4 additions & 0 deletions data/doc/pamac.conf.5.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ Options
*CheckAURVCSUpdates*::
When check updates from AUR support is enabled check for vcs updates.

*AURUpdateDelayDays =* number::
Number of days to wait before showing AUR updates.
If set to 0 the delay is disabled.

*BuildDirectory =* /path/to/builddir::
The location of the directory where AUR build files are cloned and packages built.
This configuration is overriden by the AURDEST environment variable.
Expand Down
26 changes: 20 additions & 6 deletions src/cli.vala
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,9 @@ namespace Pamac {
bool refresh_tmp_files_dbs = false;
bool download_updates = false;
string? builddir = null;
int64 aur_update_delay = -1;
try {
var options = new OptionEntry[10];
var options = new OptionEntry[11];
options[0] = { "help", 'h', 0, OptionArg.NONE, ref help, null, null };
options[1] = { "quiet", 'q', 0, OptionArg.NONE, ref quiet, null, null };
options[2] = { "aur", 'a', 0, OptionArg.NONE, ref aur, null, null };
Expand All @@ -719,6 +720,7 @@ namespace Pamac {
options[6] = { "builddir", 0, 0, OptionArg.STRING, ref builddir, null, null };
options[7] = { "refresh-tmp-files-dbs", 0, 0, OptionArg.NONE, ref refresh_tmp_files_dbs, null, null };
options[8] = { "download-updates", 0, 0, OptionArg.NONE, ref download_updates, null, null };
options[9] = { "aur-update-delay", 0, 0, OptionArg.INT64, ref aur_update_delay, null, null };
var opt_context = new OptionContext (null);
opt_context.set_help_enabled (false);
opt_context.add_main_entries (options, null);
Expand Down Expand Up @@ -761,6 +763,9 @@ namespace Pamac {
if (no_devel) {
database.config.check_aur_vcs_updates = false;
}
if (aur_update_delay >= 0) {
database.config.aur_update_delay_days = (uint64) aur_update_delay;
}
if (database.config.check_aur_vcs_updates) {
if (Posix.geteuid () == 0) {
// checking as root
Expand Down Expand Up @@ -790,8 +795,9 @@ namespace Pamac {
string? ignore = null;
bool dry_run = false;
bool no_refresh = false;
int64 aur_update_delay = -1;
try {
var options = new OptionEntry[15];
var options = new OptionEntry[16];
options[0] = { "help", 'h', 0, OptionArg.NONE, ref help, null, null };
options[1] = { "aur", 'a', 0, OptionArg.NONE, ref aur, null, null };
options[2] = { "no-aur", 0, 0, OptionArg.NONE, ref no_aur, null, null };
Expand All @@ -807,6 +813,7 @@ namespace Pamac {
options[12] = { "download-only", 'w', 0, OptionArg.NONE, ref download_only, null, null };
options[13] = { "dry-run", 'd', 0, OptionArg.NONE, ref dry_run, null, null };
options[14] = { "no-refresh", 0, 0, OptionArg.NONE, ref no_refresh, null, null };
options[15] = { "aur-update-delay", 0, 0, OptionArg.INT64, ref aur_update_delay, null, null };
var opt_context = new OptionContext (null);
opt_context.set_help_enabled (false);
opt_context.add_main_entries (options, null);
Expand Down Expand Up @@ -871,6 +878,9 @@ namespace Pamac {
if (disable_downgrade) {
database.config.enable_downgrade = false;
}
if (aur_update_delay >= 0) {
database.config.aur_update_delay_days = (uint64) aur_update_delay;
}
init_transaction ();
if (dry_run) {
transaction.dry_run = true;
Expand Down Expand Up @@ -1459,7 +1469,8 @@ namespace Pamac {
" --no-aur",
" --quiet, -q",
" --devel",
" --no-devel"};
" --no-devel",
" --aur-update-delay <%s>".printf (dgettext (null, "days"))};
foreach (unowned string option in options) {
int length = option.char_count ();
if (length > max_length) {
Expand All @@ -1471,7 +1482,8 @@ namespace Pamac {
dgettext (null, "do not check updates in AUR"),
dgettext (null, "only print one line per update"),
dgettext (null, "also check development packages updates (use with --aur)"),
dgettext (null, "do not check development packages updates")};
dgettext (null, "do not check development packages updates"),
dgettext (null, "number of days to wait before showing AUR updates (0 to disable)")};
int i = 0;
foreach (unowned string option in options) {
print_property (option, details[i], max_length);
Expand Down Expand Up @@ -1499,7 +1511,8 @@ namespace Pamac {
" --no-aur",
" --devel",
" --no-devel",
" --builddir <%s>".printf (dgettext (null, "dir"))};
" --builddir <%s>".printf (dgettext (null, "dir")),
" --aur-update-delay <%s>".printf (dgettext (null, "days"))};
foreach (unowned string option in options) {
int length = option.char_count ();
if (length > max_length) {
Expand All @@ -1519,7 +1532,8 @@ namespace Pamac {
dgettext (null, "do not upgrade packages installed from AUR"),
dgettext (null, "also upgrade development packages (use with --aur)"),
dgettext (null, "do not upgrade development packages"),
dgettext (null, "build directory (use with --aur), if no directory is given the one specified in pamac.conf file is used")};
dgettext (null, "build directory (use with --aur), if no directory is given the one specified in pamac.conf file is used"),
dgettext (null, "number of days to wait before showing AUR updates (0 to disable)")};
int i = 0;
foreach (unowned string option in options) {
print_property (option, details[i], max_length);
Expand Down
2 changes: 1 addition & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ gobject = dependency('gobject-2.0')
gio = dependency('gio-2.0')
gio_unix = dependency('gio-unix-2.0')

libpamac = dependency('pamac', version : '>=11.7.1')
libpamac = dependency('pamac', version : '>=11.7.4')

common_vala_args = ['--pkg=posix', '--vapidir=' + join_paths(meson.global_source_root(), 'vapi')]
common_c_args = ['-DGETTEXT_PACKAGE="pamac"']
Expand Down