[PATCH v2] Add pacman-syncdb: systemd service and timer for `pacman -Fy`.
Morgan Adamiec
morganamilo at archlinux.org
Mon Aug 2 21:58:59 UTC 2021
On 02/08/2021 22:35, Daniel M. Capella via pacman-contrib wrote:
> On July 31, 2021 8:32:49 PM EDT, Thiago Perrotta via pacman-contrib <pacman-contrib at lists.archlinux.org> wrote:
>> `pacman -Fy` is a modern replacement for `pkgfile`[1].
>>
>> This service/timer makes `pacman -Fy` have feature parity with
>> `pkgfile`.
>>
>> The unit files were based on both pkgfile and paccache, for consistency
>> with the existing ecosystem.
>>
>> Context: https://bbs.archlinux.org/viewtopic.php?pid=1981076
>>
>> [1]: https://wiki.archlinux.org/title/Pacman#Search_for_a_package_that_contains_a_specific_file
>>
>> Signed-off-by: Thiago Perrotta <tbperrotta at gmail.com>
>> ---
>> V2:
>>
>> - Added Signed-off-by byline
>> - Added nss-lookup.target to After= as suggested by @nl6720
>>
>> CHANGES.md | 1 +
>> src/Makefile.am | 8 ++++++--
>> src/pacman-syncdb.service.in | 12 ++++++++++++
>> src/pacman-syncdb.timer | 10 ++++++++++
>> 4 files changed, 29 insertions(+), 2 deletions(-)
>> create mode 100644 src/pacman-syncdb.service.in
>> create mode 100644 src/pacman-syncdb.timer
>>
>> diff --git a/CHANGES.md b/CHANGES.md
>> index 80f02bb..96a441b 100644
>> --- a/CHANGES.md
>> +++ b/CHANGES.md
>> @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
>>
>> ## [Unreleased]
>> ### Added
>> +- pacman-syncdb: systemd service and timer for `pacman -Fy` (https://bbs.archlinux.org/viewtopic.php?pid=1981076)
>>
>> ### Changed
>>
>> diff --git a/src/Makefile.am b/src/Makefile.am
>> index eef0590..cbc8bd0 100644
>> --- a/src/Makefile.am
>> +++ b/src/Makefile.am
>> @@ -30,7 +30,8 @@ vim_syntax__DATA = \
>> systemd_dir = ${libdir}/systemd/system
>>
>> systemd__DATA = \
>> - paccache.service paccache.timer
>> + paccache.service paccache.timer \
>> + pacman-syncdb.service pacman-syncdb.timer
>>
>> BASHSCRIPTS = \
>> checkupdates \
>> @@ -50,7 +51,8 @@ OURSCRIPTS = \
>> $(PERLSCRIPTS)
>>
>> OURFILES = \
>> - paccache.service
>> + paccache.service \
>> + pacman-syncdb.service
>>
>> EXTRA_DIST = \
>> checkupdates.sh.in \
>> @@ -60,6 +62,8 @@ EXTRA_DIST = \
>> pacdiff.sh.in \
>> paclist.sh.in \
>> paclog-pkglist.sh.in \
>> + pacman-syncdb.service.in \
>> + pacman-syncdb.timer \
>> pacscripts.sh.in \
>> pacsearch.pl.in \
>> pacsort.c \
>> diff --git a/src/pacman-syncdb.service.in b/src/pacman-syncdb.service.in
>> new file mode 100644
>> index 0000000..26cbe6d
>> --- /dev/null
>> +++ b/src/pacman-syncdb.service.in
>> @@ -0,0 +1,12 @@
>> +[Unit]
>> +Description=Download pacman fresh files databases from the server
>> +RequiresMountsFor="/var/lib/pacman/sync"
>> +After=network-online.target nss-lookup.target
>> +Wants=network-online.target
>> +
>> +[Service]
>> +Type=oneshot
>> +ExecStart=@bindir@/pacman -Fy
>> +Nice=19
>> +StandardOutput=null
>> +StandardError=journal
>> diff --git a/src/pacman-syncdb.timer b/src/pacman-syncdb.timer
>> new file mode 100644
>> index 0000000..2562443
>> --- /dev/null
>> +++ b/src/pacman-syncdb.timer
>> @@ -0,0 +1,10 @@
>> +[Unit]
>> +Description=Download pacman fresh files databases from the server weekly
>> +
>> +[Timer]
>> +OnCalendar=weekly
>> +AccuracySec=1h
>> +Persistent=true
>> +
>> +[Install]
>> +WantedBy=timers.target
>
> Pushed, thank you!
>
> --
> Best,
> Daniel <https://danielcapella.com>
>
May be a bit late now but the name of the service really should be
pacman-filesdb instead of pacman-syncdb.
Also the description is a little broken and could be something simpler
like "Refresh pacman files database".
More information about the pacman-contrib
mailing list