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

Add option to include pinned-state in the choco export command #2603

Open
Cyber1000 opened this issue Feb 24, 2022 · 5 comments · May be fixed by #2618
Open

Add option to include pinned-state in the choco export command #2603

Cyber1000 opened this issue Feb 24, 2022 · 5 comments · May be fixed by #2618
Assignees
Labels
3 - Review Has related issue This issue has a related issue that would need to be addressed before this issue could be closed. Improvement

Comments

@Cyber1000
Copy link

Similar to #2503 where install-args are included in export-file, I would like to have pinned-state included in export.
I'm aware that pinned state isn't known at install time, but it would be helpful to get the same state on a new computer as before.

For now I'm helping myself without "choco export" (I've using this longer than "choco export" exists):

(choco pin -y |%{$_ -replace '(.+?)|(.+)','choco install $1 --version $2'} | select -Skip 1) >C:\Backup\choco.install.ps1
(choco pin -y |%{$_ -replace '(.+?)|.+','choco pin add -n=''$1'''} | select -Skip 1)>>C:\Backup\choco.install.ps1
"choco install -y",[string]::Join(" ", (clist -l -r |%{$_ -replace '(.+?)|.+','$1'} | select)) -join " " >>C:\Backup\choco.install.ps1

  • first line writes install command for all pinned packages
  • second line writes a "pin" for all pinned packages
  • third line writes rest of packages
  • On new computer I just have to execute C:\Backup\choco.install.ps1 (I don't have special install arguments, pins where more important to me)

Would be nice if choco implements an export fully (with pins).
Thanks!

@TheCakeIsNaOH TheCakeIsNaOH added 0 - Backlog Improvement Has related issue This issue has a related issue that would need to be addressed before this issue could be closed. labels Feb 25, 2022
@TheCakeIsNaOH
Copy link
Member

To implement this, it will require that #798 is completed first, as that will add the ability to pin a package during install. And basing this on #2503 might be ideal, as there is likely some shared code between these two.

One item for discussion is whether the pin status should be included in --include-remembered-arguments, or if a separate argument (e.g. --include-pins) should be added.

@gep13
Copy link
Member

gep13 commented Feb 26, 2022

@TheCakeIsNaOH said...
One item for discussion is whether the pin status should be included in --include-remembered-arguments, or if a separate argument (e.g. --include-pins) should be added.

This is an interesting question. Since if #798 is implemented, this would mean that a pinned package can be done by both an argument, and as a dedicated command. My gut says that this information would be included by default with the --include-remembered-arguments option, but perhaps a number option would be included to --exclude-pins.

Thoughts?

@Cyber1000
Copy link
Author

Another option would be to always include it with the --include-remembered-arguments and have an option when installing, like so: choco install packages.config --ignore-pins

@TheCakeIsNaOH
Copy link
Member

Thoughts?

I wouldn't have any issues with that on my end. I can see situations where pins might specifically want to be excluded, having a --exclude-pins would work for that. So either that, or my suggestion of a --include-pins would work, and don't really have strong feelings either way.

and have an option when installing, like so: choco install packages.config --ignore-pins

I don't thing this is ideal, at least not as the only option. It could work code wise, I actually have a PR in for that exact flag for the upgrade command.

My ideal endgame for the packages.config is that I can run choco install packages.config, and all the options I need are included inside the file. It is for the same reason I like docker-compose rather than using docker directly most the time. I can stick the information about how I am running the container into docker-compose.yml file, then run docker-compose up to start it up, and the file can get backed up, no need to remember or separately document what options I ran it with.

So having a way to configure if I want the pins exported is ideal, because then upon reinstall, there is not a need to remember to specify another command line argument, all the information about what options I want to use is already included in the file.

TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Mar 6, 2022
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Mar 6, 2022
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
@TheCakeIsNaOH TheCakeIsNaOH linked a pull request Mar 6, 2022 that will close this issue
7 tasks
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Mar 6, 2022
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Mar 9, 2022
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Mar 21, 2022
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 27, 2022
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
@TheCakeIsNaOH TheCakeIsNaOH self-assigned this Jul 30, 2022
@gep13 gep13 added this to the 1.2.0 milestone Aug 11, 2022
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Aug 11, 2022
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
@pauby pauby removed this from the 1.2.0 milestone Aug 24, 2022
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Sep 24, 2022
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Dec 22, 2022
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Dec 23, 2022
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 7, 2023
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 13, 2023
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
@God-damnit-all

This comment was marked as off-topic.

TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 10, 2024
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Apr 28, 2024
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
gep13 pushed a commit to gep13/choco that referenced this issue Sep 25, 2024
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Dec 24, 2024
This adds the ability for the export command to include pins in the
exported file. They will be exported if --include-arguments is
specified, but can be excluded with --exclude-pins.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Review Has related issue This issue has a related issue that would need to be addressed before this issue could be closed. Improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants