Add an export builtin, and API to write to libarchive
At the moment I'm looking at using rpm-ostree to manage RPM inputs which can then be converted into Docker images. It's most convenient if we can stream directly out of libostree rather than doing a checkout + tar combination. There are also backup/debugging etc. reasons to implement `export` as well.
This commit is contained in:
1 parent
e9ccdd2d00
commit
355f8438ef
10 files changed
+484
-2
No files matched your search
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2016 Colin Walters <walters@verbum.org>
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the
|
||||
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
. $(dirname $0)/libtest.sh
|
||||
|
||||
setup_test_repository "archive-z2"
|
||||
|
||||
echo '1..2'
|
||||
|
||||
$OSTREE checkout test2 test2-co
|
||||
$OSTREE commit --no-xattrs -b test2-noxattrs -s "test2 without xattrs" --tree=dir=test2-co
|
||||
rm test2-co -rf
|
||||
|
||||
cd ${test_tmpdir}
|
||||
${OSTREE} 'export' test2-noxattrs -o test2.tar
|
||||
mkdir t
|
||||
(cd t && tar xf ../test2.tar)
|
||||
ostree --repo=repo diff --no-xattrs test2-noxattrs ./t > diff.txt
|
||||
assert_file_empty diff.txt
|
||||
rm test2.tar diff.txt t -rf
|
||||
|
||||
echo 'ok export gnutar diff (no xattrs)'
|
||||
|
||||
cd ${test_tmpdir}
|
||||
${OSTREE} 'export' test2 -o test2.tar
|
||||
${OSTREE} commit -b test2-from-tar -s 'Import from tar' --tree=tar=test2.tar
|
||||
ostree --repo=repo diff test2 test2-from-tar
|
||||
assert_file_empty diff.txt
|
||||
rm test2.tar diff.txt t -rf
|
||||
|
||||
echo 'ok export import'
|
||||
|
||||
Reference in new issue
Block a user