cvs commit: ALFS/profiles/BLFS/config_standard/scripts compressdoc

thomasp at linuxfromscratch.org thomasp at linuxfromscratch.org
Mon Apr 26 21:00:16 PDT 2004


thomasp     04/04/26 22:00:16

  Modified:    profiles/BLFS BLFS.xml packages.ent runit.sh system.ent
               profiles/BLFS/chapter03 bash_startup.xml inputrc.xml
                        issue.xml random.xml vimrc.xml
               profiles/BLFS/config_standard/etc bashrc issue profile
  Added:       profiles/BLFS/chapter03 configusers.xml maninfo.xml
                        netfs.xml shells.xml
               profiles/BLFS/config_standard/etc/skel dot_bash_logout
                        dot_bash_profile dot_bashrc
               profiles/BLFS/config_standard/scripts compressdoc
  Log:
  Chapter 3 Updated
  
  Revision  Changes    Path
  1.20      +7 -4      ALFS/profiles/BLFS/BLFS.xml
  
  Index: BLFS.xml
  ===================================================================
  RCS file: /home/cvsroot/ALFS/profiles/BLFS/BLFS.xml,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- BLFS.xml	24 Apr 2004 01:10:18 -0000	1.19
  +++ BLFS.xml	27 Apr 2004 04:00:16 -0000	1.20
  @@ -48,12 +48,15 @@
   
   <stage name="Chapter 3 (After LFS Configuration Issues)">
   
  -    &issue;
  -    &bash_startup;
  +    &configusers;
       &inputrc;
  -    &random;
  +    &bash_startup;
       &vimrc;
  -    &skel;
  +    &issue;
  +    &shells;
  +    &random;
  +    &compressman;
  +    &netfs;
   
   </stage>
   
  
  
  
  1.27      +4 -0      ALFS/profiles/BLFS/packages.ent
  
  Index: packages.ent
  ===================================================================
  RCS file: /home/cvsroot/ALFS/profiles/BLFS/packages.ent,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- packages.ent	8 Mar 2004 20:17:19 -0000	1.26
  +++ packages.ent	27 Apr 2004 04:00:16 -0000	1.27
  @@ -1,3 +1,7 @@
  +<!ENTITY lfs-bootscripts-version "2.0.3">
  +<!ENTITY lfs-bootscripts-package "lfs-bootscripts-&lfs-bootscripts-version;.tar.bz2">
  +<!ENTITY lfs-bootscripts-directory "lfs-bootscripts-&lfs-bootscripts-version;">
  +
   <!--************* packages for chapter 4 *************-->
   
   <!ENTITY linuxpam-version   "0.77">
  
  
  
  1.2       +1 -1      ALFS/profiles/BLFS/runit.sh
  
  Index: runit.sh
  ===================================================================
  RCS file: /home/cvsroot/ALFS/profiles/BLFS/runit.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- runit.sh	29 Sep 2003 18:11:25 -0000	1.1
  +++ runit.sh	27 Apr 2004 04:00:16 -0000	1.2
  @@ -1,7 +1,7 @@
   #!/bin/bash
   
   if [ ! -d /var/log/nALFS ]; then
  -    mkdir /var/log/nALF
  +    mkdir /var/log/nALFS
   fi
   export NALFS_STAMP_DIR=/var/log/nALFS
   
  
  
  
  1.19      +5 -1      ALFS/profiles/BLFS/system.ent
  
  Index: system.ent
  ===================================================================
  RCS file: /home/cvsroot/ALFS/profiles/BLFS/system.ent,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- system.ent	8 Mar 2004 20:17:19 -0000	1.18
  +++ system.ent	27 Apr 2004 04:00:16 -0000	1.19
  @@ -1,12 +1,16 @@
   
   
   <!-- chapter 3 -->
  +<!ENTITY configusers SYSTEM "./chapter03/configusers.xml">
   <!ENTITY issue     SYSTEM "./chapter03/issue.xml">
   <!ENTITY bash_startup SYSTEM "./chapter03/bash_startup.xml">
   <!ENTITY inputrc   SYSTEM "./chapter03/inputrc.xml">
   <!ENTITY random    SYSTEM "./chapter03/random.xml">
   <!ENTITY vimrc     SYSTEM "./chapter03/vimrc.xml">
  -<!ENTITY skel      SYSTEM "./chapter03/skel.xml">
  +<!ENTITY shells    SYSTEM "./chapter03/shells.xml">
  +<!ENTITY netfs     SYSTEM "./chapter03/netfs.xml">
  +<!ENTITY compressman   SYSTEM "./chapter03/maninfo.xml">
  +
   
   <!-- chapter 4 -->
   <!ENTITY shadow    SYSTEM "./chapter04/shadow.xml">
  
  
  
  1.2       +26 -31    ALFS/profiles/BLFS/chapter03/bash_startup.xml
  
  Index: bash_startup.xml
  ===================================================================
  RCS file: /home/cvsroot/ALFS/profiles/BLFS/chapter03/bash_startup.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- bash_startup.xml	29 Sep 2003 18:11:25 -0000	1.1
  +++ bash_startup.xml	27 Apr 2004 04:00:16 -0000	1.2
  @@ -1,35 +1,30 @@
   <?xml version="1.0" encoding="ISO-8859-1"?>
   
  -<package name="bash_startup" version ="1.0">
  -
  -<stage name="Building bash startup files.">
  -
  -
  -<copy>
  -        <source>&blfs-config;/etc/profile</source>
  -	<destination>/etc/profile</destination>
  -</copy>
  -
  -<copy>
  -        <source>&blfs-config;/etc/bashrc</source>
  -	<destination>/etc/bashrc</destination>
  -</copy>
  -
  -<copy>
  -        <source>&blfs-config;/root/.bash_profile</source>
  -	<destination>/root/.bash_profile</destination>
  -</copy>
  -
  -<copy>
  -        <source>&blfs-config;/root/.bashrc</source>
  -	<destination>/root/.bashrc</destination>
  -</copy>
  -
  -<copy>
  -        <source>&blfs-config;/root/.bash_logout</source>
  -	<destination>/root/.bash_logout</destination>
  -</copy>
  +<stage name="The Bash Shell Startup Files">
  +	
  +	<copy>
  +        	<source>&blfs-config;/etc/profile</source>
  +		<destination>/etc/profile</destination>
  +	</copy>
  +
  +	<copy>
  +        	<source>&blfs-config;/etc/bashrc</source>
  +		<destination>/etc/bashrc</destination>
  +	</copy>
  +
  +	<copy>
  +        	<source>&blfs-config;/etc/skel/dot_bash_profile</source>
  +		<destination>/root/.bash_profile</destination>
  +	</copy>
  +
  +	<copy>
  +        	<source>&blfs-config;/etc/skel/dot_bashrc</source>
  +		<destination>/root/.bashrc</destination>
  +	</copy>
  +
  +	<copy>
  +      		<source>&blfs-config;/skel/dot_bash_logout</source>
  +		<destination>/root/.bash_logout</destination>
  +	</copy>
   
   </stage>
  -
  -</package>
  
  
  
  1.2       +44 -44    ALFS/profiles/BLFS/chapter03/inputrc.xml
  
  Index: inputrc.xml
  ===================================================================
  RCS file: /home/cvsroot/ALFS/profiles/BLFS/chapter03/inputrc.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- inputrc.xml	29 Sep 2003 18:11:25 -0000	1.1
  +++ inputrc.xml	27 Apr 2004 04:00:16 -0000	1.2
  @@ -1,48 +1,48 @@
   <?xml version="1.0" encoding="ISO-8859-1"?>
   
  -<stage name="Building /etc/inputrc">
  -
  -
  -<textdump base="/etc">
  -        <file>inputrc</file>
  -        <content>
  -            =
  -            =# Make sure we dont output everything on the 1 line
  -            =set horizontal-scroll-mode Off
  -            =
  -            =# Enable 8bit input
  -            =set meta-flag On 
  -            =set input-meta On
  -            =
  -            =# Turns off 8th bit stripping
  -            =set convert-meta Off
  -            =
  -            =# Keep the 8th bit for display
  -            =set output-meta On
  -            =
  -            =# none, visible or audible
  -            =set bell-style none
  -            =
  -            =# All of the following map the escape sequence of the 
  -            =# value contained inside the 1st argument to the 
  -            =# readline specific functions
  -            =
  -            ="\eOd": backward-word
  -            ="\eOc": forward-word
  -            =
  -            =# for linux console
  -            ="\e[1~": beginning-of-line
  -            ="\e[4~": end-of-line
  -            ="\e[5~": beginning-of-history
  -            ="\e[6~": end-of-history
  -            ="\e[3~": delete-char
  -            ="\e[2~": quoted-insert
  -            =
  -            =# for xterm
  -            ="\eOH": beginning-of-line
  -            ="\eOF": end-of-line
  -        </content>
  -</textdump>
  -
  +<stage name="/etc/inputrc">
  +	<textdump base="/etc">
  +        	<file>inputrc</file>
  +        	<content>
  +		=# Begin /etc/inputrc
  +            	=
  +            	=# Make sure we dont output everything on the 1 line
  +            	=set horizontal-scroll-mode Off
  +            	=
  +            	=# Enable 8bit input
  +            	=set meta-flag On 
  +            	=set input-meta On
  +            	=
  +            	=# Turns off 8th bit stripping
  +            	=set convert-meta Off
  +            	=
  +            	=# Keep the 8th bit for display
  +            	=set output-meta On
  +            	=
  +            	=# none, visible or audible
  +            	=set bell-style none
  +            	=
  +            	=# All of the following map the escape sequence of the 
  +            	=# value contained inside the 1st argument to the 
  +            	=# readline specific functions
  +           	=
  +            	="\eOd": backward-word
  +            	="\eOc": forward-word
  +            	=
  +            	=# for linux console
  +            	="\e[1~": beginning-of-line
  +            	="\e[4~": end-of-line
  +            	="\e[5~": beginning-of-history
  +            	="\e[6~": end-of-history
  +            	="\e[3~": delete-char
  +            	="\e[2~": quoted-insert
  +            	=
  +            	=# for xterm
  +            	="\eOH": beginning-of-line
  +            	="\eOF": end-of-line
  +		=
  +		=# End /etc/inputrc
  +        	</content>
  +	</textdump>
   </stage>
   
  
  
  
  1.2       +5 -9      ALFS/profiles/BLFS/chapter03/issue.xml
  
  Index: issue.xml
  ===================================================================
  RCS file: /home/cvsroot/ALFS/profiles/BLFS/chapter03/issue.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- issue.xml	29 Sep 2003 18:11:25 -0000	1.1
  +++ issue.xml	27 Apr 2004 04:00:16 -0000	1.2
  @@ -1,14 +1,10 @@
   <?xml version="1.0" encoding="ISO-8859-1"?>
   
  -<package name="issue" version ="1.0">
  +<stage name="/etc/issue">
   
  -<stage name="Building /etc/issue.">
  -
  -<copy>
  -        <source>&blfs-config;/etc/issue</source>
  -	<destination>/etc/issue</destination>
  -</copy>
  +	<copy>
  +        	<source>&blfs-config;/etc/issue</source>
  +		<destination>/etc/issue</destination>
  +	</copy>
   
   </stage>
  -
  -</package>
  
  
  
  1.2       +21 -81    ALFS/profiles/BLFS/chapter03/random.xml
  
  Index: random.xml
  ===================================================================
  RCS file: /home/cvsroot/ALFS/profiles/BLFS/chapter03/random.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- random.xml	29 Sep 2003 18:11:25 -0000	1.1
  +++ random.xml	27 Apr 2004 04:00:16 -0000	1.2
  @@ -1,87 +1,27 @@
   <?xml version="1.0" encoding="ISO-8859-1"?>
   
  -<stage name="Building /etc/rc.d/init.d/random">
  -
  -<textdump base="/etc/rc.d/init.d">
  -        <file>random</file>
  -        <content>
  -            =#!/bin/sh
  -            =# Begin $rc_base/init.d/random
  -            =
  -            =# Based on sysklogd script from LFS-3.1 and earlier.
  -            =# Rewritten by Gerard Beekmans  - gerard at linuxfromscratch.org
  -            =# Random script elements by Larry Lawrence
  -            =
  -            =source /etc/sysconfig/rc
  -            =source $rc_functions
  -            =
  -            =case "$1" in
  -            =        start)
  -            =                echo "Initializing kernel random number generator..."
  -            =                if [ -f /var/tmp/random-seed ]; then
  -            =	                cat /var/tmp/random-seed >/dev/urandom
  -            =		fi
  -            =		dd if=/dev/urandom of=/var/tmp/random-seed count=1 &>/dev/null
  -            =		evaluate_retval
  -            =		;;
  -            =		
  -            =	stop)
  -            =		echo "Saving random seed..."
  -            =		dd if=/dev/urandom of=/var/tmp/random-seed count=1 &>/dev/null
  -            =		evaluate_retval
  -            =		;;
  -            =
  -            =        *)
  -            =                echo "Usage: $0 {start|stop}"
  -            =                exit 1
  -            =                ;;
  -            =esac
  -            =
  -            =# End $rc_base/init.d/random
  -        </content>
  -</textdump>
  -
  -<permissions mode="755">
  -    <name>/etc/rc.d/init.d/random</name>
  -</permissions>
  -
  -
  -<link base="/etc/rc.d/init.d">
  -    <option>force</option>
  -    <target>../init.d/random</target>
  -    <name>../rc0.d/K45random</name>
  -</link>
  -
  -<link base="/etc/rc.d/init.d">
  -    <option>force</option>
  -    <target>../init.d/random</target>
  -    <name>../rc2.d/S25random</name>
  -</link>
  -
  -<link base="/etc/rc.d/init.d">
  -    <option>force</option>
  -    <target>../init.d/random</target>
  -    <name>../rc3.d/S25random</name>
  -</link>
  -
  -<link base="/etc/rc.d/init.d">
  -    <option>force</option>
  -    <target>../init.d/random</target>
  -    <name>../rc4.d/S25random</name>
  -</link>
  -
  -<link base="/etc/rc.d/init.d">
  -    <option>force</option>
  -    <target>../init.d/random</target>
  -    <name>../rc5.d/S25random</name>
  -</link>
  -
  -<link base="/etc/rc.d/init.d">
  -    <option>force</option>
  -    <target>../init.d/random</target>
  -    <name>../rc6.d/K45random</name>
  -</link>
  +<stage name="Random Number Generation">
   
  +	<stage name="Unpack lfs-bootscripts package">
  +		<unpack>
  +			<archive>&packages_dir;/&lfs-bootscripts-package;</archive>
  +			<destination>&build_dir;</destination>
  +		</unpack>
  +	</stage>
  +
  +	<stage name="Install bootscript">
  +		<stageinfo>
  +			<base>&build_dir;/&lfs-bootscripts-directory;</base>
  +		</stageinfo>
  +
  +		<make>
  +			<param>install-random</param>
  +		</make>
  +	</stage>
  +
  +	<stage name="Clean Up">
  +		<remove>&build_dir;/&lfs-bootscripts-directory;</remove>
  +	</stage>
   
   </stage>
   
  
  
  
  1.2       +20 -21    ALFS/profiles/BLFS/chapter03/vimrc.xml
  
  Index: vimrc.xml
  ===================================================================
  RCS file: /home/cvsroot/ALFS/profiles/BLFS/chapter03/vimrc.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- vimrc.xml	29 Sep 2003 18:11:25 -0000	1.1
  +++ vimrc.xml	27 Apr 2004 04:00:16 -0000	1.2
  @@ -1,27 +1,26 @@
   <?xml version="1.0" encoding="ISO-8859-1"?>
   
  -<stage name="Building /etc/vimrc">
  +<stage name="/etc/vimrc">
   
  -
  -<textdump base="/etc">
  -        <file>vimrc</file>
  -        <content>
  -            =" Begin .vimrc
  -            =
  -            =set nocompatible
  -            =set bs=2
  -            =set columns=80
  -            =set background=dark
  -            =set tabstop=8
  -            =set wrapmargin=8
  -            =set nobk
  -            =syntax on
  -            =set ruler
  -            =set noexpandtab
  -            =
  -            =" End .vimrc
  -        </content>
  -</textdump>
  +	<textdump base="/etc">
  +       		<file>vimrc</file>
  +       	 	<content>
  +            	=" Begin .vimrc
  +            	=
  +            	=set nocompatible
  +            	=set bs=2
  +            	=set columns=80
  +            	=set background=dark
  +            	=set tabstop=8
  +            	=set wrapmargin=8
  +            	=set nobk
  +            	=syntax on
  +            	=set ruler
  +            	=set noexpandtab
  +            	=
  +            	=" End .vimrc
  +        	</content>
  +	</textdump>
   
   </stage>
   
  
  
  
  1.1                  ALFS/profiles/BLFS/chapter03/configusers.xml
  
  Index: configusers.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <stage name="Configuring for adding users.">
  
  	<textdump base="/etc/default">
         		<file>useradd</file>
  		<content>
                  	=# Begin /etc/default/useradd
                  	=
                  	=GROUP=100
                  	=HOME=/home
                  	=INACTIVE=-1
                  	=EXPIRE=
                  	=SHELL=/bin/bash
                  	=SKEL=/etc/skel
                  	=
                  	=# End /etc/default/useradd
  		</content>
  	</textdump>
  
  	<mkdir>
          	<option>parents</option>
  		<name>/etc/skel</name>
  	</mkdir>
  
  	<copy>
         		<source>&blfs-config;/etc/skel/dot_bash_profile</source>
  		<destination>/etc/skel/.bash_profile</destination>
  	</copy>
  
  	<copy>
          	<source>&blfs-config;/etc/skel/dot_bash_logout</source>
  		<destination>/etc/skel/.bash_logout</destination>
  	</copy>
  
  	<copy>
          	<source>&blfs-config;/etc/skel/dot_bashrc</source>
  		<destination>/etc/skel/.bashrc</destination>
  	</copy>
  </stage>
  
  
  
  
  
  1.1                  ALFS/profiles/BLFS/chapter03/maninfo.xml
  
  Index: maninfo.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <stage name="Compressing man and info pages">
  
  <!-- Note: this section does not execute the script that is installed here. Refer to the script
  itself and the installation page in the BLFS Book for instructions on how to use it. -->
  
  	<copy>
  		<source>&blfs-config;/scripts/compressdoc</source>
  		<destination>/usr/sbin</destination>
  	</copy>
  
  	<permissions mode="755">
  		<name>/usr/sbin/compressdoc</name>
  	</permissions>
  </stage>
  
  
  
  
  1.1                  ALFS/profiles/BLFS/chapter03/netfs.xml
  
  Index: netfs.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <stage name="Configuring for Network Filesystems">
  
  	<stage name="Unpack lfs-bootscripts package">
  		<unpack>
  			<archive>&packages_dir;/&lfs-bootscripts-package;</archive>
  			<destination>&build_dir;</destination>
  		</unpack>
  	</stage>
  
  	<stage name="Install bootscript">
  		<stageinfo>
  			<base>&build_dir;/&lfs-bootscripts-directory;</base>
  		</stageinfo>
  
  		<make>
  			<param>install-netfs</param>
  		</make>
  	</stage>
  
  	<stage name="Clean Up">
  		<remove>&build_dir;/&lfs-bootscripts-directory;</remove>
  	</stage>
  
  </stage>
  
  
  
  
  1.1                  ALFS/profiles/BLFS/chapter03/shells.xml
  
  Index: shells.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <stage name="/etc/shells">
  
  	<textdump base="/etc">
  		<file>shells</file>
  		<content>
  		=# Begin /etc/shells
  		=
  		=/bin/sh
  		=/bin/bash
  		=
  		=# End /etc/shells
  		</content>
  	</textdump>
  
  </stage>
  
  
  
  1.2       +6 -0      ALFS/profiles/BLFS/config_standard/etc/bashrc
  
  Index: bashrc
  ===================================================================
  RCS file: /home/cvsroot/ALFS/profiles/BLFS/config_standard/etc/bashrc,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- bashrc	29 Sep 2003 18:15:52 -0000	1.1
  +++ bashrc	27 Apr 2004 04:00:16 -0000	1.2
  @@ -21,4 +21,10 @@
   # /etc/profile.
   alias ls='ls --color=auto'
   
  +# Provides prompt for non-interactive shells, specifically shells started
  +# in the xfree environment. [Review archive thread titled PS1
  +# Environment Variable for a great case study behind this script
  +# addendum.]
  +export PS1="[\u@\h \w]\\$ "
  +
   # End /etc/bashrc
  
  
  
  1.2       +2 -19     ALFS/profiles/BLFS/config_standard/etc/issue
  
  Index: issue
  ===================================================================
  RCS file: /home/cvsroot/ALFS/profiles/BLFS/config_standard/etc/issue,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- issue	29 Sep 2003 18:15:52 -0000	1.1
  +++ issue	27 Apr 2004 04:00:16 -0000	1.2
  @@ -1,19 +1,2 @@
  -
  -
  -                                                                               
  -                                                                                
  -                                                                                
  -                                                                              
  -                                                                                
  -         `----'                                                                 
  -                      
  -                      
  -                      
  -                      Linux From Scratch 3.2/Linux 2.4.19 on kali.
  -                      One 1.67GHz AMD Athlon XP Processor.
  -                      512M RAM, 3322.67 Bogomips Total. 
  -                      Uptime 0 hours 1 minute
  -                      Console: \l
  -                      
  -                      
  -
  \ No newline at end of file
  +Linux From Scratch 5.0
  +Running Linux Kernel Version \r on an \m
  
  
  
  1.2       +2 -1      ALFS/profiles/BLFS/config_standard/etc/profile
  
  Index: profile
  ===================================================================
  RCS file: /home/cvsroot/ALFS/profiles/BLFS/config_standard/etc/profile,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- profile	29 Sep 2003 18:15:52 -0000	1.1
  +++ profile	27 Apr 2004 04:00:16 -0000	1.2
  @@ -39,6 +39,7 @@
   
   # Setup some environment variables.
   HISTSIZE=1000
  +HISTIGNORE="&:[bf]g:exit"
   PS1="[\u@\h \w]\\$ "
   
   # Setup the INPUTRC environment variable.
  @@ -55,6 +56,6 @@
   	fi
   fi
   
  -export PATH HISTSIZE PS1 LS_COLORS INPUTRC
  +export PATH HISTSIZE HISTIGNORE PS1 LS_COLORS INPUTRC
   
   # End /etc/profile
  
  
  
  1.1                  ALFS/profiles/BLFS/config_standard/etc/skel/dot_bash_logout
  
  Index: dot_bash_logout
  ===================================================================
  # Begin ~/.bash_logout
  # Written for Beyond Linux From Scratch
  # by James Robertson <jameswrobertson at earthlink.net>
  
  # Personal items to perform on logout.
  
  # End ~/.bash_logout
  
  
  
  1.1                  ALFS/profiles/BLFS/config_standard/etc/skel/dot_bash_profile
  
  Index: dot_bash_profile
  ===================================================================
  # Begin ~/.bash_profile
  # Written for Beyond Linux From Scratch
  # by James Robertson <jameswrobertson at earthlink.net>
  
  # Personal environment variables and startup programs.
  
  # Personal aliases and functions should go in ~/.bashrc.  System wide
  # environment variables and startup programs are in /etc/profile.
  # System wide aliases and functions are in /etc/bashrc.
  
  if [ -f "$HOME/.bashrc" ] ; then
  	source $HOME/.bashrc
  fi
  
  if [ -d "$HOME/bin" ] ; then
  	pathman $HOME/bin last
  fi
  
  export PATH 
  
  # End ~/.bash_profile
  
  
  
  1.1                  ALFS/profiles/BLFS/config_standard/etc/skel/dot_bashrc
  
  Index: dot_bashrc
  ===================================================================
  # Begin ~/.bashrc
  # Written for Beyond Linux From Scratch
  # by James Robertson <jameswrobertson at earthlink.net>
  
  # Personal aliases and functions.
  
  # Personal environment variables and startup programs should go in
  # ~/.bash_profile.  System wide environment variables and startup
  # programs are in /etc/profile.  System wide aliases and functions are
  # in /etc/bashrc. 
  
  if [ -f "/etc/bashrc" ] ; then
  	source /etc/bashrc
  fi
  
  # End ~/.bashrc
  
  
  
  1.1                  ALFS/profiles/BLFS/config_standard/scripts/compressdoc
  
  Index: compressdoc
  ===================================================================
  #!/bin/bash
  # VERSION: 20040320.0026
  #
  # Compress (with bzip2 or gzip) all man pages in a hierarchy and
  # update symlinks - By Marc Heerdink <marc @ koelkast.net>
  # Modified to be able to gzip or bzip2 files as an option and to deal
  # with all symlinks properly by Mark Hymers <markh @ linuxfromscratch.org>
  #
  # Modified 20030930 by Yann E. Morin <yann.morin.1998 @ anciens.enib.fr>
  # to accept compression/decompression, to correctly handle hard-links,
  # to allow for changing hard-links into soft- ones, to specify the
  # compression level, to parse the man.conf for all occurrences of MANPATH,
  # to allow for a backup, to allow to keep the newest version of a page.
  # Modified 20040330 by Tushar Teredesai to replace $0 by the name of the script.
  #   (Note: It is assumed that the script is in the user's PATH)
  #
  # TODO:
  #        - choose a default compress method to be based on the available
  #          tool : gzip or bzip2;
  #        - offer an option to automagically choose the best compression method
  #          on a per page basis (eg. check which ofgzip/bzip2/whatever is the
  #          most effective, page per page);
  #        - when a MANPATH env var exists, use this instead of /etc/man.conf
  #          (useful for users to (de)compress their man pages;
  #        - offer an option to restore a previous backup;
  #        - add other compression engines (compress, zip, etc?). Needed?
  
  # Funny enough, this function prints some help.
  function help ()
  {
    if [ -n "$1" ]; then
      echo "Unknown option : $1"
    fi
    ( echo "Usage: $MY_NAME <comp_method> [options] [dirs]" && \
    cat << EOT
  Where comp_method is one of :
    --gzip, --gz, -g
    --bzip2, --bz2, -b
                  Compress using gzip or bzip2.
  
    --decompress, -d
                  Decompress the man pages.
  
    --backup      Specify a .tar backup shall be done for every directories.
                  In case a backup already exists, it is saved as .tar.old prior
                  to making the new backup. If an .tar.old backup exist, it is
                  removed prior to saving the backup.
                  In backup mode, no other action is performed.
  
  And where options are :
    -1 to -9, --fast, --best
                  The compression level, as accepted by gzip and bzip2. When not
                  specified, uses the default compression level for the given
                  method (-6 for gzip, and -9 for bzip2). Not used when in backup
                  or decompress modes.
  
    --force, -F   Force (re-)compression, even if the previous one was the same
                  method. Useful when changing the compression ratio. By default,
                  a page will not be re-compressed if it ends with the same suffix
                  as the method adds (.bz2 for bzip2, .gz for gzip).
  
    --soft, -S    Change hard-links into soft-links. Use with _caution_ as the
                  first encountered file will be used as a reference. Not used
                  when in backup mode.
  
    --hard, -H    Change soft-links into hard-links. Not used when in backup mode.
  
    --conf=dir, --conf dir
                  Specify the location of man.conf. Defaults to /etc.
  
    --verbose, -v Verbose mode, print the name of the directory being processed.
                  Double the flag to turn it even more verbose, and to print the
                  name of the file being processed.
  
    --fake, -f    Fakes it. Print the actual parameters compman will use.
  
    dirs          A list of space-separated _absolute_ pathname to the man
                  directories.
                  When empty, and only then, parse ${MAN_CONF}/man.conf for all
                  occurrences of MANPATH.
  
  Note about compression
    There has been a discussion on blfs-support about compression ratios of
    both gzip and bzip2 on man pages, taking into account the hosting fs,
    the architecture, etc... On the overall, the conclusion was that gzip
    was much efficient on 'small' files, and bzip2 on 'big' files, small and
    big being very dependent on the content of the files.
  
    See the original post from Mickael A. Peters, titled "Bootable Utility CD",
    and dated 20030409.1816(+0200), and subsequent posts:
    http://linuxfromscratch.org/pipermail/blfs-support/2003-April/038817.html
  
    On my system (x86, ext3), man pages were 35564kiB before compression. gzip -9
    compressed them down to 20372kiB (57.28%), bzip2 -9 got down to 19812kiB
    (55.71%). That is a 1.57% gain in space. YMMV.
  
    What was not taken into consideration was the decompression speed. But does
    it make sense to? You gain fast access with uncompressed man pages, or you
    gain space at the expense of a slight overhead in time. Well, my P4-2.5GHz
    does not even let me notice this... :-)
  EOT
  ) | less
  }
  
  # This function checks that the man page is unique amongst bzip2'd, gzip'd and
  # uncompressed versions.
  #  $1 the directory in which the file resides
  #  $2 the file name for the man page
  # Returns 0 (true) if the file is the latest and must be taken care of, and 1
  # (false) if the file is not the latest (and has therefore been deleted).
  function check_unique ()
  {
    # NB. When there are hard-links to this file, these are
    # _not_ deleted. In fact, if there are hard-links, they
    # all have the same date/time, thus making them ready
    # for deletion later on.
  
    # Build the list of all man pages with the same name
    DIR=$1
    BASENAME=`basename "${2}" .bz2`
    BASENAME=`basename "${BASENAME}" .gz`
    GZ_FILE="$BASENAME".gz
    BZ_FILE="$BASENAME".bz2
  
    # Look for, and keep, the most recent one
    LATEST=`(cd "$DIR"; ls -1rt "${BASENAME}" "${GZ_FILE}" "${BZ_FILE}" 2>/dev/null | tail -n 1)`
    for i in "${BASENAME}" "${GZ_FILE}" "${BZ_FILE}"; do
      [ "$LATEST" != "$i" ] && rm -f "$DIR"/"$i"
    done
  
    # In case the specified file was the latest, return 0
    [ "$LATEST" = "$2" ] && return 0
    # If the file was not the latest, return 1
    return 1
  }
  
  # Name of the script
  MY_NAME=`basename $0`
  
  # OK, parse the command-line for arguments, and initialize to some sensible
  # state, that is : don't change links state, parse /etc/man.conf, be most
  # silent, search man.conf in /etc, and don't force (re-)compression.
  COMP_METHOD=
  COMP_SUF=
  COMP_LVL=
  FORCE_OPT=
  LN_OPT=
  MAN_DIR=
  VERBOSE_LVL=0
  BACKUP=no
  FAKE=no
  MAN_CONF=/etc
  while [ -n "$1" ]; do
    case $1 in
      --gzip|--gz|-g)
        COMP_SUF=.gz
        COMP_METHOD=$1
        shift
        ;;
      --bzip2|--bz2|-b)
        COMP_SUF=.bz2
        COMP_METHOD=$1
        shift
        ;;
      --decompress|-d)
        COMP_SUF=
        COMP_LVL=
        COMP_METHOD=$1
        shift
        ;;
      -[1-9]|--fast|--best)
        COMP_LVL=$1
        shift
        ;;
      --force|-F)
        FORCE_OPT=-F
        shift
        ;;
      --soft|-S)
        LN_OPT=-S
        shift
        ;;
      --hard|-H)
        LN_OPT=-H
        shift
        ;;
      --conf=*)
        MAN_CONF=`echo $1 | cut -d '=' -f2-`
        shift
        ;;
      --conf)
        MAN_CONF="$2"
        shift 2
        ;;
      --verbose|-v)
        let VERBOSE_LVL++
        shift
        ;;
      --backup)
        BACKUP=yes
        shift
        ;;
      --fake|-f)
        FAKE=yes
        shift
        ;;
      --help|-h)
        help
        exit 0
        ;;
      /*)
        MAN_DIR="${MAN_DIR} ${1}"
        shift
        ;;
      -*)
        help $1
        exit 1
        ;;
      *)
        echo "\"$1\" is not an absolute path name" 
        exit 1
        ;;
    esac
  done
  
  # Redirections
  case $VERBOSE_LVL in
    0)
       # O, be silent
       DEST_FD0=/dev/null
       DEST_FD1=/dev/null
       VERBOSE_OPT=
       ;;
    1)
       # 1, be a bit verbose
       DEST_FD0=/dev/stdout
       DEST_FD1=/dev/null
       VERBOSE_OPT=-v
       ;;
    *)
       # 2 and above, be most verbose
       DEST_FD0=/dev/stdout
       DEST_FD1=/dev/stdout
       VERBOSE_OPT="-v -v"
       ;;
  esac
  
  # Note: on my machine, 'man --path' gives /usr/share/man twice, once with a trailing '/', once without.
  if [ -z "$MAN_DIR" ]; then
    MAN_DIR=`man --path -C "$MAN_CONF"/man.conf \
              | sed 's/:/\\n/g' \
              | while read foo; do dirname "$foo"/.; done \
              | sort -u \
              | while read bar; do echo -n "$bar "; done`
  fi
  
  # If no MANPATH in ${MAN_CONF}/man.conf, abort as well
  if [ -z "$MAN_DIR" ]; then
    echo "No directory specified, and no directory found with \`man --path'"
    exit 1
  fi
  
  # Fake?
  if [ "$FAKE" != "no" ]; then
    echo "Actual parameters used:"
    echo -n "Compression.......: "
    case $COMP_METHOD in
      --bzip2|--bz2|-b) echo -n "bzip2";;
      --gzip|__gz|-g) echo -n "gzip";;
      --decompress|-d) echo -n "decompressing";;
      *) echo -n "unknown";;
    esac
    echo " ($COMP_METHOD)"
    echo "Compression level.: $COMP_LVL"
    echo "Compression suffix: $COMP_SUF"
    echo -n "Force compression.: "
    [ "foo$FORCE_OPT" = "foo-F" ] && echo "yes" || echo "no"
    echo "man.conf is.......: ${MAN_CONF}/man.conf"
    echo -n "Hard-links........: "
    [ "foo$LN_OPT" = "foo-S" ] && echo "convert to soft-links" || echo "leave as is"
    echo -n "Soft-links........: "
    [ "foo$LN_OPT" = "foo-H" ] && echo "convert to hard-links" || echo "leave as is"
    echo "Backup............: $BACKUP"
    echo "Faking (yes!).....: $FAKE"
    echo "Directories.......: $MAN_DIR"
    echo "Verbosity level...: $VERBOSE_LVL"
    exit 0
  fi
  
  # If no method was specified, print help
  if [ -z "${COMP_METHOD}" -a "${BACKUP}" = "no" ]; then
    help
    exit 1
  fi
  
  # In backup mode, do the backup solely
  if [ "$BACKUP" = "yes" ]; then
    for DIR in $MAN_DIR; do
      cd "${DIR}/.."
      DIR_NAME=`basename "${DIR}"`
      echo "Backing up $DIR..." > $DEST_FD0
      [ -f "${DIR_NAME}.tar.old" ] && rm -f "${DIR_NAME}.tar.old"
      [ -f "${DIR_NAME}.tar" ] && mv "${DIR_NAME}.tar" "${DIR_NAME}.tar.old"
      tar cfv "${DIR_NAME}.tar" "${DIR_NAME}" > $DEST_FD1
    done
    exit 0
  fi
  
  # I know MAN_DIR has only absolute path names
  # I need to take into account the localized man, so I'm going recursive
  for DIR in $MAN_DIR; do
    MEM_DIR=`pwd`
    cd "$DIR"
    for FILE in *; do
      # Fixes the case were the directory is empty
      if [ "foo$FILE" = "foo*" ]; then continue; fi
  
      # Fixes the case when hard-links see their compression scheme change
      # (from not compressed to compressed, or from bz2 to gz, or from gz to bz2)
      # Also fixes the case when multiple version of the page are present, which
      # are either compressed or not.
      if [ ! -L "$FILE" -a ! -e "$FILE" ]; then continue; fi
  
      # Do not compress whatis files
      if [ "$FILE" = "whatis" ]; then continue; fi
  
      if [ -d "$FILE" ]; then
        cd "${MEM_DIR}"  # Go back to where we ran "$0", in case "$0"=="./compressdoc" ...
        # We are going recursive to that directory
        echo "-> Entering ${DIR}/${FILE}..." > $DEST_FD0
        # I need not pass --conf, as I specify the directory to work on
        # But I need exit in case of error
        "$MY_NAME" ${COMP_METHOD} ${COMP_LVL} ${LN_OPT} ${VERBOSE_OPT} ${FORCE_OPT} "${DIR}/${FILE}" || exit 1
        echo "<- Leaving ${DIR}/${FILE}." > $DEST_FD1
        cd "$DIR"  # Needed for the next iteration of the loop
  
      else # !dir
        if ! check_unique "$DIR" "$FILE"; then continue; fi
  
        # Check if the file is already compressed with the specified method
        BASE_FILE=`basename "$FILE" .gz`
        BASE_FILE=`basename "$BASE_FILE" .bz2`
        if [ "${FILE}" = "${BASE_FILE}${COMP_SUF}" -a "foo${FORCE_OPT}" = "foo" ]; then continue; fi
  
        # If we have a symlink
        if [ -h "$FILE" ]; then
          case "$FILE" in
            *.bz2)
              EXT=bz2 ;;
            *.gz)
              EXT=gz ;;
            *)
              EXT=none ;;
          esac
  
          if [ ! "$EXT" = "none" ]; then
            LINK=`ls -l "$FILE" | cut -d ">" -f2 | tr -d " " | sed s/\.$EXT$//`
            NEWNAME=`echo "$FILE" | sed s/\.$EXT$//`
            mv "$FILE" "$NEWNAME"
            FILE="$NEWNAME"
          else
            LINK=`ls -l "$FILE" | cut -d ">" -f2 | tr -d " "`
          fi
  
          if [ "$LN_OPT" = "-H" ]; then
            # Change this soft-link into a hard- one
            rm -f "$FILE" && ln "${LINK}$COMP_SUF" "${FILE}$COMP_SUF"
            chmod --reference "${LINK}$COMP_SUF" "${FILE}$COMP_SUF"
          else
            # Keep this soft-link a soft- one.
            rm -f "$FILE" && ln -s "${LINK}$COMP_SUF" "${FILE}$COMP_SUF"
          fi
          echo "Relinked $FILE" > $DEST_FD1
  
        # else if we have a plain file
        elif [ -f "$FILE" ]; then
          # Take care of hard-links: build the list of files hard-linked
          # to the one we are {de,}compressing.
          # NB. This is not optimum has the file will eventually be compressed
          # as many times it has hard-links. But for now, that's the safe way.
          inode=`ls -li "$FILE" | awk '{print $1}'`
          HLINKS=`find . \! -name "$FILE" -inum $inode`
  
          if [ -n "$HLINKS" ]; then
            # We have hard-links! Remove them now.
            for i in $HLINKS; do rm -f "$i"; done
          fi
  
          # Now take care of the file that has no hard-link
          # We do decompress first to re-compress with the selected
          # compression ratio later on...
          case "$FILE" in
            *.bz2)
              bunzip2 $FILE
              FILE=`basename "$FILE" .bz2`
            ;;
            *.gz)
              gunzip $FILE
              FILE=`basename "$FILE" .gz`
            ;;
          esac
  
          # Compress the file with the given compression ratio, if needed
          case $COMP_SUF in
            *bz2)
              bzip2 ${COMP_LVL} "$FILE" && chmod 644 "${FILE}${COMP_SUF}"
              echo "Compressed $FILE" > $DEST_FD1
              ;;
            *gz)
              gzip ${COMP_LVL} "$FILE" && chmod 644 "${FILE}${COMP_SUF}"
              echo "Compressed $FILE" > $DEST_FD1
              ;;
            *)
              echo "Uncompressed $FILE" > $DEST_FD1
              ;;
          esac
  
          # If the file had hard-links, recreate those (either hard or soft)
          if [ -n "$HLINKS" ]; then
            for i in $HLINKS; do
              NEWFILE=`echo "$i" | sed s/\.gz$// | sed s/\.bz2$//`
              if [ "$LN_OPT" = "-S" ]; then
                # Make this hard-link a soft- one
                ln -s "${FILE}$COMP_SUF" "${NEWFILE}$COMP_SUF"
              else
                # Keep the hard-link a hard- one
                ln "${FILE}$COMP_SUF" "${NEWFILE}$COMP_SUF"
              fi
              chmod 644 "${NEWFILE}$COMP_SUF" # Really work only for hard-links. Harmless for soft-links
            done
          fi
  
        else
          # There is a problem when we get neither a symlink nor a plain file
          # Obviously, we shall never ever come here... :-(
          echo "Whaooo... \"${DIR}/${FILE}\" is neither a symlink nor a plain file. Please check:"
          ls -l "${DIR}/${FILE}"
          exit 1
        fi
      fi
    done # for FILE
  done # for DIR
  
  
  



More information about the alfs-log mailing list