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

try to detect protocol for user #810

Closed
doutriaux1 opened this issue Oct 15, 2014 · 5 comments
Closed

try to detect protocol for user #810

doutriaux1 opened this issue Oct 15, 2014 · 5 comments
Assignees
Milestone

Comments

@doutriaux1
Copy link
Contributor

@doutriaux1 doutriaux1 commented Oct 15, 2014

@aashish24 this is what I use to detect git port for my users in my install script

    mkdir -p ${uvcdat_build_directory}
    [ $? != 0 ] && checked_done 1
    pushd ${uvcdat_build_directory} >& /dev/null
    local cdat_git_protocol="git://"
    if [ ! -d ${uvcdat_build_directory}/uvcdat ]; then
      echo "Fetching the cdat project from GIT Repo..."
      ((DEBUG)) && echo "${cdat_repo}"
      git clone ${cdat_repo} uvcdat
      if [ ! -d ${uvcdat_build_directory}/uvcdat/.git ]; then
        cdat_git_protocol="https://"
        echo "Apparently was not able to fetch from GIT repo using git protocol. (port 9418).. trying https protocol..."
        ((DEBUG)) && echo "${cdat_repo_https}"
        git clone ${cdat_repo_https} uvcdat
        if [ ! -d ${uvcdat_build_directory}/uvcdat/.git ]; then
          cdat_git_protocol="http://"
          echo "Was still not able to fetch from GIT repo this time using https protocol... (port 22) trying http protocol..."
          ((DEBUG)) && echo "${cdat_repo_http}"
          git clone ${cdat_repo_http} uvcdat
          [ ! -d ${uvcdat_build_directory}/uvcdat/.git ] && echo "Could not fetch from cdat's repo (with git, https nor http protocol)i please check your internet connection and firewall settings" && checked_done 1
        fi
      fi
    fi

@dlonie or @cjh1 can probably turn that into a find_git_port.cmake

@doutriaux1
Copy link
Contributor Author

@doutriaux1 doutriaux1 commented Oct 15, 2014

many thanks to @gavinmbell for the original script

@aashish24
Copy link
Contributor

@aashish24 aashish24 commented Oct 15, 2014

Sounds good. This sounds provide a good start. We probably have to delete the clone afterwards (and also clone just the HEAD). I was thinking along the same lines. We may have something in git that can check if a URL is accessible.

@doutriaux1
Copy link
Contributor Author

@doutriaux1 doutriaux1 commented Oct 15, 2014

yes and we could also create a tiny repo just for that purpose. In my case I do need to clone the whole repo in order to build so it was ok. In this case creating a small repo somewhere is probably better.

@doutriaux1 doutriaux1 removed this from the 2.1 milestone Feb 2, 2015
@doutriaux1 doutriaux1 added this to the 2.2 milestone Feb 2, 2015
@doutriaux1 doutriaux1 added this to the 2.2 milestone Feb 2, 2015
@doutriaux1 doutriaux1 removed this from the 2.1 milestone Feb 2, 2015
@doutriaux1
Copy link
Contributor Author

@doutriaux1 doutriaux1 commented Feb 21, 2015

@aashish24 didn't you already fix this?

@aashish24
Copy link
Contributor

@aashish24 aashish24 commented Feb 21, 2015

Yes it is fixed!

@aashish24 aashish24 closed this Feb 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants