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

Fix bug when using branches in sources #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tuaris
Copy link

@tuaris tuaris commented Feb 24, 2024

I think you need to replace spaces with "_". Otherwise Portshaker gets confused when you use Git branches in some sources, and tries to call the merge_to sub command like:

merge_to -m source branch -t /usr/local/poudriere/ports/target

I think you need to replace spaces with "_".  Otherwise Portshaker gets confused when you use Git branches in some sources, and tries to call the `merge_to` sub command like:

```
merge_to -m source branch -t /usr/local/poudriere/ports/target
```
@tuaris
Copy link
Author

tuaris commented Aug 3, 2024

This patch/PR will fix the problem where Portshaker would randomly spit out the following when you are using a Git branch name in your merge_from sources in portshaker.conf :

usage: /usr/local/etc/portshaker.d/github merge_to [-ap] [-b build] -m master -t target
Supported arguments:
  -a  Automatically copy port if files where touched but version is unchanged
  -b  Tinderboy build to add copied packages to
  -m  Master source ports tree (for comparing Mk/* files)
  -p  Show what is going to happen but do not do anything (pretend mode)
  -t  Target directory to merge the ports tree in

@smortex
Copy link
Owner

smortex commented Aug 3, 2024

Hum, the project got its root before FreeBSD switched to git, I am not sure if spaces in branch names where a possible thing with svn, but the presence of quotes at this location make me think that the code should handle it (and quotes are probably missing somewhere else).

Either we should:

  1. spot where the code fail to keep the argument with spaces as a single one (set -x might help), but some constructs like getopt(1) can't cope with it, or
  2. make this systematic and transform all branch names with spaces to turn them in something else (but how to deal with 2 branches 'work in progress' and 'work_in_progress').

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants