Opened 10 years ago

Last modified 8 years ago

#47442 new enhancement

port: new action_environment and/or environment mode

Reported by: pixilla (Bradley Giesbrecht) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 2.3.3
Keywords: Cc: larryv (Lawrence Velázquez), RJVB (René Bertin)
Port:

Description

I've wanted something like this for some time. This may not be worth the action/mode bloat so I present it here to gauge popularity.

port -e version
port env
port -q env

Attachments (1)

patch-base-environment-action-mode.diff (5.3 KB) - added by pixilla (Bradley Giesbrecht) 10 years ago.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by pixilla (Bradley Giesbrecht)

comment:1 Changed 10 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added

Cc Me!

comment:2 Changed 10 years ago by RJVB (René Bertin)

Interesting, but is "env" (environment) the best choice of terms here? I would expect port env to print out the environment variables as they are set for and seen by commands launched through the port command, optionally for the given port(s). One could add something like the following to macports::environment:

    set shenv {}
    foreach keyval [exec /usr/bin/printenv] {
        lappend shenv $keyval
    }
    if {![macports::ui_isset ports_quiet]} {
        lappend mpenv "$macports::ui_prefix shell environment: [join $shenv { }]"
    } else {
        lappend mpenv "shell environment [join $shenv { }]"
    }

(and of course let the command accept port names so that variables set by the Portfile(s) show up in printenv).

comment:3 Changed 10 years ago by RJVB (René Bertin)

Cc: rjvbertin@… added

Cc Me!

comment:4 Changed 8 years ago by jmroot (Joshua Root)

Dupe of #33629?

comment:5 in reply to:  4 Changed 8 years ago by RJVB (René Bertin)

Replying to jmroot:

Dupe of #33629?

In spirit; judging from the patchfiles Bradley's proposal is a less elaborate implementation. It's not impossible though that he provided me with the patch attached here.

