Commit graph

22 commits

Author SHA1 Message Date
aszlig 5e7a1cf955
build-support: Fix nix-prefetch-* on OS X.
Fixes a regression on OS X introduced by f83af95.

Don't use --tmpdir for mktemp, because that flag doesn't exist on OS X.
However, using -t is deprecated in GNU coreutils, so as suggested by
@ip1981 we're now using parameter expansion on ${TMPDIR:-/tmp} to
provide /tmp as a fallback if TMPDIR is not set and use it instead.

Also use this approach for nix-prefetch-cvs now in order to stay
consistent.

Reported-by: Vladimir Kirillov <proger@wilab.org.ua>
Tested-by: Igor Pashev <pashev.igor@gmail.com>
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-08-27 11:22:34 +02:00
aszlig f83af95f8a
build-support: Use mktemp -d in nix-prefetch-*.
Instead of relying on $$ to not collide with an existing path.

Quoting the Bash manual about $$:

> Expands to the process ID of the shell. In a () subshell, it expands
> to the process ID of the current shell, not the subshell.

So, this is different from $BASHPID:

> Expands to the process ID of the current bash process. This differs
> from $$ under certain circumstances, such as subshells that do not
> require bash to be re-initialized.

But even $BASHPID is prone to race conditions if the process IDs wrap
around, so to be on the safe side, we're using mktemp here.

Closes #3784.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-08-25 15:28:55 +02:00
Benno Fünfstück 063efadd69 nix-prefetch-{bzr,hg,svn}: print fetched revision 2014-06-11 14:42:39 +02:00
Ludovic Courtès 69421194a5 nix-prefetch-svn: Support $NIX_PREFETCH_SVN_LEAVE_DOT_SVN.
svn path=/nixpkgs/trunk/; revision=18789
2009-12-03 15:01:54 +00:00
Nicolas Pierron d7897d0d1a Change fetchsvn as well as nix-prefect-svn to use the repository name and
the revision number inside the derivation name.

svn path=/nixpkgs/trunk/; revision=17677
2009-10-06 13:36:52 +00:00
Ludovic Courtès 099dd7fa16 nix-prefetch-svn: Use SHA256/Base32 by default.
svn path=/nixpkgs/trunk/; revision=16322
2009-07-10 15:50:11 +00:00
Eelco Dolstra 31d12fc641 * Don't suppress error messages.
svn path=/nixpkgs/trunk/; revision=13424
2008-11-25 18:34:46 +00:00
Eelco Dolstra 66738cc356 * fetchcvs: cleanup, use nix-store --add-fixed like fetchurl/svn.
Argument "url" renamed to "cvsRoot" (it's not a URL).

svn path=/nixpkgs/trunk/; revision=10889
2008-02-28 22:36:37 +00:00
Eelco Dolstra 0a355c0073 * Don't pollute /tmp.
svn path=/nixpkgs/trunk/; revision=5769
2006-07-18 12:00:38 +00:00
Eelco Dolstra f14988b362 * Show less garbage.
svn path=/nixpkgs/trunk/; revision=5761
2006-07-17 21:27:10 +00:00
Eelco Dolstra f4ce796a20 * More hackery.
svn path=/nixpkgs/trunk/; revision=5351
2006-05-31 10:36:02 +00:00
Eelco Dolstra c4c224e368 * Make nix-prefetch-svn use nix-store --add-fixed (just like
nix-prefetch-url) 

svn path=/nixpkgs/trunk/; revision=5339
2006-05-30 12:42:00 +00:00
Eelco Dolstra b8fd332dd8 * Do use readlink if available.
svn path=/nixpkgs/trunk/; revision=5252
2006-05-02 09:21:59 +00:00
Eelco Dolstra fcbffab371 * system -> top-level.
svn path=/nixpkgs/trunk/; revision=5128
2006-03-30 09:14:50 +00:00
Eelco Dolstra b92bd0f001 * Don't use i686-linux.nix.
svn path=/nixpkgs/trunk/; revision=5046
2006-03-15 21:35:18 +00:00
Eelco Dolstra 439e93640e * Removed readlink.
svn path=/nixpkgs/trunk/; revision=5040
2006-03-15 10:32:40 +00:00
Eelco Dolstra 51c111cb2e * Use a restrictive umask to prevent permission problems.
svn path=/nixpkgs/trunk/; revision=4374
2005-12-15 17:00:56 +00:00
Eelco Dolstra 71ea4dbb8c * Fix for *non*-suid installations.
svn path=/nixpkgs/trunk/; revision=2546
2005-04-12 13:48:36 +00:00
Eelco Dolstra fa88e75c45 * Use fixed-output hashes in fetchsvn.
* In nix-prefetch-svn, support setuid installations where the user has
  no write access to the Nix store.

svn path=/nixpkgs/trunk/; revision=2275
2005-02-22 16:27:28 +00:00
Eelco Dolstra 60e7948db1 * Allow a known hash to be specified.
svn path=/nixpkgs/trunk/; revision=1892
2004-12-17 11:04:18 +00:00
Eelco Dolstra 2a3f5188b5 * Option to print out the path, analogous to nix-prefetch-url.
svn path=/nixpkgs/trunk/; revision=1890
2004-12-17 10:40:00 +00:00
Eelco Dolstra 5c847a370a * fetchsvn' now requires the MD5 hash (as computed by nix-hash') of
the tree being fetched from a Subversion repository.  The revision
  number is now optional (and defaults to HEAD).

  This makes `fetchsvn' more pure.  First, a URL/revision tuple does
  not uniquely identify a file resource, since the repository itself
  might change.  Second, `svn:external' attributes can cause arbitrary
  resources to be exported.

  A script `nix-prefetch-svn' has been provided to determine the hash
  of a URL.

svn path=/nixpkgs/trunk/; revision=938
2004-04-14 10:55:33 +00:00