portshaker
portshaker copied to clipboard
Fix bug when using branches in sources
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
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
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:
- spot where the code fail to keep the argument with spaces as a single one (
set -xmight help), but some constructs likegetopt(1)can't cope with it, or - 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!