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

Using gitclone without a specified folder fails #103

Closed
David00 opened this issue Jan 19, 2021 · 1 comment
Closed

Using gitclone without a specified folder fails #103

David00 opened this issue Jan 19, 2021 · 1 comment

Comments

@David00
Copy link

David00 commented Jan 19, 2021

Hi,

First of all, thanks for being such an awesome contributor to the 3D printing community, and of course for this project too!

I'm working on building a custom image for my Raspberry Pi Power Monitor project using CustomPiOS and have uncovered an issue with the gitclone function in common.sh.

The comments in the gitclone function state:

# if second parameter is not provided last URL segment of the BUILD repo URL
# minus the optional .git postfix will be used

However, I've found this to not be the case.

I have my REPO_SHIP variable defined in the config file located in ~/CustomPiOS/src/distros/powermon/src/modules/powermon/ :
[ -n "$POWERMON_POWERMON_REPO_SHIP" ] || POWERMON_POWERMON_REPO_SHIP=https://github.com/David00/rpi-power-monitor.git

And in my start_chroot_script (same folder as the config above), I am calling gitclone like this:

cd /home/pi
gitclone POWERMON_POWERMON_REPO

I'm building with the Docker image on Ubuntu 18.04 server, and it eventually fails with the following output:

+ build_repo=
+ ship_repo=https://github.com/David00/rpi-power-monitor.git
+ branch=
+ '[' '!' -n '' ']'
+ build_repo=https://github.com/David00/rpi-power-monitor.git
+ clone_params=
+ repo_recursive=
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ repo_dir=
+ '[' '!' -n '' ']'
++ echo
++ sed 's%^.*/\([^/]*\)\(\.git\)?$%\1%g'
+ repo_dir=
+ sudo -u pi git clone https://github.com/David00/rpi-power-monitor.git ''
sudo: unable to resolve host 87672414d467: Name or service not known
fatal: could not create work tree dir '': No such file or directory
++++ echo_red 'build failed, unmounting image...'
++++ echo -e -n '\e[91m'
++++ echo build failed, unmounting image...
build failed, unmounting image...

It's easy to specify a directory, and this works fine as a workaround... I just wanted to mention the misleading comment in the gitclone definition.

@guysoft
Copy link
Owner

guysoft commented Jan 20, 2021

Indeed, an error with perhaps a usage example would help out.
I have no time for this and a PR would be welcome.

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

No branches or pull requests

2 participants