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

allows nesting in the package name and print output from execute command #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

annaborn
Copy link

@annaborn annaborn commented Feb 8, 2018

there is a bug with deep nesting package name, e.g. gui/osgviz/osgviz. since it took just the last split, the repository path was wrong. /gui-osgviz, but right is /gui-osgviz-osgviz
so this patch allows deeper nesting package name.

@annaborn
Copy link
Author

annaborn commented Feb 8, 2018

@AlexanderFabisch please check the pull request

@malter
Copy link
Member

malter commented Feb 8, 2018

Maybe, we should only print the output in case of an error?
I don't know exactly how autoproj behaves, so I assume the rule for the other commit is always correct?

@@ -83,7 +83,8 @@ def checkBaseName(package, info):
if "$" in info["gitPackage"] and "*" not in package:
info["basename"] = info["gitPackage"]
info["gitPackage"] = info["gitPackage"].replace("$PACKAGE_BASENAME",
package.split("/")[-1])
'-'.join((package.split("/")[1:])))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are too many brackets.

Copy link
Author

@annaborn annaborn Mar 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexanderFabisch do you mean readability of the line?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(package.split("/")[1:]) is not necessary.

@@ -117,7 +118,9 @@ def clonePackage(cfg, package, server, gitPackage, branch):
cmd = ["git", "clone", "-o", "autobuild", "-q", server+gitPackage, clonePath]
if branch:
cmd += ["-b", branch]
execute.do(cmd, cfg)
out, err, r = execute.do(cmd, cfg)
print out
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexanderFabisch it is usefull to have output message for debug purposes. is there any debug mode?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. @malter should know this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexanderFabisch
what is the reason not to have output message for debug purpose?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment, this would be the only command that actually prints output to stdout. If we added a debug mode, that would be OK but that should be done in another pull request.

execute.do(cmd, cfg)
out, err, r = execute.do(cmd, cfg)
print out
print err
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @malter suggested:

if err:
    print(err)

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.

3 participants