* Change referer' to referrer' throughout.  In particular, the
				
					
				
			nix-store query options `--referer' and `--referer-closure' have been changed to `--referrer' and `--referrer-closure' (but the old ones are still accepted for compatibility).
This commit is contained in:
		
							parent
							
								
									d87549c1c7
								
							
						
					
					
						commit
						ab5c6bb3a3
					
				
					 11 changed files with 69 additions and 68 deletions
				
			
		|  | @ -292,8 +292,8 @@ $ nix-store --gc</screen> | ||||||
|     <arg choice='plain'><option>--requisites</option></arg> |     <arg choice='plain'><option>--requisites</option></arg> | ||||||
|     <arg choice='plain'><option>-R</option></arg> |     <arg choice='plain'><option>-R</option></arg> | ||||||
|     <arg choice='plain'><option>--references</option></arg> |     <arg choice='plain'><option>--references</option></arg> | ||||||
|     <arg choice='plain'><option>--referers</option></arg> |     <arg choice='plain'><option>--referrers</option></arg> | ||||||
|     <arg choice='plain'><option>--referers-closure</option></arg> |     <arg choice='plain'><option>--referrers-closure</option></arg> | ||||||
|     <arg choice='plain'><option>--deriver</option></arg> |     <arg choice='plain'><option>--deriver</option></arg> | ||||||
|     <arg choice='plain'><option>--deriver</option></arg> |     <arg choice='plain'><option>--deriver</option></arg> | ||||||
|     <arg choice='plain'><option>--graph</option></arg> |     <arg choice='plain'><option>--graph</option></arg> | ||||||
|  | @ -411,21 +411,21 @@ query is applied to the target of the symlink.</para> | ||||||
| 
 | 
 | ||||||
|   </varlistentry> |   </varlistentry> | ||||||
|    |    | ||||||
|   <varlistentry><term><option>--referers</option></term> |   <varlistentry><term><option>--referrers</option></term> | ||||||
|    |    | ||||||
|     <listitem><para>Prints the set of <emphasis>referers</emphasis> of |     <listitem><para>Prints the set of <emphasis>referrers</emphasis> of | ||||||
|     the store paths <replaceable>paths</replaceable>, that is, the |     the store paths <replaceable>paths</replaceable>, that is, the | ||||||
|     store paths currently existing in the Nix store that refer to one |     store paths currently existing in the Nix store that refer to one | ||||||
|     of <replaceable>paths</replaceable>.  Note that contrary to the |     of <replaceable>paths</replaceable>.  Note that contrary to the | ||||||
|     references, the set of referers is not constant; it can change as |     references, the set of referrers is not constant; it can change as | ||||||
|     store paths are added or removed.</para></listitem> |     store paths are added or removed.</para></listitem> | ||||||
| 
 | 
 | ||||||
|   </varlistentry> |   </varlistentry> | ||||||
|    |    | ||||||
|   <varlistentry><term><option>--referers-closure</option></term> |   <varlistentry><term><option>--referrers-closure</option></term> | ||||||
|    |    | ||||||
|     <listitem><para>Prints the closure of the set of store paths |     <listitem><para>Prints the closure of the set of store paths | ||||||
|     <replaceable>paths</replaceable> under the referers relation; that |     <replaceable>paths</replaceable> under the referrers relation; that | ||||||
|     is, all store paths that directly or indirectly refer to one of |     is, all store paths that directly or indirectly refer to one of | ||||||
|     <replaceable>paths</replaceable>.  These are all the path currently |     <replaceable>paths</replaceable>.  These are all the path currently | ||||||
|     in the Nix store that are dependent on |     in the Nix store that are dependent on | ||||||
|  | @ -536,7 +536,7 @@ $ nix-store -q --tree $(nix-store -qd $(which svn)) | ||||||
| <command>svn</command>: | <command>svn</command>: | ||||||
| 
 | 
 | ||||||
| <screen> | <screen> | ||||||
| $ nix-store -q --referers $(nix-store -q --binding openssl $(nix-store -qd $(which svn))) | $ nix-store -q --referrers $(nix-store -q --binding openssl $(nix-store -qd $(which svn))) | ||||||
| /nix/store/23ny9l9wixx21632y2wi4p585qhva1q8-sylpheed-1.0.0 | /nix/store/23ny9l9wixx21632y2wi4p585qhva1q8-sylpheed-1.0.0 | ||||||
| /nix/store/5mbglq5ldqld8sj57273aljwkfvj22mc-subversion-1.1.4 | /nix/store/5mbglq5ldqld8sj57273aljwkfvj22mc-subversion-1.1.4 | ||||||
| /nix/store/dpmvp969yhdqs7lm2r1a3gng7pyq6vy4-subversion-1.1.3 | /nix/store/dpmvp969yhdqs7lm2r1a3gng7pyq6vy4-subversion-1.1.3 | ||||||
|  | @ -548,7 +548,7 @@ $ nix-store -q --referers $(nix-store -q --binding openssl $(nix-store -qd $(whi | ||||||
| (C library) used by <command>svn</command>: | (C library) used by <command>svn</command>: | ||||||
| 
 | 
 | ||||||
| <screen> | <screen> | ||||||
| $ nix-store -q --referers-closure $(ldd $(which svn) | grep /libc.so | awk '{print $3}') | $ nix-store -q --referrers-closure $(ldd $(which svn) | grep /libc.so | awk '{print $3}') | ||||||
| /nix/store/034a6h4vpz9kds5r6kzb9lhh81mscw43-libgnomeprintui-2.8.2 | /nix/store/034a6h4vpz9kds5r6kzb9lhh81mscw43-libgnomeprintui-2.8.2 | ||||||
| /nix/store/15l3yi0d45prm7a82pcrknxdh6nzmxza-gawk-3.1.4 | /nix/store/15l3yi0d45prm7a82pcrknxdh6nzmxza-gawk-3.1.4 | ||||||
| <replaceable>...</replaceable></screen> | <replaceable>...</replaceable></screen> | ||||||
|  |  | ||||||
|  | @ -236,7 +236,7 @@ $ nix-store -q --tree $(nix-store -qd $(which firefox))</screen> | ||||||
|   certain Glibc: |   certain Glibc: | ||||||
| 
 | 
 | ||||||
|   <screen> |   <screen> | ||||||
| $ nix-store -q --referers-closure \ | $ nix-store -q --referrers-closure \ | ||||||
|     /nix/store/8lz9yc6zgmc0vlqmn2ipcpkjlmbi51vv-glibc-2.3.4</screen> |     /nix/store/8lz9yc6zgmc0vlqmn2ipcpkjlmbi51vv-glibc-2.3.4</screen> | ||||||
| 
 | 
 | ||||||
|   </para> |   </para> | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| #! @perl@ -w -I@libexecdir@/nix | >#! @perl@ -w -I@libexecdir@/nix | ||||||
| 
 | 
 | ||||||
| use strict; | use strict; | ||||||
| use POSIX qw(tmpnam); | use POSIX qw(tmpnam); | ||||||
|  | @ -140,19 +140,19 @@ sub computeUses { | ||||||
| 
 | 
 | ||||||
| #    print "  DERIVER $deriver\n"; | #    print "  DERIVER $deriver\n"; | ||||||
| 
 | 
 | ||||||
|     # Optimisation: build the referers graph from the references |     # Optimisation: build the referrers graph from the references | ||||||
|     # graph. |     # graph. | ||||||
|     my %referers; |     my %referrers; | ||||||
|     foreach my $q (keys %{$narFiles}) { |     foreach my $q (keys %{$narFiles}) { | ||||||
|         my @refs = split " ", @{$$narFiles{$q}}[0]->{references}; |         my @refs = split " ", @{$$narFiles{$q}}[0]->{references}; | ||||||
|         foreach my $r (@refs) { |         foreach my $r (@refs) { | ||||||
|             $referers{$r} = [] unless defined $referers{$r}; |             $referrers{$r} = [] unless defined $referrers{$r}; | ||||||
|             push @{$referers{$r}}, $q; |             push @{$referrers{$r}}, $q; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     # Determine the shortest path from $deriver to all other reachable |     # Determine the shortest path from $deriver to all other reachable | ||||||
|     # paths in the `referers' graph. |     # paths in the `referrers' graph. | ||||||
| 
 | 
 | ||||||
