Content-Security-Policy: default-src 'none'
Content-Type: text/plain; charset=UTF-8
Content-Length: 2582
Content-Disposition: inline; filename="modules.scm"
Last-Modified: Tue, 05 Nov 2024 21:26:30 GMT
Expires: Fri, 03 Nov 2034 21:26:30 GMT
ETag: "57019c600cf2d9449918eaa4a5ae0999bfb39adb"

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (test-modules)
  #:use-module (guix modules)
  #:use-module ((guix build-system gnu) #:select (%gnu-build-system-modules))
  #:use-module ((guix utils) #:select (call-with-temporar</td></tr></table>
<table class='tabs'><tr><td>
<a class='active' href='/guix/about/'>about</a><a href='/guix/'>summary</a><a href='/guix/refs/?id=8d4d32d1d189624a1a238d54ae8e29fceef42680'>refs</a><a href='/guix/log/'>log</a><a href='/guix/tree/?id=8d4d32d1d189624a1a238d54ae8e29fceef42680'>tree</a><a href='/guix/commit/?id=8d4d32d1d189624a1a238d54ae8e29fceef42680'>commit</a><a href='/guix/diff/?id=8d4d32d1d189624a1a238d54ae8e29fceef42680'>diff</a></td><td class='form'><form class='right' method='get' action='/guix/log/'>
<input type='hidden' name='id' value='8d4d32d1d189624a1a238d54ae8e29fceef42680'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='content'><div id='summary'><pre>
# GNU Guix --- Functional package management for GNU
# Copyright © 2013, 2015, 2017, 2018, 2019 Ludovic Courtès &lt;ludo@gnu.org&gt;
#
# This file is part of GNU Guix.
#
# GNU Guix is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or (at
# your option) any later version.
#
# GNU Guix is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Guix.  If not, see &lt;http://www.gnu.org/licenses/&gt;.

#
# Test the `guix gc&apos; command-line utility.
#

guix gc --version

trap &quot;rm -f guix-gc-root&quot; EXIT
rm -f guix-gc-root

# Below we are using &apos;drv&apos; and &apos;out&apos; to contain store file names.  If &apos;drv&apos;
# and &apos;out&apos; are environment variables, &apos;list-runtime-roots&apos; will &quot;see&quot; them
# and thus prevent $drv and $out from being garbage-collected.  Using &apos;unset&apos;
# allows us to make sure these are truly local shell variables and not
# environments variables.
unset drv
unset out

# For some operations, passing extra arguments is an error.
for option in &quot;&quot; &quot;-C 500M&quot; &quot;--verify&quot; &quot;--optimize&quot; &quot;--list-roots&quot;
do
    guix gc $option whatever &amp;&amp; false
done

# This should fail.
guix gc --verify=foo &amp;&amp; false

# Check the references of a .drv.
drv=&quot;`guix build guile-bootstrap -d`&quot;
out=&quot;`guix build guile-bootstrap`&quot;
test -f &quot;$drv&quot; &amp;&amp; test -d &quot;$out&quot;

guix gc --references &quot;$drv&quot; | grep -e -bash
guix gc --references &quot;$out&quot;
guix gc --references &quot;$out/bin/guile&quot;

guix gc --references /dev/null &amp;&amp; false

# Check derivers.
guix gc --derivers &quot;$out&quot; | grep &quot;$drv&quot;

# Add then reclaim a .drv file.
drv=&quot;`guix build idutils -d`&quot;
test -f &quot;$drv&quot;

guix gc --list-dead | grep &quot;$drv&quot;
guix gc --delete &quot;$drv&quot;
test ! -f &quot;$drv&quot;

# Add a .drv, register it as a root.
drv=&quot;`guix build --root=guix-gc-root lsh -d`&quot;
test -f &quot;$drv&quot; &amp;&amp; test -L guix-gc-root

guix gc --list-roots | grep &quot;$PWD/guix-gc-root&quot;

guix gc --list-live | grep &quot;$drv&quot;
guix gc --delete &quot;$drv&quot; &amp;&amp; false

rm guix-gc-root
guix gc --list-dead | grep &quot;$drv&quot;
guix gc --delete &quot;$drv&quot;
test ! -f &quot;$drv&quot;

# Try a random collection.
guix gc -C 1KiB

# Check trivial error cases.
guix gc --delete /dev/null &amp;&amp; false

# Bug #19757
out=&quot;`guix build guile-bootstrap`&quot;
test -d &quot;$out&quot;

guix gc --delete &quot;$out&quot;

test ! -d &quot;$out&quot;

out=&quot;`guix build guile-bootstrap`&quot;
test -d &quot;$out&quot;

guix gc --delete &quot;$out/&quot;

test ! -d &quot;$out&quot;

out=&quot;`guix build guile-bootstrap`&quot;
test -d &quot;$out&quot;

guix gc --delete &quot;$out/bin/guile&quot;
</pre>
</div></div> <!-- class=content -->
                         <div class=footer>generated by
                             <a href="https://git.zx2c4.com/cgit/about/">
                                 cgit
                             </a>
                         </div>
                        </div> <!-- id=cgit -->
</body>
</html>
