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

Packaging (exporting) operation is not idempotent #611

Open
isc-shuliu opened this issue Oct 30, 2024 · 6 comments
Open

Packaging (exporting) operation is not idempotent #611

isc-shuliu opened this issue Oct 30, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@isc-shuliu
Copy link
Collaborator

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 isc-shuliu added the bug Something isn't working label Oct 30, 2024
@isc-shuliu isc-shuliu self-assigned this Oct 30, 2024
@janihur
Copy link

janihur commented Oct 31, 2024

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

@janihur
Copy link

janihur commented Oct 31, 2024

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?

@isc-shuliu
Copy link
Collaborator Author

isc-shuliu commented Oct 31, 2024

@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
Copy link
Collaborator Author

@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-kiyer
Copy link
Collaborator

isc-kiyer commented Oct 31, 2024

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

@janihur
Copy link

janihur commented Nov 1, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: To do
Development

No branches or pull requests

3 participants