|     my %dist; |     my %dist; | ||||||
|     $dist{$deriver} = 0; |     $dist{$deriver} = 0; | ||||||
|  | @ -164,7 +164,7 @@ sub computeUses { | ||||||
|         my $p = $queue[$pos]; |         my $p = $queue[$pos]; | ||||||
|         $pos++; |         $pos++; | ||||||
| 
 | 
 | ||||||
|         foreach my $q (@{$referers{$p}}) { |         foreach my $q (@{$referrers{$p}}) { | ||||||
|             if (!defined $dist{$q}) { |             if (!defined $dist{$q}) { | ||||||
|                 $dist{$q} = $dist{$p} + 1; |                 $dist{$q} = $dist{$p} + 1; | ||||||
| #                print "    $q $dist{$q}\n"; | #                print "    $q $dist{$q}\n"; | ||||||
|  |  | ||||||
|  | @ -23,8 +23,9 @@ Derivation derivationFromPath(const Path & drvPath); | ||||||
|    closure of `storePath'; that is, all paths than can be directly or |    closure of `storePath'; that is, all paths than can be directly or | ||||||
|    indirectly reached from it.  `paths' is not cleared.  If |    indirectly reached from it.  `paths' is not cleared.  If | ||||||
|    `flipDirection' is true, the set of paths that can reach |    `flipDirection' is true, the set of paths that can reach | ||||||
|    `storePath' is returned; that is, the closures under the `referers' |    `storePath' is returned; that is, the closures under the | ||||||
|    relation instead of the `references' relation is returned. */ |    `referrers' relation instead of the `references' relation is | ||||||
|  |    returned. */ | ||||||
| void computeFSClosure(const Path & storePath, | void computeFSClosure(const Path & storePath, | ||||||
|     PathSet & paths, bool flipDirection = false); |     PathSet & paths, bool flipDirection = false); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -401,8 +401,8 @@ void collectGarbage(GCAction action, PathSet & result) | ||||||
|     for (Paths::iterator i = storePaths.begin(); i != storePaths.end(); ++i) |     for (Paths::iterator i = storePaths.begin(); i != storePaths.end(); ++i) | ||||||
|         storePaths2.insert(canonPath(nixStore + "/" + *i)); |         storePaths2.insert(canonPath(nixStore + "/" + *i)); | ||||||
| 
 | 
 | ||||||
|     /* Topologically sort them under the `referers' relation.  That
 |     /* Topologically sort them under the `referrers' relation.  That
 | ||||||
|        is, a < b iff a is in referers(b).  This gives us the order in |        is, a < b iff a is in referrers(b).  This gives us the order in | ||||||
|        which things can be deleted safely. */ |        which things can be deleted safely. */ | ||||||
|     /* !!! when we have multiple output paths per derivation, this
 |     /* !!! when we have multiple output paths per derivation, this
 | ||||||
|        will not work anymore because we get cycles. */ |        will not work anymore because we get cycles. */ | ||||||
|  |  | ||||||
|  | @ -19,7 +19,7 @@ void computeFSClosure(const Path & storePath, | ||||||
| 
 | 
 | ||||||
|     PathSet references; |     PathSet references; | ||||||
|     if (flipDirection) |     if (flipDirection) | ||||||
|         queryReferers(noTxn, storePath, references); |         queryReferrers(noTxn, storePath, references); | ||||||
|     else |     else | ||||||
|         queryReferences(noTxn, storePath, references); |         queryReferences(noTxn, storePath, references); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -309,7 +309,7 @@ static string stripPrefix(const string & prefix, const string & s) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| static PathSet getReferers(const Transaction & txn, const Path & storePath) | static PathSet getReferrers(const Transaction & txn, const Path & storePath) | ||||||
| { | { | ||||||
|     PathSet referrers; |     PathSet referrers; | ||||||
|     Strings keys; |     Strings keys; | ||||||
|  | @ -338,13 +338,13 @@ void setReferences(const Transaction & txn, const Path & storePath, | ||||||
|     nixDB.setStrings(txn, dbReferences, storePath, |     nixDB.setStrings(txn, dbReferences, storePath, | ||||||
|         Paths(references.begin(), references.end())); |         Paths(references.begin(), references.end())); | ||||||
| 
 | 
 | ||||||
|     /* Update the referers mappings of all new referenced paths. */ |     /* Update the referrers mappings of all new referenced paths. */ | ||||||
|     for (PathSet::const_iterator i = references.begin(); |     for (PathSet::const_iterator i = references.begin(); | ||||||
|          i != references.end(); ++i) |          i != references.end(); ++i) | ||||||
|         if (oldReferences2.find(*i) == oldReferences2.end()) |         if (oldReferences2.find(*i) == oldReferences2.end()) | ||||||
|             nixDB.setString(txn, dbReferrers, addPrefix(*i, storePath), ""); |             nixDB.setString(txn, dbReferrers, addPrefix(*i, storePath), ""); | ||||||
| 
 | 
 | ||||||
|     /* Remove referer mappings from paths that are no longer
 |     /* Remove referrer mappings from paths that are no longer
 | ||||||
|        references. */ |        references. */ | ||||||
|     for (Paths::iterator i = oldReferences.begin(); |     for (Paths::iterator i = oldReferences.begin(); | ||||||
|          i != oldReferences.end(); ++i) |          i != oldReferences.end(); ++i) | ||||||
|  | @ -364,13 +364,13 @@ void queryReferences(const Transaction & txn, | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| void queryReferers(const Transaction & txn, | void queryReferrers(const Transaction & txn, | ||||||
|     const Path & storePath, PathSet & referers) |     const Path & storePath, PathSet & referrers) | ||||||
| { | { | ||||||
|     if (!isRealisablePath(txn, storePath)) |     if (!isRealisablePath(txn, storePath)) | ||||||
|         throw Error(format("path `%1%' is not valid") % storePath); |         throw Error(format("path `%1%' is not valid") % storePath); | ||||||
|     PathSet referers2 = getReferers(txn, storePath); |     PathSet referrers2 = getReferrers(txn, storePath); | ||||||
|     referers.insert(referers2.begin(), referers2.end()); |     referrers.insert(referrers2.begin(), referrers2.end()); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -499,9 +499,9 @@ void clearSubstitutes() | ||||||
|             invalidatePath(txn, *i); |             invalidatePath(txn, *i); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /* !!! there should be no referers to any of the invalid
 |     /* !!! there should be no referrers to any of the invalid
 | ||||||
|        substitutable paths.  This should be the case by construction |        substitutable paths.  This should be the case by construction | ||||||
|        (the only referers can be other invalid substitutable paths, |        (the only referrers can be other invalid substitutable paths, | ||||||
|        which have all been removed now). */ |        which have all been removed now). */ | ||||||
|      |      | ||||||
|     txn.commit(); |     txn.commit(); | ||||||
|  | @ -587,13 +587,13 @@ void registerValidPaths(const Transaction & txn, | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| /* Invalidate a path.  The caller is responsible for checking that
 | /* Invalidate a path.  The caller is responsible for checking that
 | ||||||
|    there are no referers. */ |    there are no referrers. */ | ||||||
| static void invalidatePath(Transaction & txn, const Path & path) | static void invalidatePath(Transaction & txn, const Path & path) | ||||||
| { | { | ||||||
|     debug(format("unregistering path `%1%'") % path); |     debug(format("unregistering path `%1%'") % path); | ||||||
| 
 | 
 | ||||||
|     /* Clear the `references' entry for this path, as well as the
 |     /* Clear the `references' entry for this path, as well as the
 | ||||||
|        inverse `referers' entries, and the `derivers' entry; but only |        inverse `referrers' entries, and the `derivers' entry; but only | ||||||
|        if there are no substitutes for this path.  This maintains the |        if there are no substitutes for this path.  This maintains the | ||||||
|        cleanup invariant. */ |        cleanup invariant. */ | ||||||
|     if (querySubstitutes(txn, path).size() == 0) { |     if (querySubstitutes(txn, path).size() == 0) { | ||||||
|  | @ -754,9 +754,9 @@ void deleteFromStore(const Path & _path) | ||||||
| 
 | 
 | ||||||
|     Transaction txn(nixDB); |     Transaction txn(nixDB); | ||||||
|     if (isValidPathTxn(txn, path)) { |     if (isValidPathTxn(txn, path)) { | ||||||
|         PathSet referers = getReferers(txn, path); |         PathSet referrers = getReferrers(txn, path); | ||||||
|         for (PathSet::iterator i = referers.begin(); |         for (PathSet::iterator i = referrers.begin(); | ||||||
|              i != referers.end(); ++i) |              i != referrers.end(); ++i) | ||||||
|             if (*i != path && isValidPathTxn(txn, *i)) |             if (*i != path && isValidPathTxn(txn, *i)) | ||||||
|                 throw Error(format("cannot delete path `%1%' because it is in use by path `%2%'") % path % *i); |                 throw Error(format("cannot delete path `%1%' because it is in use by path `%2%'") % path % *i); | ||||||
|         invalidatePath(txn, path); |         invalidatePath(txn, path); | ||||||
|  | @ -817,7 +817,7 @@ void verifyStore(bool checkContents) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /* Check the cleanup invariant: only usable paths can have
 |     /* Check the cleanup invariant: only usable paths can have
 | ||||||
|        `references', `referers', or `derivers' entries. */ |        `references', `referrers', or `derivers' entries. */ | ||||||
| 
 | 
 | ||||||
|     /* Check the `derivers' table. */ |     /* Check the `derivers' table. */ | ||||||
|     Paths deriversKeys; |     Paths deriversKeys; | ||||||
|  | @ -860,7 +860,7 @@ void verifyStore(bool checkContents) | ||||||
|             { |             { | ||||||
|                 string dummy; |                 string dummy; | ||||||
|                 if (!nixDB.queryString(txn, dbReferrers, addPrefix(*j, *i), dummy)) { |                 if (!nixDB.queryString(txn, dbReferrers, addPrefix(*j, *i), dummy)) { | ||||||
|                     printMsg(lvlError, format("missing referer mapping from `%1%' to `%2%'") |                     printMsg(lvlError, format("missing referrer mapping from `%1%' to `%2%'") | ||||||
|                         % *j % *i); |                         % *j % *i); | ||||||
|                     nixDB.setString(txn, dbReferrers, addPrefix(*j, *i), ""); |                     nixDB.setString(txn, dbReferrers, addPrefix(*j, *i), ""); | ||||||
|                 } |                 } | ||||||
|  | @ -873,26 +873,26 @@ void verifyStore(bool checkContents) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| #if 0 // !!!
 | #if 0 // !!!
 | ||||||
|     /* Check the `referers' table. */ |     /* Check the `referrers' table. */ | ||||||
|     Paths referersKeys; |     Paths referrersKeys; | ||||||
|     nixDB.enumTable(txn, dbReferers, referersKeys); |     nixDB.enumTable(txn, dbReferrers, referrersKeys); | ||||||
|     for (Paths::iterator i = referersKeys.begin(); |     for (Paths::iterator i = referrersKeys.begin(); | ||||||
|          i != referersKeys.end(); ++i) |          i != referrersKeys.end(); ++i) | ||||||
|     { |     { | ||||||
|         if (usablePaths.find(*i) == usablePaths.end()) { |         if (usablePaths.find(*i) == usablePaths.end()) { | ||||||
|             printMsg(lvlError, format("found referers entry for unusable path `%1%'") |             printMsg(lvlError, format("found referrers entry for unusable path `%1%'") | ||||||
|                 % *i); |                 % *i); | ||||||
|             nixDB.delPair(txn, dbReferers, *i); |             nixDB.delPair(txn, dbReferrers, *i); | ||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|             PathSet referers, newReferers; |             PathSet referrers, newReferrers; | ||||||
|             queryReferers(txn, *i, referers); |             queryReferrers(txn, *i, referrers); | ||||||
|             for (PathSet::iterator j = referers.begin(); |             for (PathSet::iterator j = referrers.begin(); | ||||||
|                  j != referers.end(); ++j) |                  j != referrers.end(); ++j) | ||||||
|             { |             { | ||||||
|                 Paths references; |                 Paths references; | ||||||
|                 if (usablePaths.find(*j) == usablePaths.end()) { |                 if (usablePaths.find(*j) == usablePaths.end()) { | ||||||
|                     printMsg(lvlError, format("referer mapping from `%1%' to unusable `%2%'") |                     printMsg(lvlError, format("referrer mapping from `%1%' to unusable `%2%'") | ||||||
|                         % *i % *j); |                         % *i % *j); | ||||||
|                 } else { |                 } else { | ||||||
|                     nixDB.queryStrings(txn, dbReferences, *j, references); |                     nixDB.queryStrings(txn, dbReferences, *j, references); | ||||||
|  | @ -901,12 +901,12 @@ void verifyStore(bool checkContents) | ||||||
|                             % *j % *i); |                             % *j % *i); | ||||||
|                         /* !!! repair by inserting *i into references */ |                         /* !!! repair by inserting *i into references */ | ||||||
|                     } |                     } | ||||||
|                     else newReferers.insert(*j); |                     else newReferrers.insert(*j); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             if (referers != newReferers) |             if (referrers != newReferrers) | ||||||
|                 nixDB.setStrings(txn, dbReferers, *i, |                 nixDB.setStrings(txn, dbReferrers, *i, | ||||||
|                     Paths(newReferers.begin(), newReferers.end())); |                     Paths(newReferrers.begin(), newReferrers.end())); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| #endif     | #endif     | ||||||
|  |  | ||||||
|  | @ -123,8 +123,8 @@ void queryReferences(const Transaction & txn, | ||||||
| 
 | 
 | ||||||
| /* Queries the set of incoming FS references for a store path.  The
 | /* Queries the set of incoming FS references for a store path.  The
 | ||||||
|    result is not cleared. */ |    result is not cleared. */ | ||||||
| void queryReferers(const Transaction & txn, | void queryReferrers(const Transaction & txn, | ||||||
|     const Path & storePath, PathSet & referers); |     const Path & storePath, PathSet & referrers); | ||||||
| 
 | 
 | ||||||
| /* Sets the deriver of a store path.  Use with care! */ | /* Sets the deriver of a store path.  Use with care! */ | ||||||
| void setDeriver(const Transaction & txn, const Path & storePath, | void setDeriver(const Transaction & txn, const Path & storePath, | ||||||
|  |  | ||||||
|  | @ -28,8 +28,8 @@ Query flags: | ||||||
|   --outputs: query the output paths of a Nix derivation (default) |   --outputs: query the output paths of a Nix derivation (default) | ||||||
|   --requisites / -R: print all paths necessary to realise a path |   --requisites / -R: print all paths necessary to realise a path | ||||||
|   --references: print all paths referenced by the given path |   --references: print all paths referenced by the given path | ||||||
|   --referers: print all paths directly refering to the given path |   --referrers: print all paths directly refering to the given path | ||||||
|   --referers-closure: print all paths (in)directly refering to the given path |   --referrers-closure: print all paths (in)directly refering to the given path | ||||||
|   --tree: print a tree showing the dependency graph of the given paths |   --tree: print a tree showing the dependency graph of the given paths | ||||||
|   --graph: print a dot graph rooted at given paths |   --graph: print a dot graph rooted at given paths | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -273,8 +273,8 @@ static void printTree(const Path & path, | ||||||
| /* Perform various sorts of queries. */ | /* Perform various sorts of queries. */ | ||||||
| static void opQuery(Strings opFlags, Strings opArgs) | static void opQuery(Strings opFlags, Strings opArgs) | ||||||
| { | { | ||||||
|     enum { qOutputs, qRequisites, qReferences, qReferers |     enum { qOutputs, qRequisites, qReferences, qReferrers | ||||||
|          , qReferersClosure, qDeriver, qBinding, qHash |          , qReferrersClosure, qDeriver, qBinding, qHash | ||||||
|          , qTree, qGraph } query = qOutputs; |          , qTree, qGraph } query = qOutputs; | ||||||
|     bool useOutput = false; |     bool useOutput = false; | ||||||
|     bool includeOutputs = false; |     bool includeOutputs = false; | ||||||
|  | @ -286,8 +286,8 @@ static void opQuery(Strings opFlags, Strings opArgs) | ||||||
|         if (*i == "--outputs") query = qOutputs; |         if (*i == "--outputs") query = qOutputs; | ||||||
|         else if (*i == "--requisites" || *i == "-R") query = qRequisites; |         else if (*i == "--requisites" || *i == "-R") query = qRequisites; | ||||||
|         else if (*i == "--references") query = qReferences; |         else if (*i == "--references") query = qReferences; | ||||||
|         else if (*i == "--referers") query = qReferers; |         else if (*i == "--referrers" || *i == "--referers") query = qReferrers; | ||||||
|         else if (*i == "--referers-closure") query = qReferersClosure; |         else if (*i == "--referrers-closure" || *i == "--referers-closure") query = qReferrersClosure; | ||||||
|         else if (*i == "--deriver" || *i == "-d") query = qDeriver; |         else if (*i == "--deriver" || *i == "-d") query = qDeriver; | ||||||
|         else if (*i == "--binding" || *i == "-b") { |         else if (*i == "--binding" || *i == "-b") { | ||||||
|             if (opArgs.size() == 0) |             if (opArgs.size() == 0) | ||||||
|  | @ -320,8 +320,8 @@ static void opQuery(Strings opFlags, Strings opArgs) | ||||||
| 
 | 
 | ||||||
|         case qRequisites: |         case qRequisites: | ||||||
|         case qReferences: |         case qReferences: | ||||||
|         case qReferers: |         case qReferrers: | ||||||
|         case qReferersClosure: { |         case qReferrersClosure: { | ||||||
|             PathSet paths; |             PathSet paths; | ||||||
|             for (Strings::iterator i = opArgs.begin(); |             for (Strings::iterator i = opArgs.begin(); | ||||||
|                  i != opArgs.end(); ++i) |                  i != opArgs.end(); ++i) | ||||||
|  | @ -330,8 +330,8 @@ static void opQuery(Strings opFlags, Strings opArgs) | ||||||
|                 if (query == qRequisites) |                 if (query == qRequisites) | ||||||
|                     storePathRequisites(path, includeOutputs, paths); |                     storePathRequisites(path, includeOutputs, paths); | ||||||
|                 else if (query == qReferences) queryReferences(noTxn, path, paths); |                 else if (query == qReferences) queryReferences(noTxn, path, paths); | ||||||
|                 else if (query == qReferers) queryReferers(noTxn, path,  paths); |                 else if (query == qReferrers) queryReferrers(noTxn, path,  paths); | ||||||
|                 else if (query == qReferersClosure) computeFSClosure(path, paths, true); |                 else if (query == qReferrersClosure) computeFSClosure(path, paths, true); | ||||||
|             } |             } | ||||||
|             printPathSet(paths); |             printPathSet(paths); | ||||||
|             break; |             break; | ||||||
|  |  | ||||||
|  | @ -22,8 +22,8 @@ if echo "$deps" | grep -q "dependencies-input-1"; then exit 1; fi | ||||||
| # Input-2 is retained. | # Input-2 is retained. | ||||||
| input2OutPath=$(echo "$deps" | grep "dependencies-input-2") | input2OutPath=$(echo "$deps" | grep "dependencies-input-2") | ||||||
| 
 | 
 | ||||||
| # The referers closure of input-2 should include outPath. | # The referrers closure of input-2 should include outPath. | ||||||
| $TOP/src/nix-store/nix-store -q --referers-closure "$input2OutPath" | grep "$outPath" | $TOP/src/nix-store/nix-store -q --referrers-closure "$input2OutPath" | grep "$outPath" | ||||||
| 
 | 
 | ||||||
| # Check that the derivers are set properly. | # Check that the derivers are set properly. | ||||||
| test $($TOP/src/nix-store/nix-store -q --deriver "$outPath") = "$drvPath" | test $($TOP/src/nix-store/nix-store -q --deriver "$outPath") = "$drvPath" | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue