Magellan Linux

Diff of /trunk/mage/usr/lib/mage/env-rebuild.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 456 by niro, Sun Apr 1 01:26:34 2007 UTC revision 1565 by niro, Wed Dec 28 10:11:19 2011 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/bash
2    # $Id$
 # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/env-rebuild.sh,v 1.12 2007-04-01 01:26:34 niro Exp $  
3  #  #
4  # rebuilds /etc/{ld.so.conf,profile.env} with given files from /etc/env.d  # rebuilds /etc/{ld.so.conf,profile.env} with given files from /etc/env.d
5  #  #
# Line 16  Line 15 
15    
16  # sets root path  # sets root path
17  P="${MROOT}"  P="${MROOT}"
18  SPECIALVARS="KDEDIRS PATH CLASSPATH LDPATH MANPATH INFODIR INFOPATH ROOTPATH CONFIG_PROTECT CONFIG_PROTECT_MASK PRELINK_PATH PRELINK_PATH_MASK OMF_DIR"  SPECIALVARS="KDEDIRS PATH CLASSPATH LDPATH MANPATH INFODIR INFOPATH ROOTPATH CONFIG_PROTECT CONFIG_PROTECT_MASK CONFIG_PROTECT_IGNORE PRELINK_PATH PRELINK_PATH_MASK OMF_DIR LIBGL_DRIVERS_PATH XDG_CONFIG_DIRS XDG_DATA_DIRS"
 #SPECIALVARS="KDEDIRS PATH LDPATH MANPATH INFODIR INFOPATH ROOTPATH CLASSPATH"  
19    
20  # secure tmp dir  # secure tmp dir
21  if [ -x /bin/mktemp ]  if [ -x /bin/mktemp ]
# Line 43  do Line 41  do
41   # reads content of every file   # reads content of every file
42   while read path   while read path
43   do   do
44   # abort if empty or an comment   # ignore if empty or a comment
45   case "${path}" in   case "${path}" in
46   \#*|"") continue ;;   \#*|"") continue ;;
47   esac   esac
# Line 64  do Line 62  do
62    
63   if [[ ${SPECVAR} = yes ]]   if [[ ${SPECVAR} = yes ]]
64   then   then
65   if [[ ${path%%=*} = CONFIG_PROTECT ]] || [[ ${path%%=*} = CONFIG_PROTECT_MASK ]]   case ${path%%=*} in
66   then   CONFIG_PROTECT*|XDG*)
67   # CONFIG_PROTECTS has as delimiter  not ':'  but ' '   # CONFIG_PROTECT*|XDG* have as delimiter  not ':'  but ' '
68   path="${path//\"}" #}" <--- make code readable again :)   path="${path//\"}" #}" <--- make code readable again :)
69   echo -n "${path##*=} " >> ${TMPDIR}/${path%%=*}   echo -n "${path##*=} " >> ${TMPDIR}/${path%%=*}
70   unset SPECVAR   unset SPECVAR
71   else   ;;
72   # special var are written to tmpfile   *)
73   # to substitude them to one variable   # special var are written to tmpfile
74   # substitudes " from $path if exists   # to substitude them to one variable
75   path="${path//\"}" #}" <--- make code readable again :)   # substitudes " from $path if exists
76   echo -n "${path##*=}:" >> ${TMPDIR}/${path%%=*}   path="${path//\"}" #}" <--- make code readable again :)
77   unset SPECVAR   echo -n "${path##*=}:" >> ${TMPDIR}/${path%%=*}
78   fi   unset SPECVAR
79     ;;
80     esac
81   else   else
82   # all other vars go directly to /etc/profile.env   # all other vars go directly to /etc/profile.env
83   echo "export ${path}" >> ${P}/etc/profile.env   echo "export ${path}" >> ${P}/etc/profile.env

Legend:
Removed from v.456  
changed lines
  Added in v.1565