[Demudi-commits] r273 - in demudi-cfengine/trunk: chunks debian scripts

Free Ekanayaka free-guest@haydn.debian.org
Sun, 28 Nov 2004 06:38:11 -0700


Author: free-guest
Date: 2004-11-28 06:35:53 -0700 (Sun, 28 Nov 2004)
New Revision: 273

Modified:
   demudi-cfengine/trunk/chunks/bash-etc_bash.bashrc
   demudi-cfengine/trunk/debian/changelog
   demudi-cfengine/trunk/scripts/bash
Log:
  * Cleaner bash.bashrc editing

Modified: demudi-cfengine/trunk/chunks/bash-etc_bash.bashrc
===================================================================
--- demudi-cfengine/trunk/chunks/bash-etc_bash.bashrc	2004-11-28 12:55:47 UTC (rev 272)
+++ demudi-cfengine/trunk/chunks/bash-etc_bash.bashrc	2004-11-28 13:35:53 UTC (rev 273)
@@ -1,28 +1,23 @@
-    if [ $(whoami) = root ]; then
-    	MARK=\#
-    else
-    	MARK=\$
-    fi
-    
-    export PS1="\[\]\h \[\] \[\]\W \[\]$MARK\[\] "
-    export PS2="\[[[1m\]>\[[[0m\] "
-    export PS4="\[[[1m\]+\[[[0m\] "
-    
-    export LS_COLORS='no=00:fi=00:di=01;36:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:\
-    cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:\
-    *.com=01;32:*.btm=01;32:*.bat=01;32:*.tar=04;31:*.tgz=04;33:*.arj=04;33:\
-    *.taz=04;33:*.lzh=04;33:*.zip=04;33:*.z=04;33:*.Z=04;33:*.gz=04;33:*.deb=04;33:\
-    *.rpm=04;33:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.ps=01;32:\
-    *.pdf=01;32:*.wav=01;39:*.mp3=01;37:*.c=01;33:*.h=01;39:'
-    
-    eval `dircolors -b`
-    alias ls='ls --color=auto'
-    alias ll='ls -l'
-    alias la='ls -A'
-    alias l='ls -CF'
+if [ -f /usr/share/doc/bash/examples/startup-files/bashrc ]; then
+	. /usr/share/doc/bash/examples/startup-files/bashrc
+fi
 
-    export HISTSIZE=50000
+if [ "$PS1" ]; then
+	MARK=$(if [ $(id -u) -eq 0 ]; then echo \#; else echo \$; fi)
+	PS1="\[\]\u \[\]\w \[\]$MARK\[\] "
+fi
 
-    if [ -f /usr/share/doc/bash/examples/startup-files/bashrc ]; then
-        . /usr/share/doc/bash/examples/startup-files/bashrc
-    fi
+export LS_COLORS='no=00:fi=00:di=01;36:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:\
+cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:\
+*.com=01;32:*.btm=01;32:*.bat=01;32:*.tar=04;31:*.tgz=04;33:*.arj=04;33:\
+*.taz=04;33:*.lzh=04;33:*.zip=04;33:*.z=04;33:*.Z=04;33:*.gz=04;33:*.deb=04;33:\
+*.rpm=04;33:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.ps=01;32:\
+*.pdf=01;32:*.wav=01;39:*.mp3=01;37:*.c=01;33:*.h=01;39:'
+    
+eval `dircolors -b`
+alias ls='ls --color=auto'
+alias ll='ls -l'
+alias la='ls -A'
+alias l='ls -CF'
+
+export HISTSIZE=50000

Modified: demudi-cfengine/trunk/debian/changelog
===================================================================
--- demudi-cfengine/trunk/debian/changelog	2004-11-28 12:55:47 UTC (rev 272)
+++ demudi-cfengine/trunk/debian/changelog	2004-11-28 13:35:53 UTC (rev 273)
@@ -1,3 +1,9 @@
+demudi-cfengine (0.7) UNSTABLE; urgency=low
+
+  * Cleaner bash.bashrc editing
+
+ -- Free Ekanayaka <free@agnula.org>  Thu, 18 Nov 2004 22:52:04 +0100
+
 demudi-cfengine (0.6) unstable; urgency=low
 
   * Replaced demudi-base with demudi-cfengine in the marker comment

Modified: demudi-cfengine/trunk/scripts/bash
===================================================================
--- demudi-cfengine/trunk/scripts/bash	2004-11-28 12:55:47 UTC (rev 272)
+++ demudi-cfengine/trunk/scripts/bash	2004-11-28 13:35:53 UTC (rev 273)
@@ -1,22 +1,5 @@
 editfiles:
 
-#    { /etc/skel/.bash_profile
-#
-#	SetCommentStart "#"
-#
-#	BeginGroupIfNoLineContaining "# include .bashrc if it exists"
-#		Append "# include .bashrc if it exists"
-#		Append "#if [ -f ~/.bashrc ]; then"
-#		Append "#    . ~/.bashrc"
-#		Append "#fi"
-#	EndGroup
-#
-#	LocateLineMatching ".*include .bashrc if it exists"
-#	IncrementPointer "1"
-#	UnCommentNLines "3"
-#
-#    }
-
     { /etc/profile
 
 	SetCommentStart "#"
@@ -43,12 +26,7 @@
 
 	SetCommentStart "#"
 
-	#	
-	# We set our own propmt
 	#
-	CommentLinesStarting "    PS1="
-
-	#
 	# Set smart bash completition
 	# 
 	LocateLineMatching ".*enable bash completion in interactive shells.*"
@@ -57,21 +35,25 @@
 	IncrementPointer "-1"
 
 	#
+	# Delete the old hack if present
+	#
+#	LocateLineMatching "    $(begin)"
+#	DeleteToLineMatching "    $(end)"
+#	DeleteLinesMatching "    $(end)"
+
+	#
 	# Insert our chunk
 	#
-	BeginGroupIfNoLineContaining "    $(begin)"
-		LocateLineMatching "^fi$"
+	BeginGroupIfNoLineContaining "$(begin)"
+		Append "$(begin)"
+		Append "$(end)"
+		GotoLastLine
 		IncrementPointer "-1"
-		InsertLine ""
-		InsertLine "    $(begin)"
-		InsertLine "    $(end)"
-		IncrementPointer "-4"
 	EndGroup
 
-	LocateLineMatching "    $(begin)"
-		InsertLine "    $(comment)"
+	LocateLineMatching "$(begin)"
+		InsertLine "$(comment)"
 		InsertFile "$(chunks)/bash-etc_bash.bashrc"
 		IncrementPointer "1"
-	DeleteToLineMatching "    $(end)"
-
+	DeleteToLineMatching "$(end)"
     }