/* GNU Guix --- Functional package management for GNU Copyright (C) 2020 Ludovic Courtès This file is part of GNU Guix. GNU Guix 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. GNU Guix 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 GNU Guix. If not, see . */ /* This file implements part of the GNU ld.so audit interface. It is used by the "fakechroot" engine of the 'guix pack -RR' wrappers to make sure the loader looks for shared objects under the "fake" root directory. */ #define _GNU_SOURCE 1 #include #include #include #include #include /* The pseudo root directory and store that we are relocating to. */ static const char *root_directory; static char *store; /* The original store, "/gnu/store" by default. */ static const char original_store[] = "@STORE_DIRECTORY@"; /* Like 'malloc', but abort if 'malloc' returns NULL. */ static void * xmalloc (size_t size) { void *result = malloc (size); assert (result != NULL); return result; } unsigned int la_version (unsigned int v) { if (v != LAV_CURRENT) error (1, 0, "cannot handle interface version %u", v); root_directory = getenv ("FAKECHROOT_BASE"); if (root_directory == NULL) error (1, 0, "'FAKECHROOT_BASE' is not set"); store = xmalloc (strlen (root_directory) + sizeof original_store); strcpy (store, root_directory); strcat (store, original_store); return v; } /* Return NAME, a shared object file name, relocated under STORE. This function is called by the loader whenever it looks for a shared object. */ char * la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag) { char *result; if (strncmp (name, original_store, sizeof original_store - 1) == 0) { size_t len = strlen (name) - sizeof original_store + strlen (store) + 1; result = xmalloc (len); strcpy (result, store); strcat (result, name + sizeof original_store - 1); } else result = strdup (name); return result; } pan title='2018-02-17 22:23:07 +0300'>2018-02-17bash completion: Complete files names after 'guix package -m'....* etc/completion/bash/guix (_guix_is_dash_m): New function. (_guix_complete): Add this. Oleg Pykhalov 2018-01-16etc: Add completions for fish....* etc/completion/fish/guix.fish: New file. * Makefile.am: Register the file. * configure.ac: Add the fish vendor-completions directory. Signed-off-by: Ludovic Courtès <ludo@gnu.org> ng0 2017-08-22bash completion: Complete files names after 'guix download'....* etc/completion/bash/guix (_guix_complete): When the command is "download", use __guix_complete_file. Marius Bakke 2017-02-07bash completion: Complete subcommands for the current word....* etc/completion/bash/guix (_guix_complete_subcommand): Refer to the $COMP_CWORD element instead of the last element. Ludovic Courtès 2017-02-07bash completion: Properly complete 'guix container exec'....* etc/completion/bash/guix (_guix_complete_pid): New function. (_guix_complete): Add case for "container". Ludovic Courtès 2017-02-07bash completion: Complete file names after 'guix system COMMAND'....* etc/completion/bash/guix (_guix_complete): When the command is "system" and $COMP_CWORD > 2, use _guix_complete_file. Ludovic Courtès 2017-02-07bash completion: Complete 'guix gc' with file names....Reported by a couple of cool folks at a bar in Brussels. * etc/completion/bash/guix (_guix_complete): Use '_guix_complete_file' for 'guix gc'. This fixes completion of 'guix gc -d'. Ludovic Courtès 2016-09-07bash completion: Complete subcommands and their options....* etc/completion/bash/guix (_guix_complete_subcommand): New function. (_guix_complete_option): Allow completion of subcommand options. (_guix_complete): Use '_guix_complete_subcommand' for "system" and "import". Ludovic Courtès 2016-09-07bash completion: Redirect 'guix' stderr to /dev/null....This avoids spurious messages when pressing TAB. * etc/completion/bash/guix (_guix_complete_available_package) (_guix_complete_installed_package, _guix_complete_option) (_guix_complete): Redirect stderr to /dev/null when running 'guix'. Ludovic Courtès 2016-09-07Add Zsh completion file....* etc/completion/zsh/_guix: New file. * Makefile.am (dist_zshcompletion_DATA): New variable. * configure.ac: Add --with-zsh-completion-dir. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Eric Le Bihan