Bo Peng wrote:
This makes unbundling, namely extracting all embedded files, almost
irrelevant. But I do agree that unbundling is a good feature to have.
Because unbundling, under my design, will change .lyx file in an
intrusive way, I proposed to make it something similar to
"File->Export->LyX with extracted files". A Python script will be
called to extract a .lyx file to a new directory (e.g.
filename.extracted under the document directory), and arrange files in
their original layout. The layout proposed by Enrico, in which .lyx
file can be a few levels down filename.extracted can be used to keep
out of tree files. Full reversibility is achieved in this way at a
cost of convenience.
By "full reversibility", I take it you mean that you can completely
"undo" the bundling, so that the filesystem is restored to its original
state. In my view---and I thought we'd all agreed about this---this
introduces unacceptable security risks. UNDER NO CIRCUMSTANCES should
LyX be able to write embedded files to arbitrary locations in the file
system. So if this is what you are aiming at, then you should stop
aiming at it.
If it isn't already obvious, the business about encoding the file
mapping is not relevant here.
If this isn't what you're aiming at, then you don't have full
reversibility, in the above sense, and I'm not sure what it is you do
have. If you're not extracting the embedded files to the original
locations, why worry about where they go? Why not just extract
everything to filename.lyxdir? But then there's no difference between
the result you get and what you'd have from my implementation.
Richard