diff options
author | Daniel Friesel <derf@finalrewind.org> | 2010-10-14 21:40:11 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2010-10-14 21:40:11 +0200 |
commit | 84e2e6aef4ef92e5e416e4f762993ccb606bfa30 (patch) | |
tree | 82eff13077227043e00379d36a71067cc372287c /bin/ct | |
parent | 1a207496065a9f4635074c1cc84efc62ab31f114 (diff) |
Begin work on "ct new"
Diffstat (limited to 'bin/ct')
-rwxr-xr-x | bin/ct | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -266,6 +266,17 @@ function vcs_log ( git log ) +function vcs_new ( + mkdir ${PKG_DIR}/${1} + cd ${PKG_DIR}/${1} || die "Cannot cd to new package ${1}" + git init + mkdir etc + + if ((GIT_USE_ORIGIN)) { + git remote add origin ${PKG_PROTO}://${PKG_UAH}/${PKG_PATH}/${1} + } +) + function vcs_pull ( vcs_setup ${1} if (( GIT_USE_ORIGIN )) { @@ -868,6 +879,24 @@ function pkg_log { vcs_log ${1} } +function pkg_new { + + if list_exists ${1}; then + die "We already have a package with this name: ${1}" + fi + + pkgroot_setup ${PKG_ROOTS[1]} + + info "Creating local package...\n" + vcs_new ${1} + + if [[ ${PKG_PROTO} == ssh ]] { + info "Creating remote packages...\n" + ssh ${PKG_UAH} "GIT_DIR=${PKG_PATH}/${1} git --bare init" + say "Note that you will have to push manually the first time\n" + } +} + function pkg_push { check_installed ${1} @@ -979,6 +1008,7 @@ case ${action} in i|info) pkg_info ${*} ;; ls|list) pkg_list ${*} ;; l|log) pkg_log ${*} ;; + n|new) pkg_new ${*} ;; version) pkg_version ;; f|pull) |