summaryrefslogtreecommitdiff
path: root/bin/ct
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2010-10-14 21:40:11 +0200
committerDaniel Friesel <derf@finalrewind.org>2010-10-14 21:40:11 +0200
commit84e2e6aef4ef92e5e416e4f762993ccb606bfa30 (patch)
tree82eff13077227043e00379d36a71067cc372287c /bin/ct
parent1a207496065a9f4635074c1cc84efc62ab31f114 (diff)
Begin work on "ct new"
Diffstat (limited to 'bin/ct')
-rwxr-xr-xbin/ct30
1 files changed, 30 insertions, 0 deletions
diff --git a/bin/ct b/bin/ct
index 403c353..c5d102c 100755
--- a/bin/ct
+++ b/bin/ct
@@ -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)