Add support for CentOS
Known issues
Core module cloning gets translated to git URL without .git extension at the end and returns an error when trying to "git clone".
Version
Refer to centos:7
and centos:latest
[root@a82d147f8245 space]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
Steps to reproduce
Fails
[root@a82d147f8245 space]# ./space -m file / -h
[info] Git clone https://gitlab.com/space-sh/file into /root/.space/space_modules/gitlab.com/space-sh/file (commit: master)
error: RPC failed; result=22, HTTP code = 404
fatal: The remote end hung up unexpectedly
[error] Could not Git clone https://gitlab.com/space-sh/file.
[error] Could not clone module repository "file".
[root@a82d147f8245 space]# ./space -m https://gitlab.com/space-sh/file / -h
[info] Git clone https://gitlab.com/space-sh/file into /root/.space/space_modules/gitlab.com/space-sh/file (commit: master)
error: RPC failed; result=22, HTTP code = 404
fatal: The remote end hung up unexpectedly
[error] Could not Git clone https://gitlab.com/space-sh/file.
[error] Could not clone module repository "https://gitlab.com/space-sh/file".
Works
[root@a82d147f8245 space]# ./space -m https://gitlab.com/space-sh/file.git / -h
[info] Git clone https://gitlab.com/space-sh/file.git into /root/.space/space_modules/gitlab.com/space-sh/file.git (commit: master)
Already on 'master'
/
+ append
+ chmod
+ chownr
[...]
Further failure cases
# git clone https://gitlab.com/space-sh/os
Cloning into 'os'...
error: RPC failed; result=22, HTTP code = 404
fatal: The remote end hung up unexpectedly
# echo $?
128
# export GIT_CURL_VERBOSE=1
[root@a82d147f8245 /]# git clone https://gitlab.com/space-sh/os [45/1896]
Cloning into 'os'...
* Couldn't find host gitlab.com in the .netrc file; using defaults
* About to connect() to gitlab.com port 443 (#0)
* Trying 104.210.2.228...
* Connected to gitlab.com (104.210.2.228) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate:
* subject: CN=gitlab.com,OU=PositiveSSL,OU=Domain Control Validated
* start date: Nov 07 00:00:00 2016 GMT
* expire date: Nov 30 23:59:59 2017 GMT
* common name: gitlab.com
* issuer: CN=COMODO RSA Domain Validation Secure Server CA,O=COMODO CA Limited,L=Salford,ST=Greater Manchester,C=GB
> GET /space-sh/os/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.8.3.1
Host: gitlab.com
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 301 Moved Permanently
< Server: nginx
< Date: Wed, 14 Dec 2016 00:26:04 GMT
< Content-Type: text/html
< Content-Length: 134
< Cache-Control: no-cache
< Location: https://gitlab.com/space-sh/os.git/info/refs?service=git-upload-pack
< X-Request-Id: d14f682e-b753-48d2-8df8-c9fa8517a5f4
< X-Runtime: 0.005466
<
* Ignoring the response-body
* Connection #0 to host gitlab.com left intact
* Issue another request to this URL: 'https://gitlab.com/space-sh/os.git/info/refs?service=git-upload-pack'
* Couldn't find host gitlab.com in the .netrc file; using defaults
* Found bundle for host gitlab.com: 0x14d9120 [8/1896]
* Re-using existing connection! (#0) with host gitlab.com
* Connected to gitlab.com (104.210.2.228) port 443 (#0)
> GET /space-sh/os.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.8.3.1
Host: gitlab.com
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 200 OK
< Server: nginx
< Date: Wed, 14 Dec 2016 00:26:04 GMT
< Content-Type: application/x-git-upload-pack-advertisement
< Content-Length: 310
< Cache-Control: no-cache
<
* Connection #0 to host gitlab.com left intact
* Couldn't find host gitlab.com in the .netrc file; using defaults
* About to connect() to gitlab.com port 443 (#1)
* Trying 104.210.2.228...
* Connected to gitlab.com (104.210.2.228) port 443 (#1)
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate:
* subject: CN=gitlab.com,OU=PositiveSSL,OU=Domain Control Validated
* start date: Nov 07 00:00:00 2016 GMT
* expire date: Nov 30 23:59:59 2017 GMT
* common name: gitlab.com
* issuer: CN=COMODO RSA Domain Validation Secure Server CA,O=COMODO CA Limited,L=Salford,ST=Greater Manchester,C=GB
> POST /space-sh/os/git-upload-pack HTTP/1.1
User-Agent: git/1.8.3.1
Host: gitlab.com
Accept-Encoding: gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Length: 192
* upload completely sent off: 192 out of 192 bytes
* The requested URL returned error: 404 Not Found
* Closing connection 1
error: RPC failed; result=22, HTTP code = 404
fatal: The remote end hung up unexpectedly