> port -e
--->  /opt/local/etc/macports/macports.conf: sandbox_enable: no
--->  /opt/local/etc/macports/macports.conf: place_worksymlink: no
--->  /opt/local/etc/macports/macports.conf: prefix: /opt/local
--->  /opt/local/etc/macports/macports.conf: macportsuser: bertin
--->  /opt/local/etc/macports/macports.conf: portdbpath: /opt/local/var/macports
--->  /opt/local/etc/macports/macports.conf: binpath: /opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
--->  /opt/local/etc/macports/macports.conf: applications_dir: /Applications/MacPorts
--->  /opt/local/etc/macports/macports.conf: frameworks_dir: /opt/local/Library/Frameworks
--->  /opt/local/etc/macports/macports.conf: sources_conf: /opt/local/etc/macports/sources.conf
--->  /opt/local/etc/macports/macports.conf: variants_conf: /opt/local/etc/macports/variants.conf
--->  /opt/local/etc/macports/macports.conf: portarchivetype: txz
--->  /opt/local/etc/macports/macports.conf: universal_archs: i386 x86_64
--->  /opt/local/etc/macports/macports.conf: configurepipe: no
--->  /opt/local/etc/macports/macports.conf: buildmakejobs: 4
--->  /opt/local/etc/macports/macports.conf: portautoclean: yes
--->  /opt/local/etc/macports/macports.conf: keeplogs: no
--->  /opt/local/etc/macports/macports.conf: extra_env: MACPORTS_COMPRESS_WORKDIR
--->  /opt/local/etc/macports/macports.conf: revupgrade_mode: report
--->  /opt/local/etc/macports/macports.conf: packagemaker_path: /Developer/Applications/Utilities/PackageMaker.app
--->  /opt/local/etc/macports/sources.conf: file:///Users/bertin/cworks/MacOSX/MacPorts/ports nosync
--->  /opt/local/etc/macports/sources.conf: file:///opt/local/site-ports nosync
--->  /opt/local/etc/macports/sources.conf: file:///opt/local/site-ports/Soup nosync
--->  /opt/local/etc/macports/sources.conf: rsync://rsync.macports.org/release/ports/ default
--->  /opt/local/etc/macports/sources.conf: file:///opt/local/var/macports/sources/svn.macports.org/trunk/dports
--->  /opt/local/etc/macports/sources.conf: file:///opt/local/var/macports/sources/git.macports.org/dports/
MacPorts 2.3.99
> port environment
--->  port_cmd_version:  2.3.99
--->  bootstrap_options: applications_dir: /Applications/MacPorts
--->  bootstrap_options: binpath: /opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
--->  bootstrap_options: build_arch: x86_64
--->  bootstrap_options: buildmakejobs: 4
--->  bootstrap_options: buildnicevalue: 0
--->  bootstrap_options: ccache_dir: /opt/local/var/macports/build/.ccache
--->  bootstrap_options: ccache_size: 2G
--->  bootstrap_options: configureccache: no
--->  bootstrap_options: configuredistcc: no
--->  bootstrap_options: configurepipe: no
--->  bootstrap_options: cxx_stdlib: libc++
--->  bootstrap_options: delete_la_files: yes
--->  bootstrap_options: destroot_umask: 022
--->  bootstrap_options: developer_dir: /Applications/Xcode.app/Contents/Developer
--->  bootstrap_options: extra_env: MACPORTS_COMPRESS_WORKDIR
--->  bootstrap_options: frameworks_dir: /opt/local/Library/Frameworks
--->  bootstrap_options: keeplogs: no
--->  bootstrap_options: macosx_deployment_target: 10.9
--->  bootstrap_options: macosx_sdk_version: 10.9
--->  bootstrap_options: macportsuser: bertin
--->  bootstrap_options: packagemaker_path: /Developer/Applications/UtilitiesPackageMaker.app
--->  bootstrap_options: place_worksymlink: no
--->  bootstrap_options: portarchivetype: txz
--->  bootstrap_options: portautoclean: yes
--->  bootstrap_options: portdbpath: /opt/local/var/macports
--->  bootstrap_options: porttrace: no
--->  bootstrap_options: portverbose: no
--->  bootstrap_options: prefix: /opt/local
--->  bootstrap_options: revupgrade_autorun: yes
--->  bootstrap_options: revupgrade_mode: report
--->  bootstrap_options: rsync_dir: macports/release/tarballs/base.tar
--->  bootstrap_options: rsync_options: -rtzv --delete-after
--->  bootstrap_options: rsync_server: rsync.macports.org
--->  bootstrap_options: sandbox_enable: no
--->  bootstrap_options: sources_conf: /opt/local/etc/macports/sources.conf
--->  bootstrap_options: startupitem_install: yes
--->  bootstrap_options: startupitem_type: default
--->  bootstrap_options: universal_archs: i386 x86_64
--->  bootstrap_options: variants_conf: /opt/local/etc/macports/variants.conf
--->  bootstrap_options: xcodebuildcmd: /usr/bin/xcodebuild
--->  bootstrap_options: xcodeversion: 6.2
--->  port_tree_sources: file:///Users/bertin/cworks/MacOSX/MacPorts/ports nosync
--->  port_tree_sources: file:///opt/local/site-ports nosync
--->  port_tree_sources: file:///opt/local/site-ports/Soup nosync
--->  port_tree_sources: rsync://rsync.macports.org/release/ports/ default
--->  port_tree_sources: file:///opt/local/var/macports/sources/svn.macports.org/trunk/dports
--->  port_tree_sources: file:///opt/local/var/macports/sources/git.macports.org/dports/
--->  global_variations: +langselect
--->  shell environment: TMPDIR=/var/folders/j1/1439ppj08xj8h6006s6drbq00000gs/T/ HOME=/opt/local/var/macports/home USER=bertin PATH=/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin GROUP=bertin MACPORTS_COMPRESS_WORKDIR=1 LINES=48 COLUMNS=132 LANG=en_US.UTF-8 http_proxy=127.0.0.1:8001 HTTPS_PROXY=127.0.0.1:8001 NO_PROXY=localhost,192.1.1.1,*facebook.com,*.icloud.com CCACHE_DIR=/opt/local/var/macports/build/.ccache
Note: See TracTickets for help on using tickets.