Hi,

This patch adds support for CVS/SVN on FetchArchive. It has been
tested under ChrootCompile and on a standard setup with the plain
Compile tool. However, since it deals a bit with the core of Compile I
though it should be better to post it here before commiting. The patch
for ChrootCompile also finds attached.

Comments?

--
Lucas
powered by /dev/dsp
Index: bin/Compile
===================================================================
RCS file: /sources/goboscripts/tools/Compile/bin/Compile,v
retrieving revision 1.164
diff -u -u -r1.164 Compile
--- bin/Compile	19 Dec 2006 18:44:02 -0000	1.164
+++ bin/Compile	5 Jan 2007 05:08:23 -0000
@@ -736,33 +736,16 @@
 ##################################################
 # Get & Unpack sources
 ##################################################
+savedir="--save-to $compileSourcesDir"
 if [ "$cvs" ]
 then
-   if ! Boolean "no-web"
-   then
-      cd "$compileSourcesDir"
-      [ "$cvs_password" = "" ] && extra_info="( Just press enter )"
-      echo "CVS PASSWORD is \"$cvs_password\"${extra_info}"
-
-      login_method=`echo ${cvs} | cut -b-5`
-      [ "$cvs_rsh" ] && export CVS_RSH=$cvs_rsh || export CVS_RSH=ssh
-      [ "$login_method" != ":ext:" ] && cvs -d${cvs} login
-      cvs -d${cvs} ${cvs_opts} ${cvs_options} co ${cvs_checkout_options} ${cvs_module}
-   else
-      # Sources are already fetched, do not patch again
-      if [ -d "$compileSourcesDir/$cvs_module" ]
-      then skippatching=yes
-      fi
-   fi
+   # If sources were already fetched, do not patch again
+   [ -d "$compileSourcesDir/$cvs_module" ] && skippatching=yes
+   ! Boolean "no-web" && in_host FetchArchive $verbose $batch $savedir "$recipe"
 elif [ "$svn" ]
 then
-   if ! Boolean "no-web"
-   then
-      cd "$compileSourcesDir"
-      echo "Fetching ${appname} from $svn"
-      svn co $svn "${dir}"
-      echo "Well done!"
-   fi
+   [ "$dir" -a -d "$compileSourcesDir/$dir" ] && skippatching=yes
+   ! Boolean "no-web" && in_host FetchArchive $verbose $batch $savedir "$recipe"
 else
    Boolean "no-web" || in_host FetchArchive $verbose $batch "$recipe" || Die "Error fetching archive(s)."
 
Index: bin/FetchArchive
===================================================================
RCS file: /sources/goboscripts/tools/Compile/bin/FetchArchive,v
retrieving revision 1.18
diff -u -u -r1.18 FetchArchive
--- bin/FetchArchive	19 Dec 2006 20:46:20 -0000	1.18
+++ bin/FetchArchive	5 Jan 2007 05:08:23 -0000
@@ -60,8 +60,25 @@
 # Get sources
 ##################################################
 
-if ! [ -n "$url${urls[*]}" ]
-then Die "Missing URL in recipe '$recipe'."
+if [ "$cvs" ]
+then
+   cd "$savedir"
+   [ "$cvs_password" = "" ] && extra_info="( Just press enter )"
+   echo "CVS PASSWORD is \"$cvs_password\"${extra_info}"
+
+   login_method=`echo ${cvs} | cut -b-5`
+   [ "$cvs_rsh" ] && export CVS_RSH=$cvs_rsh || export CVS_RSH=ssh
+   [ "$login_method" != ":ext:" ] && cvs -d${cvs} login
+   cvs -d${cvs} ${cvs_opts} ${cvs_options} co ${cvs_checkout_options} ${cvs_module}
+   exit $?
+elif [ "$svn" ]
+then
+   cd "$savedir"
+   svn co $svn "${dir}"
+   exit $?
+elif ! [ -n "$url${urls[*]}" ]
+then
+   Die "Missing URL in recipe '$recipe'."
 fi
 
 for var in url mirror_url file file_size file_md5
Index: ChrootCompile
===================================================================
RCS file: /sources/goboscripts/tools/ChrootCompile/bin/ChrootCompile,v
retrieving revision 1.29
diff -u -u -r1.29 ChrootCompile
--- ChrootCompile	20 Dec 2006 14:27:11 -0000	1.29
+++ ChrootCompile	5 Jan 2007 05:08:31 -0000
@@ -596,11 +596,22 @@
 
 function fetch_archive_off_recipe() {
    (
+      rawversion=`echo $version | sed -e 's,^cvs-r.*,cvs,1' -e 's,^svn-r.*,svn,1'`
+      if [ "$rawversion" = "cvs" -o "$rawversion" = "svn" ]
+      then
+         if Is_Entry "cross-compile" 
+         then savedir="$root/Files/Compile/Sources-$arch_conf"
+         else savedir="$root/Files/Compile/Sources"
+         fi
+         [ "$localrepository" ] && savedir=`echo $savedir | sed "s,^$root,,g"`
+      else
+         savedir="$root/Files/Compile/Archives"
+      fi
       if recipe_has_url "$1/Recipe"
-      then FetchArchive --save-to "$root/Files/Compile/Archives" "$1/Recipe"
+      then FetchArchive --save-to "$savedir" "$1/Recipe"
       fi
       if [ -f "$1/$recipesubdir/Recipe" ] && recipe_has_url "$1/$recipesubdir/Recipe"
-      then FetchArchive --save-to "$root/Files/Compile/Archives" "$1/$recipesubdir/Recipe"
+      then FetchArchive --save-to "$savedir" "$1/$recipesubdir/Recipe"
       fi
       unset is_meta
       unset include
_______________________________________________
gobolinux-devel mailing list
gobolinux-devel@lists.gobolinux.org
http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel

Reply via email to