ipm icon indicating copy to clipboard operation
ipm copied to clipboard

Packaging (exporting) operation is not idempotent

Open isc-shuliu opened this issue 1 year ago • 6 comments

When running zpm-registry package -only -DPath=/tmp/exported/zpm-registry -verbose for the first time, it creates a folder and a tarball

zpm-registry
zpm-registry.tgz

However, when subsequently running the command for a second time, 4 more files are created:

zpm-registr.tgz
zpm-registry
zpm-registry.modules
zpm-registry.tgz
zpm-registrymodule.xml
zpm-registrysrc

isc-shuliu avatar Oct 30 '24 18:10 isc-shuliu

What's that -DPath flag? The v0.7.3 help doesn't know about it. I was expecting to see -path here.

janihur avatar Oct 31 '24 10:10 janihur

A related issue: The package command doesn't clean up the temporary directory it creates. IMO the result of the command is the module package (i.e. tar) file, not the directory. Or is there some point of view I don't get?

janihur avatar Oct 31 '24 10:10 janihur

@janihur

What's that -DPath flag? The v0.7.3 help doesn't know about it. I was expecting to see -path here.

It's a way to pass "data" to IPM commands. You're right that it's not documented and we will probably deprecate such usage in favor of -path modifier in the future. I'm going to open a PR for this.

isc-shuliu avatar Oct 31 '24 12:10 isc-shuliu

@isc-tleavitt @isc-kiyer

A related issue: The package command doesn't clean up the temporary directory it creates. IMO the result of the command is the module package (i.e. tar) file, not the directory. Or is there some point of view I don't get?

Is there any reason we keep the directory in addition to the tarball or shall I go ahead and remove it? If we remove it, we probably solve the main thread issue as well.

isc-shuliu avatar Oct 31 '24 12:10 isc-shuliu

Is there any reason we keep the directory in addition to the tarball or shall I go ahead and remove it? If we remove it, we probably solve the main thread issue as well.

@isc-shuliu I can't think of a reason to keep it so best to remove the directory since only the tarball is needed for both packaging and publishing. A user can always unpack the tarball to view the directory structure

isc-kiyer avatar Oct 31 '24 13:10 isc-kiyer

Also consider the case when the package tar file already exists. Automatic overwrite or something else? I don't see here a clear winner as long as the behavior is documented.

janihur avatar Nov 01 '24 08:11 janihur