From patchwork Sun Aug 1 00:32:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Perrotta X-Patchwork-Id: 1948 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.20) for (single-drop); Sun, 01 Aug 2021 00:39:58 +0000 (UTC) Received: from mail.archlinux.org by mail.archlinux.org with LMTP id 0JnlN13tBWH3OQAAK+/4rw (envelope-from ) for ; Sun, 01 Aug 2021 00:39:57 +0000 Received: from lists.archlinux.org (lists.archlinux.org [95.217.236.249]) (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 AFFC278C1D2; Sun, 1 Aug 2021 00:39:56 +0000 (UTC) Received: from lists.archlinux.org (localhost [IPv6:::1]) by lists.archlinux.org (Postfix) with ESMTP id 77D0269A382; Sun, 1 Aug 2021 00:39:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.archlinux.org; s=dkim-rsa; t=1627778396; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=+aLXY4vG5xh6RfosN1/B7jRCjR7EU7i7LroZ7fXmDUE=; b=d8k3JNcID/mM3JesnONXla10VNabXODSPyUAnmd+sS4C3/7xMpXrj/5Tj9WaoVaRKDCxaI bXZuEiMbiWk6g07mEzR2EwwUUyZ8SdHnYraGwfswnAsmd/aLAa/I80ppMM5TZ2TiSoh8Hc JmL83KlCinPNmHwsnId+A4W33VGhsYqpQSn/TFmVV2NlBM3/Fn7ecA6W8FMwirNWE7XX27 WnGKRs848OIL1eNVBC+mpPIl59pzpuAQ/ngXdY0JLsdzl8hOmZ3gpBwXt191e59KNJesFi L49APkVkU8Aq7wsZLAMVGdkuU31ntEoxvMhkpvJ2YQ7imNeLdSVJflQgut/VA6BJ6FBttU zq3J7wOWq9cIQI08JOvcwyC1eC6qttFfI9h8n6yy5tfkSD0mbFeM9ylikgPc5TzdLY+TvE rDgntJMbGFh98PK32AMLvctz44E5xPLMDAw44bXPTKaPjayw/V5Mii8td63g1LJ+N3jKC0 pnhfdsWgE5QTXetQhNq2gan0YpDF6pVbTUZN6InhMMvc+sk8xWfrHu2gXdxJxmNLxzgsOn Ybq3f/itKRV2fA3+ynMLyNSnSIyb+GqCM5eKmDGugKWsh+S1DO+yMm6fv1RrGPe328eEeL eG4HVlP5gJDQLxn4uZVIyDXtUKPu23NjJ5gyEAma5iQoL77/8hbVo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lists.archlinux.org; s=dkim-ed25519; t=1627778396; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=+aLXY4vG5xh6RfosN1/B7jRCjR7EU7i7LroZ7fXmDUE=; b=hV6F4kN+ckV9ErZZjXBJjvW9n6Lm7fCLWMWKVH6qcCixLZ/koS8JwnNrJU65r7BLkiG65c 3Eig61H0YCLZ0iDg== X-Original-To: pacman-contrib@lists.archlinux.org Delivered-To: pacman-contrib@lists.archlinux.org Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lists.archlinux.org (Postfix) with ESMTPS id C8A3169A366 for ; Sun, 1 Aug 2021 00:39:52 +0000 (UTC) Received: by mail-qt1-x835.google.com with SMTP id b1so9321843qtx.0 for ; Sat, 31 Jul 2021 17:39:52 -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:in-reply-to :references:mime-version:content-transfer-encoding; bh=+aLXY4vG5xh6RfosN1/B7jRCjR7EU7i7LroZ7fXmDUE=; b=EAm3xti4x98gElskLIEaRAbVfACrHseEIRSsreEu+Jm2QK7xsSXB30OTzRJLnfoVD1 dAj5ApeFQnnR54DjUp9PsaxRwQUkBbYTEJ+ovJOnf2zd52PonZfzd9x70k12t0KQQg5F tZO4OQ5LDFHxrInW0L04+0mu56XivZN4oosHzk44yniKWdYzpXsOla+inpNr7vpmJtow Cp1nqfG2nfucVB+JV1kzWX3Kr5ur0YtopSP0zqVf5lJCjrc4PqKacLzQzpFZFGJt21CE XM/IXhi5QsWbXad2+IHGI3IhmGkJwu/SZCqGCgPgu4emfF5S/05gimCUue/fpLuTihPF KvHA== X-Gm-Message-State: AOAM531LM6eCpiwFMz5HUqUzypnzMkPeCrGInh68J3Ls/7RFqH8O7xZy +9/mlp/5RL+Ou0jvNJh7lqyQFPTeID3RJQ== X-Google-Smtp-Source: ABdhPJz36lWJbdw/hsWDErBY2ukZ0QTApgreXHmGdS2I/viUJMIqT9rpRa9dsDumTXbzGSVfgfyDUA== X-Received: by 2002:a05:620a:1581:: with SMTP id d1mr8723963qkk.327.1627778003024; Sat, 31 Jul 2021 17:33:23 -0700 (PDT) Received: from valhalla.. (cpee03f49946310-cm589630b5b38a.cpe.net.cable.rogers.com. [99.250.23.181]) by smtp.gmail.com with ESMTPSA id d19sm3225691qkn.94.2021.07.31.17.33.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Jul 2021 17:33:22 -0700 (PDT) To: pacman-contrib@lists.archlinux.org Subject: [PATCH v2] Add pacman-syncdb: systemd service and timer for `pacman -Fy`. Date: Sat, 31 Jul 2021 20:32:49 -0400 Message-Id: <20210801003249.28970-1-tbperrotta@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210729202709.14628-1-tbperrotta@gmail.com> References: <20210729202709.14628-1-tbperrotta@gmail.com> 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=d8k3JNcI; dkim=pass header.d=lists.archlinux.org header.s=dkim-ed25519 header.b=hV6F4kN+; dmarc=pass (policy=none) header.from=archlinux.org; spf=pass (mail.archlinux.org: domain of pacman-contrib-bounces@lists.archlinux.org designates 95.217.236.249 as permitted sender) smtp.mailfrom=pacman-contrib-bounces@lists.archlinux.org X-Rspamd-Queue-Id: AFFC278C1D2 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_MISSING_CHARSET(2.50)[]; R_SPF_ALLOW(-0.20)[+ip4:95.217.236.249]; 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)[95.217.236.249: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:95.217.0.0/16, country:DE]; FROM_NEQ_ENVFROM(0.00)[pacman-contrib@lists.archlinux.org,pacman-contrib-bounces@lists.archlinux.org]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; R_DKIM_ALLOW(-0.20)[lists.archlinux.org:s=dkim-rsa,lists.archlinux.org:s=dkim-ed25519]; 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::835:received]; NEURAL_HAM(-0.00)[-1.000]; FREEMAIL_CC(0.00)[gmail.com]; FORGED_SENDER_MAILLIST(0.00)[] X-Rspamd-Server: mail.archlinux.org `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 --- 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