From patchwork Sun Jul 11 01:23:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tbperrotta--- via pacman-contrib X-Patchwork-Id: 1946 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); Tue, 27 Jul 2021 08:15:36 +0000 (UTC) Received: from mail.archlinux.org by mail.archlinux.org with LMTP id yKlHHqfA/2BRywgAK+/4rw (envelope-from ) for ; Tue, 27 Jul 2021 08:15:35 +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 873DD7674BC; Tue, 27 Jul 2021 08:15:34 +0000 (UTC) Received: from lists.archlinux.org (localhost [IPv6:::1]) by lists.archlinux.org (Postfix) with ESMTP id 3FA2663E83D; Tue, 27 Jul 2021 08:15:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.archlinux.org; s=dkim-rsa; t=1627373734; 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=yQsFdH3d21KUw4h5gVt1Q4+LrTChu8r1mnulllqzcKI=; b=17RySUz+HipTQAI+ZcEX1aq+aWqFtyu6rDjy9g2RBjULCy8CvVOFvLq1dgT1QHHIpyasiP WBTBHVMH8Fx7yzWnzd3B1jZ5qkFbx6kL3/Voj9IDnBsiJ863plWkjK+77wLL2isobgJwol p8FfdkE2ecjI/HyedxgE35lE33gqU+IKj3lvsX9Z1XK7I4aF9lUzS2alUwPQgfCEhSL/L8 K7Fa569fca0zoCXoYLOBIQqHYGLOgy+q7b61Xf1UZm3WPq+LE2T8hF9kAXl2h6AsVLnCqZ 4GUpZLD+KvigOuBNbWgLqBMgqZfYJBRdoeHgOPVOYUfOFOLyhnM1LG0Py9rjzoK/WK3jI7 4Cdo9Ujol2wHhGJaiewt8jGqOkyNJco1bpDGJBc8kbMdHdK+4+b+2qFUNl42S83Fk05TdO PKGVzg0p/x3wGHW07/EqtK4wOOY2uG38LKZ1Rl3PcI6HASWvRf4AFUU50kQfjYwG49sriz fJ1/D83XfHGZx6jNAiMRkZ59P/urlNzL6zYu/kJgdK7uo+qBGZ47DNGBIY9DOkqhIuniiy WscqkYL50JT+ypRIPG6hRcbIHNbYCsQTSyyzx7DHyjQmwN+PvrWY2OGiXkU0MbTI4IAARC QA1z1/I/BZP6R13il5UfuVAafDOivTBEyE5bR7weyYz51F3o7jXQg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lists.archlinux.org; s=dkim-ed25519; t=1627373734; 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=yQsFdH3d21KUw4h5gVt1Q4+LrTChu8r1mnulllqzcKI=; b=IvD4YwZS6SRBfK0jT88MUCwF6zxNRDUHH7Uymh/PQ9RTtEIYcHXYvNkBV5RxIz3b3Lsopa Vleilz7tU7BSECDw== X-Original-To: pacman-contrib@lists.archlinux.org Delivered-To: pacman-contrib@lists.archlinux.org Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lists.archlinux.org (Postfix) with ESMTPS id 05E88231158 for ; Sun, 11 Jul 2021 01:30:57 +0000 (UTC) Received: by mail-qk1-x736.google.com with SMTP id 77so12267751qkk.11 for ; Sat, 10 Jul 2021 18:30:56 -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=yQsFdH3d21KUw4h5gVt1Q4+LrTChu8r1mnulllqzcKI=; b=qnwUw+G/FYBabN3DNFHJhf6SrJqtTC2CLOT7sMEJ9MY84frDko6N88B/h2dh2jyXeR CgmG9C9dh0pGlCMbo3mDgYLk5Ftp/GoKj8ti9Q6yTh2RRTzWXt/mV15ZLorgZrj/TqQl a/OlEmXt3jcQptQJ9bz7gH17J6tTVT5otmm0IWayD0zejR/Ed4FcevewAKfurobGeadG W6jpXr95Vj/ET0clKJ6SgeSJsjVQg1zR43uVsqgEEFIEefMH5B3L2kQ/YkRWGwIcOv6b PXBjMO7VswdJ7bSxIt29ryr8ZSP/Wd+3Zdu5doBLsgh9Jk1Ki376XtsdRYuEoOx1rT6o ivWg== X-Gm-Message-State: AOAM530cW3gqRngH/+z7EM/1T77ixdr+22ag/J+x0iIE5Z952yOlnqNr UvftQeuY9fQFeyFYUSNk9k0kb/Mmsn9qlA== X-Google-Smtp-Source: ABdhPJzwSE8q43IP2PHBalW7vNhouJcG4ylBZO/n1NToMI0Pn5McfeXp1UweMKDHb8Gj+V9KczA9OA== X-Received: by 2002:a05:620a:4451:: with SMTP id w17mr23265355qkp.437.1625966597529; Sat, 10 Jul 2021 18:23:17 -0700 (PDT) Received: from valhalla.. (cpee03f49946310-cm589630b5b38a.cpe.net.cable.rogers.com. [99.250.23.181]) by smtp.gmail.com with ESMTPSA id f18sm1594414qto.80.2021.07.10.18.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 18:23:17 -0700 (PDT) To: pacman-contrib@lists.archlinux.org Subject: [PATCH] Add pacman-syncdb: systemd service and timer for `pacman -Fy`. Date: Sat, 10 Jul 2021 21:23:06 -0400 Message-Id: <20210711012306.13212-1-tbperrotta@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 27 Jul 2021 08:15:33 +0000 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: tbperrotta--- via pacman-contrib From: tbperrotta--- via pacman-contrib Reply-To: Discussion list for pacman-contrib development Cc: tbperrotta@gmail.com 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=17RySUz+; dkim=pass header.d=lists.archlinux.org header.s=dkim-ed25519 header.b=IvD4YwZS; 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: 873DD7674BC X-Spamd-Result: default: False [1.09 / 15.00]; HAS_REPLYTO(0.00)[pacman-contrib@lists.archlinux.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_MISSING_CHARSET(2.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f9:c010:9eb4::1]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_NONE(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]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; DATE_IN_PAST(1.00)[390]; 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::736: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 --- 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 bd0daf5..a3fd982 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