.2.3'/>
<meta name='robots' content='noindex, nofollow'/>
<link rel='stylesheet' type='text/css' href='/cgit-static/cgit.css'/>
<link rel='stylesheet' type='text/css' href='/cgit-static/better-cgit-markdown-heading-color.css'/>
<link rel='shortcut icon' href='/cgit-static/favicon.ico'/>
<link rel='alternate' title='Atom feed' href='https://git.koszko.org/guix/atom/?h=koszko' type='application/atom+xml'/>
</head>
<body>
<div id='cgit'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/'><img src='https://git.koszko.org/cgit-static/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/'>index</a> : <a href='/guix/'>guix</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='9b78699744b0c4c8af28820cc4f0d59b9d317ead'/><select name='h' onchange='this.form.submit();'>
<option value='koszko' selected='selected'>koszko</option>
<option value='koszko-scripts'>koszko-scripts</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Wojtek's customized Guix</td><td class='sub right'></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=9b78699744b0c4c8af28820cc4f0d59b9d317ead'>refs</a><a href='/guix/log/'>log</a><a href='/guix/tree/?id=9b78699744b0c4c8af28820cc4f0d59b9d317ead'>tree</a><a href='/guix/commit/?id=9b78699744b0c4c8af28820cc4f0d59b9d317ead'>commit</a><a href='/guix/diff/?id=9b78699744b0c4c8af28820cc4f0d59b9d317ead'>diff</a></td><td class='form'><form class='right' method='get' action='/guix/log/'>
<input type='hidden' name='id' value='9b78699744b0c4c8af28820cc4f0d59b9d317ead'/><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, 2014, 2015, 2019, 2020 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 &apos;guix archive&apos; command-line utility.
#

guix archive --version

archive=&quot;t-archive-$$&quot;
archive_alt=&quot;t-archive-alt-$$&quot;
tmpdir=&quot;t-archive-dir-$$&quot;
rm -f &quot;$archive&quot; &quot;$archive_alt&quot;
rm -rf &quot;$tmpdir&quot;

trap &apos;rm -f &quot;$archive&quot; &quot;$archive_alt&quot;; chmod -R +w &quot;$tmpdir&quot;; rm -rf &quot;$tmpdir&quot;&apos; EXIT

guix archive --export guile-bootstrap &gt; &quot;$archive&quot;
guix archive --export guile-bootstrap:out &gt; &quot;$archive_alt&quot;
cmp &quot;$archive&quot; &quot;$archive_alt&quot;

guix archive --export							\
    -e &apos;(@ (gnu packages bootstrap) %bootstrap-guile)&apos; &gt; &quot;$archive_alt&quot;
cmp &quot;$archive&quot; &quot;$archive_alt&quot;

guix archive --export `guix build guile-bootstrap` &gt; &quot;$archive_alt&quot;
cmp &quot;$archive&quot; &quot;$archive_alt&quot;

# Check the exit value upon import.
guix archive --import &lt; &quot;$archive&quot;

guix archive --export something-that-does-not-exist &amp;&amp; false

# This one must not be listed as missing.
guix build guile-bootstrap &gt; &quot;$archive&quot;
guix archive --missing &lt; &quot;$archive&quot;
test &quot;`guix archive --missing &lt; &quot;$archive&quot;`&quot; = &quot;&quot;

# Two out of three should be listed as missing.
echo &quot;$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo&quot; &gt;&gt; &quot;$archive&quot;
echo &quot;$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar&quot; &gt;&gt; &quot;$archive&quot;
guix archive --missing &lt; &quot;$archive&quot; &gt; &quot;$archive_alt&quot;
echo &quot;$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo&quot; &gt; &quot;$archive&quot;
echo &quot;$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar&quot; &gt;&gt; &quot;$archive&quot;
cmp &quot;$archive&quot; &quot;$archive_alt&quot;

# This is not a valid store file name, so an error.
echo something invalid &gt; &quot;$archive&quot;
guix archive --missing &lt; &quot;$archive&quot; &amp;&amp; false

# Check &apos;--extract&apos;.
guile -c &quot;(use-modules (guix serialization))
  (call-with-output-file \&quot;$archive\&quot;
    (lambda (port)
      (write-file \&quot;$(guix build guile-bootstrap)\&quot; port)))&quot;
guix archive -x &quot;$tmpdir&quot; &lt; &quot;$archive&quot;
test -x &quot;$tmpdir/bin/guile&quot;
test -d &quot;$tmpdir/lib/guile&quot;

# Check &apos;--list&apos;.
guix archive -t &lt; &quot;$archive&quot; | grep &quot;^D /share/guile&quot;
guix archive -t &lt; &quot;$archive&quot; | grep &quot;^x /bin/guile&quot;
guix archive -t &lt; &quot;$archive&quot; | grep &quot;^r /share/guile.*/boot-9\.scm&quot;

echo foo | guix archive --authorize &amp;&amp; false

exit 0
</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>
