Ticket #256 (closed enhancement: fixed)

Opened 12 years ago

Last modified 12 years ago

Trim the cruft from cshrc dotfiles

Reported by: jdreed Owned by:
Priority: normal Milestone: Summer 2009 Deployment
Component: dotfiles Keywords:
Cc: Fixed in version:
Upstream bug:

Description

A while back, we decided that we should revert to upstream default settings for the shells. To that end, I propose the following changes:

diff -Naur /usr/lib/init/cshrc /usr/lib/init.new/cshrc
--- /usr/lib/init/cshrc	2009-05-20 01:11:11.000000000 -0400
+++ /usr/lib/init.new/cshrc	2009-05-20 11:43:31.000000000 -0400
@@ -112,14 +112,11 @@
 
   unalias extend sextend textend
 
-  if ((! $?NOCALLS) && (-r ~/.path)) then
-    # Support .path files for compatibility.
-    set athena_path=($path)
-    source ~/.path
-  else
-    # Standard Athena path additions.
-    set path=(`/usr/bin/athdir $HOME` $path .)
-  endif
+  # .path files are no longer supported, consult Athena documentation
+  # for the correct way to specify your PATH
+  
+  # Standard Athena path additions.
+  set path=(`/usr/bin/athdir $HOME` $path .)
 
 endif
 
@@ -135,10 +132,6 @@
 set noclobber			# Don't overwrite files with redirection
 
 if ($?prompt) then		# For interactive shells only (i.e., NOT rsh):
-  # Set prompt.
-  set promptchars="%#"
-  set prompt = "athena%# "
-  set cdpath = (~)
   set interactive		#   Provide shell variable for compatability
 endif
 

Change History

comment:1 Changed 12 years ago by jdreed

Do we want to nuke the *extend aliases too? I can't remember what we decided. We probably do.

Note that env_setup includes its own extend alias, so this will not affect lockers that use it.

comment:2 Changed 12 years ago by jdreed

Let's try this again. Note that this must get implemented at the same time as or after #153.

diff -Naur /usr/lib/init/cshrc /usr/lib/init.new/cshrc
--- /usr/lib/init/cshrc	2009-05-20 01:11:11.000000000 -0400
+++ /usr/lib/init.new/cshrc	2009-05-20 11:52:41.000000000 -0400
@@ -84,21 +84,10 @@
   endif
   unset x
 
-  # This "extend" alias and friends have been left in for backwards
-  # compatibility with old .environment files, just in case. The new
-  # add alias does not use them.
-  alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\
-  if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\
-  if ($?extendyes) setenv \!:1 ${\!:1}:\!:2 && \\
-  unset extendyes'
-  alias sextend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\
-  if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\
-  if ($?extendyes) set \!:1=(${\!:1} \!:2) && \\
-  unset extendyes'
-  alias textend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\
-  if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\
-  if ($?extendyes) set \!:1=${\!:1}:\!:2 && \\
-  unset extendyes'
+  # NOTE:
+  # The use of the "extend", "sextend", and "textend" aliases in
+  # ~/.environment is no longer supported.  Consult the Athena
+  # documentation on Dotfiles for supported dotfile operations
 
   # Run user environment customizations identified in your
   # ~/.environment file.  This is the place to include your own
@@ -110,16 +99,12 @@
 
   if ((! $?NOCALLS) && (-r ~/.environment)) source ~/.environment
 
-  unalias extend sextend textend
-
-  if ((! $?NOCALLS) && (-r ~/.path)) then
-    # Support .path files for compatibility.
-    set athena_path=($path)
-    source ~/.path
-  else
-    # Standard Athena path additions.
-    set path=(`/usr/bin/athdir $HOME` $path .)
-  endif
+  # NOTE:
+  # .path files are no longer supported, consult Athena documentation
+  # for the correct way to specify your PATH
+  
+  # Standard Athena path additions.
+  set path=(`/usr/bin/athdir $HOME` $path .)
 
 endif
 
@@ -135,10 +120,6 @@
 set noclobber			# Don't overwrite files with redirection
 
 if ($?prompt) then		# For interactive shells only (i.e., NOT rsh):
-  # Set prompt.
-  set promptchars="%#"
-  set prompt = "athena%# "
-  set cdpath = (~)
   set interactive		#   Provide shell variable for compatability
 endif
 

comment:3 Changed 12 years ago by broder

  • Status changed from new to proposed

Fixed in r23842, uploaded to proposed.

Other people should test that it doesn't break stuff before moving it to production.

comment:4 Changed 12 years ago by quentin

It looks like the Zephyr discussion never made it into this ticket. extend was punted months ago and put back because it causes problems for many users who have it in their dotfiles and are not clueful enough to fix it:

Class: debathena Instance: tcsh
Time: Fri Jun 27 14:07:34 2008 Host: vinegar-pot.mit.edu
From: Quentin Smith <quentin>

While we're on the subject of tcsh... can we put in the extend alias
like we did for the other tcsh-specific cshrc customizations?

Class: debathena Instance: tcsh
Time: Fri Jun 27 14:08:40 2008 Host: EQUAL-RITES.MIT.EDU
From: Even my henchmen think I'm crazy <ghudson>

Why?

Class: debathena Instance: tcsh
Time: Fri Jun 27 14:09:53 2008 Host: vinegar-pot.mit.edu
From: Quentin Smith <quentin>

because some people's dotfiles use it, and if we're trying to
maintain backwards compatibility with Athena 9.4's tcsh, it should
stay

Class: debathena Instance: tcsh
Time: Fri Jun 27 14:14:55 2008 Host: EQUAL-RITES.MIT.EDU
From: Even my henchmen think I'm crazy <ghudson>

Whose dotfiles use it?  It's a holdover from like 12 years
ago.

Class: debathena Instance: tcsh
Time: Fri Jun 27 14:49:12 2008 Host: vinegar-pot.mit.edu
From: Quentin Smith <quentin>

For example, every account that RSI has touched

Class: debathena Instance: tcsh
Time: Fri Jun 27 14:49:18 2008 Host: vinegar-pot.mit.edu
From: Quentin Smith <quentin>

They can't be the only user of it, though

Class: debathena Instance: tcsh
Time: Fri Jun 27 14:57:30 2008 Host: EQUAL-RITES.MIT.EDU
From: Even my henchmen think I'm crazy <ghudson>

I wouldn't be so quick to believe they aren't the only user
of it, but having an identified set of users gives me
justification to put the backward-compatibility cruft back
in.

Class: debathena Instance: tcsh
Time: Fri Jun 27 14:57:48 2008 Host: EQUAL-RITES.MIT.EDU
From: Even my henchmen think I'm crazy <ghudson>

(Particularly, users who have been victimized by dotfile
modification beyond their personal understanding.)

AFAICT, with extend gone, login sessions will fail because the user's dotfiles will error out.

comment:5 Changed 12 years ago by jdreed

The version in proposed works for me.

We should not restore extend at this point. While there is an identifiable community of users, it's also a small community, and I really want to take this opportunity to eliminate all the cruft in the interest of upstream compatibility. I will put a copy of the extend alias in the dotfiles locker and in the stock answers, for anyone who wants it. We will also provide some sort of "athrun consult fix-dotfiles" script.

comment:6 Changed 12 years ago by broder

  • Status changed from proposed to closed
  • Resolution set to fixed

Change moved to production.

Note: See TracTickets for help on using tickets.