haghish / github

a module for building, searching, installing, managing, and mining Stata packages from GitHub
http://haghish.github.io/github/
101 stars 41 forks source link

HTTPS compatibility issue #2

Closed mronkko closed 5 years ago

mronkko commented 7 years ago

Older versions of Stata do not support HTTPS and some of the more recent versions (e.g. 13, with no updates) in principle do support HTTPS but are buggy and it does not work.

You could consider implementing something like follows (this is for Windows) to overcome the fact that not all Stata versions can install over HTTPS

shell powershell -command "& {iwr https://github.com/haghish/Weaver/archive/master.zip -OutFile weaver.zip }"
unzipfile weaver.zip
net install weaver, force from("H:/Weaver-master")

erase weaver.zip
!rmdir H:\Weaver-master  /s /q

This is a piece of code that I actually use ;)

Mikko

haghish commented 7 years ago

Thanks Mikko. You know all about the trouble of installing from https :) And this work on Windows as well?

mronkko commented 7 years ago

That works only on Windows. In Mac you need something different. I can provide a patch a bit later.

On 9 Nov 2016, at 24:31 , E. F. Haghish notifications@github.com wrote:

Thanks Mikko. You know all about the trouble of installing from https :) And this work on Windows as well?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/haghish/github/issues/2#issuecomment-259136481, or mute the thread https://github.com/notifications/unsubscribe-auth/AAijTjvgn9SnvzAAnQ-BT8mtt_oqufbwks5q8HmZgaJpZM4KsYJz.

haghish commented 5 years ago

I tried the code you suggested and it did not work. I will be very interested to any suggestion for fixing this problem on older versions of Stata

mronkko commented 5 years ago

I can take a look at it on my home computer, which has Stata 11 installed. Can you point me to the file and line number where the GitHub package does the download? I could then do a patch against that file to download with a shell script. It should be one line fix.

haghish commented 5 years ago

sure. If you check this file https://github.com/haghish/github/blob/master/github.ado, there are a couple of occasions where the copy command is used.

  1. Once for listing the files of the package https://github.com/haghish/github/blob/master/github.ado#L316
  2. and once for downloading it: <quietly copy "path'" "package'-`version'.zip", replace>

We could add an if/else command based on c(stata_version) if this macro exists on Stata 11 and the proceed based on the operating systems.

Thank you for your help

mronkko commented 5 years ago

Given that the problem is the copy program and its lack of https support for older versions of Stata, we could write a program copyhttp that calls either the copy program on recent Stata versions or operating system commands in older ones. I will do a bit of experimenting on the old version when I get home.

On 15 Nov 2018, at 11.37, E. F. Haghish notifications@github.com<mailto:notifications@github.com> wrote:

sure. If you check this file https://github.com/haghish/github/blob/master/github.ado, there are a couple of occasions where the copy command is used.

  1. Once for listing the files of the package https://github.com/haghish/github/blob/master/github.ado#L316
  2. and once for downloading it: <quietly copy "path'" "package'-`version'.zip", replace>

We could add an if/else command based on c(stata_version) if this macro exists on Stata 11 and the proceed based on the operating systems.

Thank you for your help

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/haghish/github/issues/2#issuecomment-438977832, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAijTrt0rZMylkfhLMDSftJQvPylr_thks5uvTXmgaJpZM4KsYJz.

haghish commented 5 years ago

I look forward to it.

haghish commented 5 years ago

From version 2.0, github will only support Stata version 14 and newer releases... the package makes excessive connections with GitHub and a Stata 13 workaround for HTTPS access probably won't be feasible anymore, give the amount of change it requires in the code. However, any merge request for fixing this problem for older versions of Stata will be warmly accepted.