mirror of
https://github.com/NixOS/nix
synced 2025-07-07 10:11:47 +02:00
* Install NixManifest.pm, NixConfig.pm and GeneratePatches.pm under
the Nix:: namespace.
This commit is contained in:
parent
659c427caa
commit
6fcdbcac20
20 changed files with 108 additions and 147 deletions
|
@ -7,22 +7,22 @@ mkdir -p $TEST_ROOT/cache2 $TEST_ROOT/patches
|
|||
RESULT=$TEST_ROOT/result
|
||||
|
||||
# Build version 1 and 2 of the "foo" package.
|
||||
$NIX_BIN_DIR/nix-push --copy $TEST_ROOT/cache2 $TEST_ROOT/manifest1 \
|
||||
nix-push --copy $TEST_ROOT/cache2 $TEST_ROOT/manifest1 \
|
||||
$($nixbuild -o $RESULT binary-patching.nix --arg version 1)
|
||||
|
||||
out2=$($nixbuild -o $RESULT binary-patching.nix --arg version 2)
|
||||
$NIX_BIN_DIR/nix-push --copy $TEST_ROOT/cache2 $TEST_ROOT/manifest2 $out2
|
||||
nix-push --copy $TEST_ROOT/cache2 $TEST_ROOT/manifest2 $out2
|
||||
|
||||
out3=$($nixbuild -o $RESULT binary-patching.nix --arg version 3)
|
||||
$NIX_BIN_DIR/nix-push --copy $TEST_ROOT/cache2 $TEST_ROOT/manifest3 $out3
|
||||
nix-push --copy $TEST_ROOT/cache2 $TEST_ROOT/manifest3 $out3
|
||||
|
||||
rm $RESULT
|
||||
|
||||
# Generate binary patches.
|
||||
$NIX_BIN_DIR/nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
|
||||
nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
|
||||
file://$TEST_ROOT/patches $TEST_ROOT/manifest1 $TEST_ROOT/manifest2
|
||||
|
||||
$NIX_BIN_DIR/nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
|
||||
nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
|
||||
file://$TEST_ROOT/patches $TEST_ROOT/manifest2 $TEST_ROOT/manifest3
|
||||
|
||||
grep -q "patch {" $TEST_ROOT/manifest3
|
||||
|
@ -45,7 +45,7 @@ rm $RESULT
|
|||
[ "$(grep ' patch ' $TEST_ROOT/var/log/nix/downloads | wc -l)" -eq 2 ]
|
||||
|
||||
# Add a patch from version 1 directly to version 3.
|
||||
$NIX_BIN_DIR/nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
|
||||
nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
|
||||
file://$TEST_ROOT/patches $TEST_ROOT/manifest1 $TEST_ROOT/manifest3
|
||||
|
||||
# Rebuild version 3. This should use the direct patch rather than the
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set -e
|
||||
|
||||
export TOP=$(pwd)/..
|
||||
|
||||
export TEST_ROOT=$(pwd)/test-tmp
|
||||
export NIX_STORE_DIR
|
||||
if ! NIX_STORE_DIR=$(readlink -f $TEST_ROOT/store 2> /dev/null); then
|
||||
|
@ -15,9 +17,12 @@ export NIX_DB_DIR=$TEST_ROOT/db
|
|||
export NIX_CONF_DIR=$TEST_ROOT/etc
|
||||
export NIX_BIN_DIR=$TEST_ROOT/bin
|
||||
export NIX_LIBEXEC_DIR=$TEST_ROOT/bin
|
||||
export NIX_MANIFESTS_DIR=$TEST_ROOT/var/nix/manifests
|
||||
export NIX_ROOT_FINDER=
|
||||
export SHARED=$TEST_ROOT/shared
|
||||
|
||||
export PATH=$NIX_BIN_DIR:$TOP/scripts:$PATH
|
||||
|
||||
export NIX_REMOTE=
|
||||
|
||||
export REAL_BIN_DIR=@bindir@
|
||||
|
@ -27,10 +32,10 @@ export REAL_DATA_DIR=@datadir@
|
|||
export REAL_STORE_DIR=@storedir@
|
||||
export NIX_BUILD_HOOK=
|
||||
export PERL=perl
|
||||
export TOP=$(pwd)/..
|
||||
export bzip2_bin_test="@bzip2_bin_test@"
|
||||
if test "${bzip2_bin_test:0:1}" != "/"; then
|
||||
bzip2_bin_test=`pwd`/${bzip2_bin_test}
|
||||
export PERL5LIB=$TOP/perl/lib
|
||||
export NIX_BZIP2="@bzip2_bin_test@/bzip2"
|
||||
if test "${NIX_BZIP2:0:1}" != "/"; then
|
||||
NIX_BZIP2=`pwd`/${NIX_BZIP2}
|
||||
fi
|
||||
export dot=@dot@
|
||||
export xmllint="@xmllint@"
|
||||
|
|
|
@ -29,16 +29,11 @@ ln -s $TOP/scripts/nix-prefetch-url $NIX_BIN_DIR/
|
|||
ln -s $TOP/scripts/nix-collect-garbage $NIX_BIN_DIR/
|
||||
ln -s $TOP/scripts/nix-build $NIX_BIN_DIR/
|
||||
ln -s $TOP/scripts/nix-install-package $NIX_BIN_DIR/
|
||||
ln -s $TOP/scripts/nix-push $NIX_BIN_DIR/
|
||||
ln -s $TOP/scripts/nix-pull $NIX_BIN_DIR/
|
||||
ln -s $TOP/scripts/nix-generate-patches $NIX_BIN_DIR/
|
||||
mkdir $NIX_BIN_DIR/nix
|
||||
ln -s $bzip2_bin_test/bzip2 $NIX_BIN_DIR/nix/
|
||||
ln -s $bzip2_bin_test/bunzip2 $NIX_BIN_DIR/nix/
|
||||
ln -s $NIX_BZIP2 $NIX_BIN_DIR/nix/
|
||||
ln -s $TOP/scripts/copy-from-other-stores.pl $NIX_BIN_DIR/nix/
|
||||
ln -s $TOP/scripts/download-using-manifests.pl $NIX_BIN_DIR/nix/
|
||||
ln -s $TOP/scripts/GeneratePatches.pm $NIX_BIN_DIR/nix/
|
||||
ln -s $TOP/scripts/NixManifest.pm $NIX_BIN_DIR/nix/
|
||||
|
||||
cat > "$NIX_CONF_DIR"/nix.conf <<EOF
|
||||
gc-keep-outputs = false
|
||||
|
@ -53,17 +48,6 @@ cp -pr $TOP/corepkgs $NIX_DATA_DIR/nix/
|
|||
# (and likely to fail).
|
||||
for i in \
|
||||
$NIX_DATA_DIR/nix/corepkgs/nar/nar.sh \
|
||||
$NIX_BIN_DIR/nix/download-using-manifests.pl \
|
||||
$NIX_BIN_DIR/nix/copy-from-other-stores.pl \
|
||||
$NIX_BIN_DIR/nix-prefetch-url \
|
||||
$NIX_BIN_DIR/nix-collect-garbage \
|
||||
$NIX_BIN_DIR/nix-build \
|
||||
$NIX_BIN_DIR/nix-install-package \
|
||||
$NIX_BIN_DIR/nix-push \
|
||||
$NIX_BIN_DIR/nix-pull \
|
||||
$NIX_BIN_DIR/nix-generate-patches \
|
||||
$NIX_BIN_DIR/nix/NixManifest.pm \
|
||||
$NIX_BIN_DIR/nix/GeneratePatches.pm \
|
||||
; do
|
||||
sed < $i > $i.tmp \
|
||||
-e "s^$REAL_BIN_DIR/nix-store^$NIX_BIN_DIR/nix-store^" \
|
||||
|
|
|
@ -2,7 +2,7 @@ source common.sh
|
|||
|
||||
pullCache () {
|
||||
echo "pulling cache..."
|
||||
$NIX_BIN_DIR/nix-pull file://$TEST_ROOT/manifest
|
||||
nix-pull file://$TEST_ROOT/manifest
|
||||
}
|
||||
|
||||
clearStore
|
||||
|
|
|
@ -7,5 +7,4 @@ echo "pushing $drvPath"
|
|||
|
||||
mkdir -p $TEST_ROOT/cache
|
||||
|
||||
$NIX_BIN_DIR/nix-push \
|
||||
--copy $TEST_ROOT/cache $TEST_ROOT/manifest $drvPath
|
||||
nix-push --copy $TEST_ROOT/cache $TEST_ROOT/manifest $drvPath
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue