[123770] trunk/dports/lang/rust/Portfile

larryv at macports.org larryv at macports.org
Wed Aug 13 21:34:07 PDT 2014


Revision: 123770
          https://trac.macports.org/changeset/123770
Author:   larryv at macports.org
Date:     2014-08-13 21:34:07 -0700 (Wed, 13 Aug 2014)
Log Message:
-----------
rust: Improve cloning of source repository.

- Only fetch ancestors of remote HEAD, since we'll only be using commits
  in that history.
- Don't check out working tree on clone, since we do it again right after.
- Discard --git-dir and --work-dir, since we already call Git from the
  working directory using "system -W".

Modified Paths:
--------------
    trunk/dports/lang/rust/Portfile

Modified: trunk/dports/lang/rust/Portfile
===================================================================
--- trunk/dports/lang/rust/Portfile	2014-08-14 04:34:05 UTC (rev 123769)
+++ trunk/dports/lang/rust/Portfile	2014-08-14 04:34:07 UTC (rev 123770)
@@ -42,20 +42,20 @@
 depends_fetch-append    bin:git:git
 pre-fetch {
     # Clone repository.
-    set cmdstring "${git.cmd} clone -q ${git.url} \"${worksrcpath}\" 2>&1"
+    set opts "--quiet --no-checkout --single-branch"
+    set cmdstring "${git.cmd} clone ${opts} ${git.url} \"${worksrcpath}\" 2>&1"
     ui_debug "Executing ${cmdstring}"
     if {[catch {system ${cmdstring}} -]} {
         return -code error [msgcat::mc "Git clone failed"]
     }
-    set dirs "--git-dir=\"${worksrcpath}/.git\" --work-tree=\"${worksrcpath}\""
     # Check out branch.
-    set cmdstring "${git.cmd} ${dirs} checkout -q ${git.branch} 2>&1"
+    set cmdstring "${git.cmd} checkout --quiet ${git.branch} 2>&1"
     ui_debug "Executing $cmdstring"
     if {[catch {system -W ${worksrcpath} ${cmdstring}} -]} {
         return -code error [msgcat::mc "Git checkout failed"]
     }
     # Update submodules.
-    set cmdstring "${git.cmd} ${dirs} submodule update --init 2>&1"
+    set cmdstring "${git.cmd} submodule update --init 2>&1"
     ui_debug "Executing $cmdstring"
     if {[catch {system -W ${worksrcpath} ${cmdstring}} -]} {
         return -code error [msgcat::mc "Git submodule update failed"]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140813/f5b99229/attachment.html>


More information about the macports-changes mailing list