mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-22 22:42:28 +00:00
fixed some bugs with manifest preperation in new factored
manifest handling sequence.
This commit is contained in:
parent
e473e5b6df
commit
9c62f07154
@ -1190,7 +1190,10 @@ int app_rhizome_add_file(int argc, const char *const *argv, struct command_line_
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* bind an ID for the manifest, and also bind the file.
|
/* bind an ID for the manifest, and also bind the file.
|
||||||
Then finalise the manifest. */
|
Then finalise the manifest.
|
||||||
|
|
||||||
|
But if the manifest already contains an ID, don't override it. */
|
||||||
|
if (rhizome_manifest_get(m, "id", NULL, 0)==NULL)
|
||||||
if (rhizome_manifest_bind_id(m,authorSid))
|
if (rhizome_manifest_bind_id(m,authorSid))
|
||||||
return WHY("Could not bind manifest to an ID");
|
return WHY("Could not bind manifest to an ID");
|
||||||
#warning need to sanely determine whether to encrypt a file
|
#warning need to sanely determine whether to encrypt a file
|
||||||
@ -1204,9 +1207,11 @@ int app_rhizome_add_file(int argc, const char *const *argv, struct command_line_
|
|||||||
rhizome_manifest *mout = NULL;
|
rhizome_manifest *mout = NULL;
|
||||||
if (debug & DEBUG_RHIZOME) DEBUGF("rhizome_add_manifest(author='%s')", authorSid);
|
if (debug & DEBUG_RHIZOME) DEBUGF("rhizome_add_manifest(author='%s')", authorSid);
|
||||||
|
|
||||||
|
int ret=0;
|
||||||
if (rhizome_manifest_check_duplicate(m,&mout)==2)
|
if (rhizome_manifest_check_duplicate(m,&mout)==2)
|
||||||
{
|
{
|
||||||
/* duplicate */
|
/* duplicate */
|
||||||
|
ret=2;
|
||||||
} else {
|
} else {
|
||||||
/* not duplicate, so finalise and add to database */
|
/* not duplicate, so finalise and add to database */
|
||||||
if (rhizome_manifest_finalise(m)) {
|
if (rhizome_manifest_finalise(m)) {
|
||||||
@ -1222,7 +1227,6 @@ int app_rhizome_add_file(int argc, const char *const *argv, struct command_line_
|
|||||||
/* If successfully added, overwrite the manifest file so that the Java component that is
|
/* If successfully added, overwrite the manifest file so that the Java component that is
|
||||||
invoking this command can read it to obtain feedback on the result. */
|
invoking this command can read it to obtain feedback on the result. */
|
||||||
rhizome_manifest *mwritten=mout?mout:m;
|
rhizome_manifest *mwritten=mout?mout:m;
|
||||||
int ret=0;
|
|
||||||
if (manifestpath[0]
|
if (manifestpath[0]
|
||||||
&& rhizome_write_manifest_file(mwritten, manifestpath) == -1)
|
&& rhizome_write_manifest_file(mwritten, manifestpath) == -1)
|
||||||
ret = WHY("Could not overwrite manifest file.");
|
ret = WHY("Could not overwrite manifest file.");
|
||||||
|
Loading…
Reference in New Issue
Block a user