Merge branch 'master' of github.com:NixOS/nix
This commit is contained in:
commit
5278bb7c16
4 changed files with 47 additions and 2 deletions
|
@ -210,6 +210,35 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""</programlisting>
|
|||
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><function>builtins.match</function>
|
||||
<replaceable>regex</replaceable> <replaceable>str</replaceable></term>
|
||||
|
||||
<listitem><para>Returns a list if
|
||||
<replaceable>regex</replaceable> matches
|
||||
<replaceable>str</replaceable> precisely, otherwise returns <literal>null</literal>.
|
||||
Each item in the list is a regex group.
|
||||
|
||||
<programlisting>
|
||||
builtins.match "ab" "abc"
|
||||
</programlisting>
|
||||
|
||||
Evaluates to <literal>null</literal>.
|
||||
|
||||
<programlisting>
|
||||
builtins.match "abc" "abc"
|
||||
</programlisting>
|
||||
|
||||
Evaluates to <literal>[ ]</literal>.
|
||||
|
||||
<programlisting>
|
||||
builtins.match "a(b)(c)" "abc"
|
||||
</programlisting>
|
||||
|
||||
Evaluates to <literal>[ "b" "c" ]</literal>.
|
||||
|
||||
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><function>builtins.elem</function>
|
||||
<replaceable>x</replaceable> <replaceable>xs</replaceable></term>
|
||||
|
|
|
@ -167,7 +167,16 @@ stdenv.mkDerivation {
|
|||
user's home directory. e.g. <filename>~/foo</filename> would be
|
||||
equivalent to <filename>/home/edolstra/foo</filename> for a user
|
||||
whose home directory is <filename>/home/edolstra</filename>.
|
||||
</para></listitem>
|
||||
</para>
|
||||
|
||||
<para>Paths can also be specified between angle brackets, e.g.
|
||||
<literal><nixpkgs></literal>. This means that the directories
|
||||
listed in the environment variable
|
||||
<envar linkend="env-NIX_PATH">NIX_PATH</envar> will be searched
|
||||
for the given file or directory name.
|
||||
</para>
|
||||
|
||||
</listitem>
|
||||
|
||||
<listitem><para><emphasis>Booleans</emphasis> with values
|
||||
<literal>true</literal> and
|
||||
|
|
|
@ -14,6 +14,7 @@ stdenv.mkDerivation {
|
|||
customMemoryManagement = false;
|
||||
})
|
||||
autoreconfHook
|
||||
perlPackages.DBDSQLite
|
||||
];
|
||||
|
||||
configureFlags =
|
||||
|
|
|
@ -165,7 +165,13 @@ Hash parseHash32(HashType ht, const string & s)
|
|||
unsigned int i = b / 8;
|
||||
unsigned int j = b % 8;
|
||||
hash.hash[i] |= digit << j;
|
||||
if (i < hash.hashSize - 1) hash.hash[i + 1] |= digit >> (8 - j);
|
||||
|
||||
if (i < hash.hashSize - 1) {
|
||||
hash.hash[i + 1] |= digit >> (8 - j);
|
||||
} else {
|
||||
if (digit >> (8 - j))
|
||||
throw BadHash(format("invalid base-32 hash ‘%1%’") % s);
|
||||
}
|
||||
}
|
||||
|
||||
return hash;
|
||||
|
|
Loading…
Reference in a new issue