Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#32782 closed enhancement (fixed)

Feature: add source only option to macports.conf

Reported by: bm55b@… Owned by: macports-tickets@…
Priority: Low Milestone: MacPorts 2.1.0
Component: base Version: 2.0.3
Keywords: Cc: mackyle@…
Port:

Description

Version 2.x of macports will try to install binary packages from http://packages.macports.com. You can turn this off with the "-s" command line switch. The "portarchivemode" switch in macports.conf does not have any effect on the binary install behavior. Would like a macports.conf setting to turn off installs from http://packages.macports.com

Attachments (1)

patch-buildfromsource-r81540.diff (1.7 KB) - added by mackyle@… 12 years ago.
Patch against r81540 described in comment:5

Download all attachments as: .zip

Change History (7)

comment:1 Changed 12 years ago by jmroot (Joshua Root)

Component: portsbase
Milestone: MacPorts Future
Resolution: fixed
Status: newclosed

Already done in trunk, r81540.

comment:2 Changed 12 years ago by bm55b@…

macports.conf options is 'buildfromsource' with possible values 'never', 'always' or 'ifneeded'

comment:3 Changed 12 years ago by mackyle@…

I attempted to use this in MacPorts-2.0.3 by applying the r81540 diff to macports.tcl. The patch applies cleanly (no fuzz or offset).

However, the result does not work. The buildfromsource option in macports.conf is ignored.

But after making these changes to the r81540 diff to macports.tcl, it does work with MacPorts-2.0.3:

  1. Add buildfromsource to the bootstrap_options variable at the top of the file
  2. Where the patch has set macports::global_options (2 places) change it to set global_options instead

Looking at the trunk version of the entire macports.tcl file, I don't see how this can work on trunk either without buildfromsource in bootstrap_options.

Here is the patch against r81540 to make the changes mentioned above:

--- macports.tcl	2012-02-01 23:56:01.000000000 +0000
+++ macports.tcl.new	2012-02-02 00:49:17.000000000 +0000
@@ -42,7 +42,7 @@
     namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities port_phases 
     variable bootstrap_options "\
         portdbpath libpath binpath auto_path extra_env sources_conf prefix portdbformat \
-        portarchivetype portautoclean \
+        portarchivetype portautoclean buildfromsource \
         porttrace portverbose keeplogs destroot_umask variants_conf rsync_server rsync_options \
         rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
         mp_remote_url mp_remote_submit_url configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
@@ -691,9 +691,9 @@
         && ![info exists macports::global_options(ports_source_only)]
         && [info exists macports::buildfromsource]} {
         if {${macports::buildfromsource} == "never"} {
-            set macports::global_options(ports_binary_only) yes
+            set global_options(ports_binary_only) yes
         } elseif {${macports::buildfromsource} == "always"} {
-            set macports::global_options(ports_source_only) yes
+            set global_options(ports_source_only) yes
         } elseif {${macports::buildfromsource} != "ifneeded"} {
             ui_warn "'buildfromsource' set to unknown value '${macports::buildfromsource}', using 'ifneeded' instead"
         }

comment:4 Changed 12 years ago by mackyle@…

Cc: mackyle@… added

Cc Me!

comment:5 Changed 12 years ago by mackyle@…

Whoops, accidentally left out one of the changes:

  1. Add global_options to the global line

Revised patch against r81540 macports.tcl is

--- macports.tcl	2012-02-01 23:56:01.000000000 +0000
+++ macports.tcl.new	2012-02-02 02:10:14.000000000 +0000
@@ -42,7 +42,7 @@
     namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities port_phases 
     variable bootstrap_options "\
         portdbpath libpath binpath auto_path extra_env sources_conf prefix portdbformat \
-        portarchivetype portautoclean \
+        portarchivetype portautoclean buildfromsource \
         porttrace portverbose keeplogs destroot_umask variants_conf rsync_server rsync_options \
         rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
         mp_remote_url mp_remote_submit_url configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
@@ -438,7 +438,7 @@
         macports::ui_init $priority
     }
 
-    global auto_path env tcl_platform
+    global auto_path env tcl_platform global_options
     global macports::autoconf::macports_conf_path
     global macports::macports_user_dir
     global macports::bootstrap_options
@@ -691,9 +691,9 @@
         && ![info exists macports::global_options(ports_source_only)]
         && [info exists macports::buildfromsource]} {
         if {${macports::buildfromsource} == "never"} {
-            set macports::global_options(ports_binary_only) yes
+            set global_options(ports_binary_only) yes
         } elseif {${macports::buildfromsource} == "always"} {
-            set macports::global_options(ports_source_only) yes
+            set global_options(ports_source_only) yes
         } elseif {${macports::buildfromsource} != "ifneeded"} {
             ui_warn "'buildfromsource' set to unknown value '${macports::buildfromsource}', using 'ifneeded' instead"
         }

Changed 12 years ago by mackyle@…

Patch against r81540 described in comment:5

comment:6 Changed 12 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 2.1.0
Note: See TracTickets for help on using tickets.