libstore: don't abort when flat-importing non-files
fixes #705 Change-Id: I3be20235006425dd3bb6156510d021699f05b9ba
This commit is contained in:
@@ -401,12 +401,12 @@ struct RetrieveRegularNARVisitor : NARParseVisitor
|
||||
|
||||
box_ptr<NARParseVisitor> createDirectory(const std::string & name) override
|
||||
{
|
||||
assert(false && "RetrieveRegularNARVisitor::createDirectory must not be called");
|
||||
throw Error("cannot import directory using flat ingestion");
|
||||
}
|
||||
|
||||
void createSymlink(const std::string & name, const std::string & target) override
|
||||
{
|
||||
assert(false && "RetrieveRegularNARVisitor::createSymlink must not be called");
|
||||
throw Error("cannot import symlink using flat ingestion");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
source common.sh
|
||||
|
||||
expectStderr 1 nix-store --add-fixed sha256 . | grep "cannot import directory using flat ingestion"
|
||||
expectStderr 1 nix-store --add-fixed sha256 ./symlink | grep "cannot import symlink using flat ingestion"
|
||||
|
||||
expectStderr 1 nix-store --add-fixed sha1 . | grep "cannot import directory using flat ingestion"
|
||||
expectStderr 1 nix-store --add-fixed sha1 ./symlink | grep "cannot import symlink using flat ingestion"
|
||||
|
||||
path1=$(nix-store --add ./dummy)
|
||||
echo $path1
|
||||
|
||||
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
add.sh
|
||||
Reference in New Issue
Block a user