Author: saq Date: Thu Sep 29 21:57:32 2005 New Revision: 6409 Added: cvs2svn-migration/trunk/post_cvs2svn (contents, props changed) Modified: cvs2svn-migration/trunk/README Log: - post_cvs2svn to reorganize directories
Modified: cvs2svn-migration/trunk/README ============================================================================== --- cvs2svn-migration/trunk/README (original) +++ cvs2svn-migration/trunk/README Thu Sep 29 21:57:32 2005 @@ -5,9 +5,10 @@ 1. Disable write access to the CVS repo 2. Use migrator to reorganize the repo according to the dir-per-package scheme 3. Perform some manual clean-ups. -4. Use cvs2svn to generate svn entries and revisions. -5. Perform some manual clean-ups. -6. Celebrate. +4. Use invoke_cvs2svn to generate svn entries and revisions. +5. Use post_cvs2svn to reorganize the repo into $package/{trunk,tags,branches}. +6. Perform some manual clean-ups. +7. Celebrate. After step 3 you can try working with CVS on the new structure (read-only), you will have to `mkdir CVSROOT` for that. @@ -35,6 +36,8 @@ go to a common directory (that is, no file gets omitted, except for files that weren't valid CVS-controlled files in the first place). +Distfiles stay where they are. + === migrator open issues: @@ -49,24 +52,9 @@ Other open issues: - How to write %changelog under svn? What to do with the existing entries? -- What tasks are necessary in steps 3 and 5 above? +- What tasks are necessary in steps 3 and 6 above? - What needs to be done to adapt src builder? - What about the filter_tags.sh rules? -- What directory structure for tags and branches? cvs2svn gives: -trunk/MathReader/MathReader.spec -tags/auto-ac-MathPlanner-3_1_3-1/MathPlanner/MathPlanner.spec -branches/RA-branch/MathPlanner/MathPlanner.spec - -comment #1: -- For clarity we should keep the $package/{$package.spec,tags,branches} - instead of {trunk,tags,branches}/$package. - -comment #2: -- I'd suggest $package/{trunk,tags,branches} - -comment #4: -- I'm all for $package/{trunk,tags,branches}. Large and binary sources - should stay with distfiles for easy and relatively small checkouts. === Added: cvs2svn-migration/trunk/post_cvs2svn ============================================================================== --- (empty file) +++ cvs2svn-migration/trunk/post_cvs2svn Thu Sep 29 21:57:32 2005 @@ -0,0 +1,50 @@ +#!/bin/sh + +. ./config + +rm -rf checkout +svn -q co file://"$svndir" checkout +cd checkout + +echo "1. Moving */foo to foo/*" +for pkgdir in {trunk,tags/*,branches/*}/*; do + pkg=$(echo $pkgdir|sed s,.*/,,) + if [ -d $pkg ]; then + continue + fi + svn -q mkdir $pkg + if [ -d trunk/$pkg ]; then + svn -q mv trunk/$pkg $pkg/trunk + fi + tagdirs="$(echo tags/*/$pkg)" + if [ "$tagdirs" != "tags/*/$pkg" ]; then + svn -q mkdir $pkg/tags + for dir in tags/*/$pkg; do + name=$(echo $dir|cut -d/ -f2) + svn -q mv $dir $pkg/tags/$name + done + fi + branchdirs="$(echo branches/*/$pkg)" + if [ "$branchdirs" != "branches/*/$pkg" ]; then + svn -q mkdir $pkg/branches + for dir in branches/*/$pkg; do + name=$(echo $dir|cut -d/ -f2) + svn -q mv $dir $pkg/branches/$name + done + fi +done +svn ci -m'- [post_cvs2svn] applying package/{trunk,tags,branches} policy' +svn -q up + +echo "2. Removing empty leftover dirs" +# assert nothing is left over, except .svn +if [ "$(echo trunk/* tags/*/* branches/*/*)" != "trunk/* tags/*/* branches/*/*" ]; then + echo "ERROR: something is left, it shouldn't happen" + exit 1 +fi +# damn lucky there are no packages by these names +svn rm -q trunk tags branches +svn ci -m'- [post_cvs2svn] removing leftover directories' + +cd .. +rm -rf checkout _______________________________________________ pld-cvs-commit mailing list pld-cvs-commit@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit