diff options
author | root <root@dev.spline.de> | 2008-10-17 17:28:30 +0200 |
---|---|---|
committer | root <root@dev.spline.de> | 2008-10-17 17:28:30 +0200 |
commit | 97c5d8ddaecdc9640d8eecb5f9f699c0264e195f (patch) | |
tree | 6c17e045eec6142905c31e90e1ba7dee5b66d2bc | |
parent | 1b83e598ff7b149994114447e54af9c99c17b964 (diff) | |
download | dev-scripts-97c5d8ddaecdc9640d8eecb5f9f699c0264e195f.tar.gz dev-scripts-97c5d8ddaecdc9640d8eecb5f9f699c0264e195f.tar.xz dev-scripts-97c5d8ddaecdc9640d8eecb5f9f699c0264e195f.zip |
add gforge migration
-rwxr-xr-x | bin/addproject | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/bin/addproject b/bin/addproject index 7f853d1..53640b6 100755 --- a/bin/addproject +++ b/bin/addproject @@ -23,6 +23,15 @@ main() { eask_str "a project description" project_desc=${REPLY} + # svn_name may not be an empty string and must be >= 3 characters + eask_str "a gforge svn repository name (LEAVE BLANK if this is a new project)" + gforge_name=${REPLY} + + if [[ -n ${gforge_name} && ! -d /mnt/gforge/var/lib/gforge/svn/${gforge_name} ]] + then + eerror "Repository ${gforge_name} does not exists." + fi + # who requests the project ? while [[ -z ${user_name} ]] do @@ -48,13 +57,23 @@ main() { trac_home=${TRAC_ROOT}/${project_name} trac_db=trac_${project_name} - eheading "creating new subversion directory" - eexec svnadmin create ${svn_home} - tmpdir=$(mktemp -d) - eexec mkdir -p ${tmpdir}/{trunk,tags,branches} - eexec svn -q import -m "initial import for project ${project_name}" ${tmpdir} file://${svn_home} - eexec chown -R apache:apache ${svn_home} - eexec rm -rf ${tmpdir} + if [[ -z ${gforge_name} ]] + then + eheading "creating new subversion directory" + eexec svnadmin create ${svn_home} + tmpdir=$(mktemp -d) + eexec mkdir -p ${tmpdir}/{trunk,tags,branches} + eexec svn -q import -m "initial import for project ${project_name}" ${tmpdir} file://${svn_home} + eexec chown -R apache:apache ${svn_home} + eexec rm -rf ${tmpdir} + else + eheading "using existing gforge repository" + eexec svnadmin create ${svn_home} + tmpfile=$(mktemp) + svnadmin dump /mnt/gforge/var/lib/gforge/svn/${gforge_name} > ${tmpfile} + svnadmin load ${svn_home} < ${tmpfile} + rm -f ${tmpfile} + fi eheading "creating new trac project" eexec mysqladmin create ${trac_db} |