unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Bruno Victal <mirai@makinata.eu>
Cc: 60735@debbugs.gnu.org
Subject: [bug#60735] [PATCH v2 2/3] system: Deprecate hosts-file.
Date: Mon, 23 Jan 2023 23:37:49 +0100	[thread overview]
Message-ID: <87o7qoyj0i.fsf@gnu.org> (raw)
In-Reply-To: <a814b828bfbbbe13791cb5ab74bf45a1ad617ab5.1674060850.git.mirai@makinata.eu> (Bruno Victal's message of "Wed, 18 Jan 2023 16:54:13 +0000")

Bruno Victal <mirai@makinata.eu> skribis:

> * gnu/system.scm (operating-system-hosts-file): Deprecate procedure.
> (warn-hosts-file-field-deprecation): New procedure, helper for
> deprecated variable).
> (operating-system)[hosts-file]: Use helper to warn deprecated field.
> (operating-system-default-essential-services)
> (hurd-default-essential-services): Use hosts-service-type.
> (local-host-aliases): Return a list of host-entry records.
> (default-/etc/hosts): Remove procedure.
> (operating-system-etc-service): Remove hosts file.
> * doc/guix.texi (operating-system Reference)
> (Networking Services) (Virtualization Services): Rewrite documentation
> entries to use hosts-service-type.
> * gnu/tests/ganeti.scm: Use hosts-service-type extension.
> ---
>
> WIP, the ganeti tests fail because host-name is added as an alias of localhost.

Before these patches, ‘host-name’ was already an alias of ‘localhost’.
Is there something else interfering?

> +    (simple-service 'block-facebook-hosts hosts-service-type
> +                    (let ((host-pairs
> +                            (filter-map
> +                              (lambda (x)
> +                                (and (not (or (string-null? x)
> +                                              (string-prefix? "#" x)))
> +	                             (remove string-null?
> +                                             (string-split
> +                                               x
> +                                               char-set:whitespace))))
> +                              (string-split %facebook-host-aliases #\newline))))
> +                      (map (match-lambda
> +                             ((addr name)
> +                              (host addr name)))
> +                           host-pairs)))

It doesn’t matter because it’s removed in the commit that follows I
think using ‘string-tokenize’ instead of ‘string-split’ may bring
simplifications.

> +++ b/gnu/system.scm
> @@ -14,6 +14,7 @@
>  ;;; Copyright © 2020, 2022 Efraim Flashner <efraim@flashner.co.il>
>  ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
>  ;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework@protonmail.com>
> +;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -31,6 +32,7 @@
>  ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
>  
>  (define-module (gnu system)
> +  #:use-module (guix discovery)

Do we really need this module?

Otherwise LGTM.

Ludo’.




  reply	other threads:[~2023-01-23 22:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-11 17:26 [bug#60735] [PATCH 0/2] Implement etc-hosts-service-type Bruno Victal
2023-01-11 17:28 ` [bug#60735] [PATCH 1/2] services: Add etc-hosts-service-type Bruno Victal
2023-01-14 17:30   ` [bug#60735] [PATCH 0/2] Implement etc-hosts-service-type Ludovic Courtès
2023-01-11 17:28 ` [bug#60735] [PATCH 2/2] services: Add block-facebook-hosts-service-type Bruno Victal
2023-01-18 16:54 ` [bug#60735] [PATCH v2 1/3] services: Add etc-hosts-service-type Bruno Victal
2023-01-18 16:54   ` [bug#60735] [PATCH v2 2/3] system: Deprecate hosts-file Bruno Victal
2023-01-23 22:37     ` Ludovic Courtès [this message]
2023-01-23 23:19       ` Bruno Victal
2023-01-24  8:53         ` Ludovic Courtès
2023-01-18 16:54   ` [bug#60735] [PATCH v2 3/3] services: Add block-facebook-hosts-service-type Bruno Victal
2023-01-23 22:40     ` Ludovic Courtès
2023-01-25 20:34       ` Bruno Victal
2023-01-23 22:30   ` [bug#60735] [PATCH v2 1/3] services: Add etc-hosts-service-type Ludovic Courtès
2023-01-23 22:47   ` Ludovic Courtès
2023-01-25 20:29     ` Bruno Victal
2023-01-27 21:06 ` [bug#60735] [PATCH v3 1/3] services: Add hosts-service-type Bruno Victal
2023-01-27 21:06   ` [bug#60735] [PATCH v3 2/3] system: Deprecate hosts-file Bruno Victal
2023-01-27 21:06   ` [bug#60735] [PATCH v3 3/3] services: Add block-facebook-hosts-service-type Bruno Victal
2023-02-08 23:57     ` bug#60735: [PATCH 0/2] Implement etc-hosts-service-type Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7qoyj0i.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=60735@debbugs.gnu.org \
    --cc=mirai@makinata.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).