Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update in p:archive #294

Closed
ndw opened this issue Dec 15, 2019 · 1 comment · Fixed by #305
Closed

Update in p:archive #294

ndw opened this issue Dec 15, 2019 · 1 comment · Fixed by #305
Assignees

Comments

@ndw
Copy link
Collaborator

@ndw ndw commented Dec 15, 2019

I'm trying to understand the documentation for the update command in p:archive.

First we say:

Any entry in the manifest that does not exist in the ZIP file provided on the archive port is added.

Fair enough. Then we say:

For any entry that does exist in the ZIP file provided on the archive port, a timestamp compare is done. When the entry in the manifest is newer than the entry in the ZIP file provided on the archive port, it is replaced. Documents that are either specified in the manifest or come from the source port have no timestamp and will always cause a replace to be done.

Any entry that appears on the source port will be in the manifest, because a manifest entry will be constructed for it, because 2.3.1 says:

If no manifest entry is provided for a document appearing on the source port, the step will manufacture a manifest entry from the document’s base-uri property.

So I assert the second bullet could be simplified as follows:

For any entry that does exist in the ZIP file provided on the archive port, a timestamp compare is done. When the entry in the manifest is newer than the entry in the ZIP file provided on the archive port, it is replaced. Documents that are specified in the manifest have no timestamp and will always cause a replace to be done.

But then the second and third sentences directly contradict each other:

  1. When an entry in the manifest is newer...
  2. Documents in the manifest have no timestamp...

Given that this is the update command and we're talking about timestamps (which aren't in the manifest so we must mean timestamps on disk), is this a fair rewrite?

  1. For every entry in the ZIP file
  • If a manifest c:entry with a matching name exists, the entry in the ZIP file will be updated with the document identified by the manifest c:entry.
  • If a matching c:entry does not exist, the ZIP entry name is resolved against the base URI of the ZIP file.
    • If a document exists at that URI, and either has no timestamp or has a timestamp more recent than the timestamp in the ZIP entry, the entry in the ZIP file will be updated with the document at the resolved URI.
    • If no document exists at that URI, or the document cannot be accessed, or the timestamp of the ZIP entry is more recent than the timestamp of the document, then the ZIP entry is unchanged.
  1. For every c:entry in the manifest that does not have a matching entry in the ZIP file, the ZIP file will be updated by adding the document identified by the c:entry.
@ndw

This comment has been minimized.

Copy link
Collaborator Author

@ndw ndw commented Dec 16, 2019

I propose for XProc 3.1 or 4.0 or something that we add a timestamp attribute to c:entry elements so that it's possible for freshen to work with data that arrives on the manifest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.