#! /bin/sh # -*-scheme-*- export LANG=C LANGUAGE=C LC_TIME=C export TZ=UTC0 exec guile --no-auto-compile -L $srcdir -C $srcdir -e '(mdate-from-git)' -s "$0" "$@" !# ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; ;;; This program is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program. If not, see . ;;;; Commentary: ;;; ;;; Usage: mdate-from-git.scm FILE ;;; ;;; This script is compatible with Automake's `mdate-sh' but uses the timestamp ;;; from Git instead of from the file system. Also, it can be appended to ;;; mdate-sh. ;;; As a special exception for Guix, it caters for doc/guix.LANG.texi files that ;;; are not stored in Git, by using po/doc/guix-manual.LANG.po for the Git ;;; timestamp. Test doing something like: ;;; ;;; build-aux/mdate-from-git.scm doc/guix.de.texi ;;; ;;;; Code: (define-module (mdate-from-git) #:use-module (ice-9 match) #:use-module (ice-9 popen) #:use-module (ice-9 rdelim) #:use-module (ice-9 regex) #:export (main)) (define (pipe-command command) (let* ((port (apply open-pipe* OPEN_READ command)) (output (read-string port))) (close-port port) output)) (define (guix.LANG.texi->guix-manual.LANG.po file-name) "Translated manuals doc/guix.LANG.texi are not tracked in Git and are generated from po/doc/guix-manual.LANG.po. For such an untraced .TEXI file, return its .PO counterpart." (let ((m (string-match "doc/guix.([^.]+).texi" file-name))) (if (not m) file-name (let ((lang (match:substring m 1))) (format #f "po/doc/guix-manual.~a.po" lang))))) ;;; ;;; Entry point. ;;; (define (main args) (match args ((script file-name) (let* ((command `("git" "ls-files" "--error-unmatch" "--" ,file-name)) (tracked? (zero? (with-error-to-port (%make-void-port "w") (lambda _ (with-output-to-port (%make-void-port "w") (lambda _ (apply system* command))))))) (file-name (if tracked? file-name (guix.LANG.texi->guix-manual.LANG.po file-name))) (command `("git" "log" "--pretty=format:%ct" "-n1" "--" ,file-name)) (timestamp (with-error-to-port (%make-void-port "w") (lambda _ (pipe-command command)))) (source-date-epoch (or (getenv "SOURCE_DATE_EPOCH") "1")) (timestamp (if (string-null? timestamp) source-date-epoch timestamp)) (time (gmtime (string->number timestamp))) (d-m-y (strftime "%-d %B %Y" time))) (display d-m-y))) (_ (format (current-error-port) "Usage: mdate-from-git.scm FILE\n") (exit 2)))) (LocalStore): Add it. * nix/libstore/store-api.hh (StoreAPI): Add it. * nix/nix-daemon/nix-daemon.cc (performOp): In 'wopSetOptions', add condition to handle "user-name" property and honor it. (processConnection): Add 'userId' parameter. Call 'store->createUser' when userId is not -1. * guix/profiles.scm (ensure-profile-directory): Note that this is now handled by the daemon. * guix/store.scm (current-user-name): New procedure. (set-build-options): Add #:user-name parameter and pass it to the daemon. * tests/guix-daemon.sh: Test the creation of 'profiles/per-user' when listening on a TCP socket. * tests/store.scm ("profiles/per-user exists and is not writable") ("profiles/per-user/$USER exists"): New tests. Ludovic Courtès 2018-06-14Remove 'guix-register' and its traces....* Makefile.am (SH_TESTS): Remove tests/guix-register.sh. * build-aux/pre-inst-env.in (GUIX_REGISTER): Remove. * gnu/build/install.scm (directives): Remove outdated comment. * gnu/build/vm.scm (root-partition-initializer): Update comment. * gnu/packages/package-management.scm (guix-register): Remove. * guix/config.scm.in (%sbindir, %guix-register-program): Remove. * guix/scripts/system.scm (install): Adjust docstring. * guix/self.scm (make-config.scm): Remove #:guix. Do not generate %sbindir and %guix-register-program. (specification->package): Remove "guix". * nix/guix-register/guix-register.cc: Remove. * nix/libstore/store-api.cc (decodeValidPathInfo): Remove. * nix/libstore/store-api.hh (decodeValidPathInfo): Remove declaration. * nix/local.mk (sbin_PROGRAMS, guix_register_SOURCES) (guix_register_CPPFLAGS, guix_register_LDFLAGS): Remove. * tests/guix-register.sh: Remove. Ludovic Courtès 2018-03-30daemon: Remove dead code....* nix/libstore/globals.cc (Settings::loadConfFile, Settings::unpack): Remove. * nix/libstore/globals.hh: Adjust accordingly. * nix/libstore/misc.cc (queryMissing): Remove. * nix/libstore/misc.hh: Adjust accordingly. * nix/libstore/store-api.cc (followLinksToStore) (followLinksToStorePath, computeStorePathForHash): Remove. * nix/libstore/store-api.hh: Adjust accordingly. Ludovic Courtès