Permalink
Browse files

merge

  • Loading branch information...
2 parents 1a926e8 + 2a07251 commit cdb5209ab46e7c39191c39c5b35c72dd02f97ce9 @wayneeseguin wayneeseguin committed Jun 22, 2013
@@ -67,8 +67,8 @@ fetch_uri()
# DEBUG vcs: Copying from '/root' to '/home/mpapis/tmp/test_uris' failed.
# DEBUG vcs: Unknown SCM type (not found) for url '/root/test'.
# DEBUG vcs: type: github, params: mpapis/mpapis_test /home/mpapis/tmp/test_uris.
-# DEBUG vcs: github -> https://github.com/mpapis/mpapis_test/tarball/master
-# DEBUG vcs: github tarball archive name /home/mpapis/.sm/archives/mpapis_mpapis_test_master.tar.gz.
+# DEBUG vcs: github -> https://github.com/mpapis/mpapis_test/archive/master.tar.gz
+# DEBUG vcs: github tar.gz archive name /home/mpapis/.sm/archives/mpapis_mpapis_test_master.tar.gz.
# DEBUG vcs: master does not match checksum #; removing and downloading.
#
fetch_uris()
@@ -19,17 +19,17 @@ archive_get()
case "${_uri}" in
# fix github archive names
- (*github.com/*/tarball/*)
+ (*github.com/*/archive/*.tar.gz)
_archive="${_uri#*github.com/}"
- _archive="${_archive%/tarball*}"
- _archive="${archives_path}/${_archive//\//_}_${_uri##*/}.tar.gz"
- __sm.log.debug vcs "github tarball archive name ${_archive}."
+ _archive="${_archive%/archive*}"
+ _archive="${archives_path}/${_archive//\//_}_${_uri##*/}"
+ __sm.log.debug vcs "github tar.gz archive name ${_archive}."
;;
- (*github.com/*/zipball/*)
+ (*github.com/*/archive/*.zip)
_archive="${_uri#*github.com/}"
- _archive="${_archive%/zipball*}"
+ _archive="${_archive%/archive*}"
_archive="${archives_path}/${_archive//\//_}_${_uri##*/}.zip"
- __sm.log.debug vcs "github zipball archive name ${_archive}."
+ __sm.log.debug vcs "github zip archive name ${_archive}."
;;
esac
@@ -77,44 +77,44 @@ Please read 'sm man curl' for instructions how to solve this problem.\n"
builtin cd "${_final_target}"
case "${_uri}" in
- (*.tar) # tar
- tar -xf "${_archive}" 2>&1 | __sm.log.debug vcs -
+ (*github.com/*/archive/*.tar.gz)
+ LANG=C tar -zxf "${_archive}" 2>&1 | __sm.log.debug vcs -
(( ${pipestatus[1]} == 0 )) || fetch_error extracting_archive_failed
+ typeset name_pattern="${_uri#*github.com/*/}"
+ name_pattern="${name_pattern%archive/*}"
+ name_pattern="${name_pattern//\//-}"
+ mv ${name_pattern}*/* .
+ rm -rf ${name_pattern}*
;;
- (*.tar.gz|*.tgz) # gzip
- tar -zxf "${_archive}" 2>&1 | __sm.log.debug vcs -
+ (*.tar) # tar
+ LANG=C tar -xf "${_archive}" 2>&1 | __sm.log.debug vcs -
(( ${pipestatus[1]} == 0 )) || fetch_error extracting_archive_failed
;;
- (*github.com/*/tarball/*)
- tar -zxf "${_archive}" 2>&1 | __sm.log.debug vcs -
+ (*.tar.gz|*.tgz) # gzip
+ LANG=C tar -zxf "${_archive}" 2>&1 | __sm.log.debug vcs -
(( ${pipestatus[1]} == 0 )) || fetch_error extracting_archive_failed
- typeset name_pattern="${_uri#https://github.com/}"
- name_pattern="${name_pattern%tarball/*}"
- name_pattern="${name_pattern//\//-}"
- mv ${name_pattern}*/* .
- rm -rf ${name_pattern}*
;;
(*.tar.bz2|*.tbz2) # bzip
- tar -jxf "${_archive}" 2>&1 | __sm.log.debug vcs -
+ LANG=C tar -jxf "${_archive}" 2>&1 | __sm.log.debug vcs -
(( ${pipestatus[1]} == 0 )) || fetch_error extracting_archive_failed
;;
(*.tar.xz) # LZMA
xz -dc "${_archive}" | tar -xC "${_final_target}" 2>&1 | __sm.log.debug vcs -
(( ${pipestatus[1]} == 0 )) || fetch_error extracting_archive_failed
;;
- (*.zip)
- unzip -q "${_archive}" 2>&1 | __sm.log.debug vcs -
- (( ${pipestatus[1]} == 0 )) || fetch_error extracting_archive_failed
- ;;
- (*github.com/*/zipball/*)
+ (*github.com/*/archive/*.zip)
unzip -q "${_archive}" 2>&1 | __sm.log.debug vcs -
(( ${pipestatus[1]} == 0 )) || fetch_error extracting_archive_failed
- typeset name_pattern="${_uri#https://github.com/}"
- name_pattern="${name_pattern%zipball/*}"
+ typeset name_pattern="${_uri#*github.com/*/}"
+ name_pattern="${name_pattern%archive/*}"
name_pattern="${name_pattern//\//-}"
mv ${name_pattern}*/* .
rm -rf ${name_pattern}*
;;
+ (*.zip)
+ unzip -q "${_archive}" 2>&1 | __sm.log.debug vcs -
+ (( ${pipestatus[1]} == 0 )) || fetch_error extracting_archive_failed
+ ;;
(*)
#TODO: add detection based on $( file ${_archive} ) type
fetch_error unknown_archive_format
@@ -29,12 +29,12 @@ github_get()
do
case "${_method}" in
(tgz)
- __sm.log.debug vcs "github -> https://github.com/${_uri}/tarball/${branch}"
- archive_get "https://github.com/${_uri}/tarball/${branch}" "${_target}" "$@"
+ __sm.log.debug vcs "github -> https://github.com/${_uri}/archive/${branch}.tar.gz"
+ archive_get "https://github.com/${_uri}/archive/${branch}.tar.gz" "${_target}" "$@"
;;
(zip)
- __sm.log.debug vcs "github -> https://github.com/${_uri}/zipball/${branch}"
- archive_get "https://github.com/${_uri}/zipball/${branch}" "${_target}" "$@"
+ __sm.log.debug vcs "github -> https://github.com/${_uri}/archive/${branch}.zip"
+ archive_get "https://github.com/${_uri}/archive/${branch}.zip" "${_target}" "$@"
;;
(git)
__sm.log.debug vcs "github -> git://github.com/${_uri}.git"

0 comments on commit cdb5209

Please sign in to comment.