From patchwork Thu Jul 29 20:27:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Perrotta X-Patchwork-Id: 1947 Return-Path: Delivered-To: patchwork@archlinux.org Received: from mail.archlinux.org [95.216.189.61] by patchwork.archlinux.org with IMAP (fetchmail-6.4.19) for (single-drop); Thu, 29 Jul 2021 20:35:44 +0000 (UTC) Received: from mail.archlinux.org by mail.archlinux.org with LMTP id SCDANx8RA2HjKgoAK+/4rw (envelope-from ) for ; Thu, 29 Jul 2021 20:35:43 +0000 Received: from lists.archlinux.org (lists.archlinux.org [IPv6:2a01:4f9:c010:9eb4::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.archlinux.org (Postfix) with ESMTPS id 42C38779729; Thu, 29 Jul 2021 20:35:43 +0000 (UTC) Received: from lists.archlinux.org (localhost [IPv6:::1]) by lists.archlinux.org (Postfix) with ESMTP id 300E167E83C; Thu, 29 Jul 2021 20:35:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.archlinux.org; s=dkim-rsa; t=1627590943; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=RQ8QcfH80uQK3Xxs8htJGgzfHjRONnGlMPgyP+AC5pM=; b=f+pe3oawTtHDJzRRzs2MenB3hyldqiukFfoUiuYjAQzpk7sfUVsxuZR1y5l5hAc5KbJArp LkvCdkR9rUqNQw4aKIEKx9QmDrA6j0M/7/A2cL0oSHsf4k6kfzoV/YqF8BSRGcW+5HSQh9 71SJG4dMb2lWF7UfjWYO8ghFOPzLFzOam9CtJBqWBSLuA2RQ0TIqa+/X9JT60uSeCbhNSm vtP9To5g+GXmCOowXZvuVOq03IaNjj3lfptFoGQZFQU01HgZSZwgJDUHVIcnTPUTl+NE/F iemnogbnHzzyqs5bwCPunr3lvqAqbWYJki2C43Cj0X4+B8ZYtWI6CCQ7+a7oQ4cFgroEoy 5vjQ5EhHytYD+csYWzRpQqdaOHVPG6fjFvEBywBr57OwXFy1H07a+kMnn5JLaWwzZnTpWf BS8Dav9/go4sEmSJd1+ZGhIZK8l2VZ+gFHSYOmp75g+Hqe8KejVtmZjJ/pLg3E6xbEW25m pDVh+KmD2bvdSyTLxBmz/N5VdSpmfZ83+2x4zQvfKR+5Rp32ExDLf6+LI/ziGAfycyas+w Pn4tjYj5kRIWDhWK4/guusqhVgFMh6OX/C9MpWJEl6bAt0Io+s4qAEG/fRkVtkozfj2l7M XaBYYTMP09hE8auNoJsRHQ+p1SsrnmB/U1IsSGFwJ90++XfXxGz0U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lists.archlinux.org; s=dkim-ed25519; t=1627590943; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=RQ8QcfH80uQK3Xxs8htJGgzfHjRONnGlMPgyP+AC5pM=; b=QjSTfBdtS6Jupqm1s/7u0MFXVlq1UNWF553JHHIcjqmCs89kZDtHBBeECdNEKOSz9p+F1c jnioZ7S2fxvnV/BA== X-Original-To: pacman-contrib@lists.archlinux.org Delivered-To: pacman-contrib@lists.archlinux.org Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lists.archlinux.org (Postfix) with ESMTPS id 12F5267E824 for ; Thu, 29 Jul 2021 20:35:29 +0000 (UTC) Received: by mail-qk1-x72a.google.com with SMTP id b20so7304181qkj.3 for ; Thu, 29 Jul 2021 13:35:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RQ8QcfH80uQK3Xxs8htJGgzfHjRONnGlMPgyP+AC5pM=; b=lGmiQ05k8dQMPyvqI/iqH8yEXpD1+ZPEZsUe9HnrFVr3jh+kQShz3LenFKAc3pda4/ ZDw1g5EfpGYYYOetfDiOxQ7bNyJaNkzG5itlotmfPCvKmu7pOPRaKdLXMTG1ghSWau14 PiSPk1PkbbA7Yx1KD5SIh9dYyIGJ7ddozZ6NYNjcwzf0aERnS67460Uq33etMeMHGyCp lvsoOqN8cGGdk+3ISvjrTI6wbiFPh2uv4hztL1XkmwmAHWMJTt4TVvJlie3xRUfb4ZEJ a1b6FPFuFNzqyoBFPvTbl46zhq8w6VBnqjoNwJl+YCR67FlOZVjwuLy8mI+8qNNudxd8 wRRA== X-Gm-Message-State: AOAM533TigK60RMorE3Nq6lXlkZgOLq8PpAtYm7DlxmvQx//WICmRI3J gxZGleh8OJSQW5YrSrXavk2yjFtOzNjfCA== X-Google-Smtp-Source: ABdhPJzaaw61AfmsyP54g2oOa05ndg87I8HQTRmqswmrDbqGtfSBz0HfAtSooAR4SWl9bs9r8LJKnw== X-Received: by 2002:a05:620a:120e:: with SMTP id u14mr7021297qkj.309.1627590439966; Thu, 29 Jul 2021 13:27:19 -0700 (PDT) Received: from valhalla.. (cpee03f49946310-cm589630b5b38a.cpe.net.cable.rogers.com. [99.250.23.181]) by smtp.gmail.com with ESMTPSA id d192sm2318363qkc.51.2021.07.29.13.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 13:27:19 -0700 (PDT) X-Google-Original-From: Thiago Perrotta To: pacman-contrib@lists.archlinux.org Subject: [PATCH] Add pacman-syncdb: systemd service and timer for `pacman -Fy`. Date: Thu, 29 Jul 2021 16:27:09 -0400 Message-Id: <20210729202709.14628-1-tbperrotta@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-BeenThere: pacman-contrib@lists.archlinux.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussion list for pacman-contrib development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Thiago Perrotta via pacman-contrib From: Thiago Perrotta Reply-To: Discussion list for pacman-contrib development Cc: Thiago Perrotta Errors-To: pacman-contrib-bounces@lists.archlinux.org Sender: "pacman-contrib" Authentication-Results: mail.archlinux.org; dkim=pass header.d=lists.archlinux.org header.s=dkim-rsa header.b=f+pe3oaw; dkim=pass header.d=lists.archlinux.org header.s=dkim-ed25519 header.b=QjSTfBdt; dmarc=pass (policy=none) header.from=archlinux.org; spf=pass (mail.archlinux.org: domain of pacman-contrib-bounces@lists.archlinux.org designates 2a01:4f9:c010:9eb4::1 as permitted sender) smtp.mailfrom=pacman-contrib-bounces@lists.archlinux.org X-Rspamd-Queue-Id: 42C38779729 X-Spamd-Result: default: False [0.09 / 15.00]; HAS_REPLYTO(0.00)[pacman-contrib@lists.archlinux.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f9:c010:9eb4::1:c]; R_MISSING_CHARSET(2.50)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; DKIM_TRACE(0.00)[lists.archlinux.org:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[archlinux.org,none]; RCVD_IN_DNSWL_MED(-0.20)[2a01:4f9:c010:9eb4::1:from]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[99.250.23.181:received]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f9::/32, country:DE]; FROM_NEQ_ENVFROM(0.00)[pacman-contrib@lists.archlinux.org,pacman-contrib-bounces@lists.archlinux.org]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[lists.archlinux.org:s=dkim-rsa,lists.archlinux.org:s=dkim-ed25519]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_MED(-2.00)[archlinux.org:dkim]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[pacman-contrib@lists.archlinux.org]; HAS_LIST_UNSUB(-0.01)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72a:received]; NEURAL_HAM(-0.00)[-1.000]; FREEMAIL_CC(0.00)[gmail.com]; FORGED_SENDER_MAILLIST(0.00)[] X-Rspamd-Server: mail.archlinux.org From: Thiago Perrotta `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 --- 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..a249045 --- /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 +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