Skip to content
Snippets Groups Projects
  1. Apr 05, 2017
    • Luke Shumaker's avatar
      Avoid using string interpolation; use printf format strings instead. · cb35d74f
      Luke Shumaker authored
      This involves extending the signature of lib/common.sh's `stat_busy()`,
      `lock()`, and `slock()`. The `mesg=$1; shift` in stat_busy even suggests
      that this is what was originally intended from it.
      cb35d74f
    • Luke Shumaker's avatar
      Add a "License:" tag to all code files. · 14d5e1c2
      Luke Shumaker authored
      In cases where there is no license specified, the file is tagged as
      "License: Unspecified".  Obviously, that is not ideal, but it
      highlights the fact, and I hope that it encourages whoever has the
      authority to specify the license to do so.
      
      On that note, to anyone who may have the authority to specify the
      license of files in devtools: the current licence of many files is
      GPLv2 with no option for later versions; I impore you to re-license
      them to have the "or any later version" option.
      14d5e1c2
    • Luke Shumaker's avatar
      Add '#!/hint/bash' headers to non-executable bash files. · f55786b7
      Luke Shumaker authored
      This provides a cross-editor hint that the syntax of the file is Bash.
      f55786b7
    • Luke Shumaker's avatar
    • 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 07, 2017
  3. Mar 04, 2017
  4. Sep 22, 2014
    • Dave Reisner's avatar
      common: remove unreachable statement · 98841eb6
      Dave Reisner authored
      We run from a non-interactive shell, so the exec which is inevitably
      called will replace the current process and 'die' will never run under
      any circumstances.
      
      This also fixes a bug with the su fallback which would cause multiple
      arguments to be concatenated without any whitespace between them.
      98841eb6
    • Dave Reisner's avatar
      common.sh: propagate error through trap_exit · af6c0a0f
      Dave Reisner authored
      Fixes a breakage introduced in 6db31cc1 which leads to errors
      being masked from makechrootpkg.
      af6c0a0f
  5. May 10, 2014
  6. Nov 04, 2013
  7. Nov 01, 2013
    • Dave Reisner's avatar
      common: implement find_cached_package · 27441f20
      Dave Reisner authored
      
      This function (currently) searches through $PWD and $PKGDEST looking
      for a tarball matching the requested package name, architecture, and
      pkgver. If found, it writes the full path to the located package to
      stdout and returns 0, else 1. If more than 1 match is found, it's
      treated as an error and the user will need to figure out what to do.
      
      Use this in checkpkg and commitpkg, which previously implemented their
      own less complete logic, to locate the build artifacts they rely on.
      
      Signed-off-by: default avatarDave Reisner <dreisner@archlinux.org>
      Signed-off-by: default avatarPierre Schmitz <pierre@archlinux.de>
      27441f20
  8. Aug 08, 2013
  9. May 03, 2013
  10. Oct 27, 2012
  11. Oct 03, 2012
  12. Jun 16, 2012
  13. Feb 12, 2012
    • Lukas Fleischer's avatar
      archrelease: Validate tags before releasing · 9ab0d945
      Lukas Fleischer authored
      
      Compare every single tag with a list of valid tags. This prevents broken
      releases which occurred whenever someone made a typo on the command
      line:
      
          $ ./archrelease community i686
          ==> ERROR: archrelease: Invalid tag: "community" (use -f to force release)
      
      Since the list is used in the ZSH completion as well, break it out to a
      separate file and move it to "lib/". Also, add a command line parameter
      to allow for releasing to an unknown repository when necessary.
      
      Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
      Signed-off-by: default avatarPierre Schmitz <pierre@archlinux.de>
      9ab0d945
  14. Nov 04, 2011
  15. Nov 01, 2011
Loading