Skip to content
Snippets Groups Projects
  1. Apr 05, 2017
    • Luke Shumaker's avatar
    • Luke Shumaker's avatar
      lib/common.sh: lock, slock: Allow locks to be inherited. · d3334408
      Luke Shumaker authored
      Allow for locks to be inherited.  Inheriting the lock is something that
      mkarchroot could do previously, but has since lost the ability to do.  This
      allows for the programs to be more compos-able.
      
      Do this by instead of unconditionally opening $file on $fd, first check if
      $file is already open on $fd; and go ahead use it if it is.
      
      The naive way of doing this would be to `$(readlink /dev/fd/$fd)` and
      compare that to `$file`.  However, if `$file` is itself a symlink; or there
      is a symlink somewhere in the path to `$file`, then this could easily fail.
      Instead, check `[[ "/dev/fd/$fd" -ef "$file" ]]`.  Even though the Bash
      documentation (`help test`) says that `-ef` checks for if the two files are
      hard links to eachother, because it uses stat(3) (which resolves symlinks)
      to do this check, it also works with the /dev/fd/ soft links.
      d3334408
    • Luke Shumaker's avatar
      lib/common.sh: add 'lock_close'; use it as appropriate. · 997bc1dc
      Luke Shumaker authored
      `lock_close FD` is easier to remember than 'exec FD>&-`; and is especially
      easier if FD is a variable (though that isn't actually taken advantage of
      here).
      
      This uses Bash 4.1+ `exec {var}>&-`, rather than the clunkier
      `eval exec "$var>&-"` that was necessary in older versions of Bash.
      Thanks to Dave Reisner for pointing this new bit of syntax out to me
      the last time I submitted this (back in 2014, 4.1 had just come out).
      997bc1dc
  2. Mar 20, 2017
  3. Mar 07, 2017
  4. Mar 04, 2017
  5. Feb 17, 2017
    • Jan Alexander Steffens (heftig)'s avatar
      mkarchroot: Set LANG=en_US.UTF-8 · c8147a35
      Jan Alexander Steffens (heftig) authored
      In order to have an UTF-8 locale in the build root. This is something
      normally set on real machines but is not set from our chroots. Meson,
      for example, loudly complains when the locale charset is not UTF-8.
      
      I'd like to have C.UTF-8, as most other distributions do. Unfortunately,
      it's not part of vanilla glibc; en_US.UTF-8 will have to do.
      
      mkarchroot already creates roots with both en_US.UTF-8 and de_DE.UTF-8,
      the latter because builds of gcc (perhaps used to) require it.
      
      Bump the CHROOT_VERSION due to the setting change.
      c8147a35
  6. Oct 08, 2016
  7. Jun 12, 2016
  8. May 28, 2016
  9. May 27, 2016
  10. May 07, 2016
  11. Feb 07, 2016
  12. Jan 09, 2016
  13. Nov 29, 2015
  14. Oct 02, 2015
  15. Sep 25, 2015
  16. Jun 06, 2015
Loading