Merge Installed Programs Into One Directory: Difference between revisions

From VrlWiki
Jump to navigation Jump to search
New page: On Linux systems you can create links to installed programs that are in a single directory. Some people find this convenient when accessing programs via the '''PATH''' variable. Note tha...
 
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
On Linux systems you can create links to installed programs that are in a single directory.  Some people find this convenient when accessing programs via the '''PATH''' variable.  Note that these utilities do not detect program name collisionsYou will have to resolve collisions manually.
On POSIX systems (Linux and OSX), it's convenient to have all of your installed programs in just a couple directories, so that they can be called from the command line via the <tt>PATH</tt> variable.  For example, most programs in Linux live in the directories <tt>/bin</tt> and <tt>/usr/bin</tt>In [[$G]], programs get installed into a Windows-style directory hierarchy (on Linux, it's <tt>$G/install_linux</tt>) that can be difficult to use from a POSIX command line.


The names of the programs follow the conventions for the build system. The links are simplified base names without suffixes so they are easy to enter from a command line. For details run:
The script <code>$G/common/build/kit/linkbins.py</code> exists to map the $G install directory onto a flat directory of your choice, so that you can easily call programs in $G when working from the command line.


> $G/common/build/kit/linkbins.py
<pre>$G/common/build/kit/linkbins.py [<Source>]  <Dest></pre>
* '''<tt>Source</tt>''' is the path of a directory that is the root of a directory hierarchy full of programs.  When omitted it defaults to: <tt>$G/install_$GARCH/bin</tt>.
* '''<tt>Dest</tt>''' is the path of a directory to be populated with softlinks to the programs found in <tt>Source</tt>.




* Create or update links to programs in on directory.
The script assumes that the names of programs in <tt>Source</tt> follow the conventions for the build systems.  The softlinks are simplified basenames without suffixes so they are easy to enter from the command line.  For example, <tt>mridfit-gccx</tt> becomes the destination for a link called <tt>mridfit</tt>.  Note that this script does not detect program name collisions---that is, if two programs in different projects have the same name, only one of them will be represented in the "flat" directory this script creates.


> $G/common/build/kit/linkbins.py <Source/>  <Link/>
For further details, run the following with no arguments:
<pre>$G/common/build/kit/linkbins.py</pre>


The '''Source/''' directory contains a collection of programs.
[[Category:Software Development]]
 
The '''Link/''' directory will be populated with links to the programs.
 
 
* Create or update links to programs in an install directory tree.
 
> $G/common/build/kit/linkinstall.py  <Link/>
 
The '''Link/''' directory will be populated with links to the programs in: '''$G/install_linux/bin/*/*'''
 
Note that $G must be set before running this script.

Latest revision as of 13:10, 2 March 2011

On POSIX systems (Linux and OSX), it's convenient to have all of your installed programs in just a couple directories, so that they can be called from the command line via the PATH variable. For example, most programs in Linux live in the directories /bin and /usr/bin. In $G, programs get installed into a Windows-style directory hierarchy (on Linux, it's $G/install_linux) that can be difficult to use from a POSIX command line.

The script $G/common/build/kit/linkbins.py exists to map the $G install directory onto a flat directory of your choice, so that you can easily call programs in $G when working from the command line.

$G/common/build/kit/linkbins.py  [<Source>]  <Dest>
  • Source is the path of a directory that is the root of a directory hierarchy full of programs. When omitted it defaults to: $G/install_$GARCH/bin.
  • Dest is the path of a directory to be populated with softlinks to the programs found in Source.


The script assumes that the names of programs in Source follow the conventions for the build systems. The softlinks are simplified basenames without suffixes so they are easy to enter from the command line. For example, mridfit-gccx becomes the destination for a link called mridfit. Note that this script does not detect program name collisions---that is, if two programs in different projects have the same name, only one of them will be represented in the "flat" directory this script creates.

For further details, run the following with no arguments:

$G/common/build/kit/linkbins.py