clearlinux / mixer-tools

Software update mixer and related tools
Apache License 2.0
28 stars 37 forks source link

Provide an option to create a local bundle without copying from upstream #713

Closed reaganlo closed 4 years ago

reaganlo commented 4 years ago

Currently, during bundle create, Mixer copies the bundle definition from upstream if it exists. This can remain as the default behavior. But users should be able to explicitly create a new local bundle even if the name exists upstream. This can be done by introducing a --localflag for mixer bundle create. E.g. mixer bundle create os-core --local This should create an empty os-core definition file in the \ directory with only the header information. If the file already exists in the directory, do not overwrite it. Inform the user with a message Bundle "os-core" already exists in local-bundles; skipping

ashleshaAtrey commented 4 years ago

@reaganlo should we overwrite the file if it already exists? as bundle create is alias to bundle edit as well. And current default for upstream is to overwrite the destination file if it exists.

reaganlo commented 4 years ago

I intentionally wanted to change the current behavior even for default case (mixer bundle create/edit bundlename). If bundle name already exists in local-bundles, then do not overwrite. Instead inform the user with a messageBundle "os-core" already exists in local-bundles; skipping

ashleshaAtrey commented 4 years ago

as per offline discussion, it makes sense to inform user that bundle definition file already exist and skip checking further

ashleshaAtrey commented 4 years ago

This change wont affect anything for devops. if local file exists, we just skip checking upstream. if local doesn't exists, we check if bundle exists upstream . If it does, download and overwrite with latest and copy to local dir. This is the current flow and this flow will remain the same.

reaganlo commented 4 years ago

Sounds good. Thanks for following up.

reaganlo commented 4 years ago

@ashleshaAtrey Let the message indicate the full path of the local-bundles dir.. Bundle "os-core" already exists in <local-bundles>; skipping