|
From: Jeff S. <jsq...@us...> - 2004-03-07 22:30:47
|
Update of /cvsroot/env-switcher/env-switcher/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16744/src Modified Files: Makefile.am switcher.in switcher.tcl.in Log Message: Seems to have totally fixed bug 877263. New parsing scheme totally in place. Index: Makefile.am =================================================================== RCS file: /cvsroot/env-switcher/env-switcher/src/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Makefile.am 7 Mar 2004 21:18:09 -0000 1.3 --- Makefile.am 7 Mar 2004 22:06:54 -0000 1.4 *************** *** 22,27 **** mkdir -p $(DESTDIR)$(sysconfdir); \ fi ! if test ! -d $(DESTDIR)$(pkgdatadir); then \ ! mkdir -p $(DESTDIR)$(pkgdatadir); \ fi cp switcher.tcl $(DESTDIR)$(MODULEFILESDIR)/switcher/$(VERSION) --- 22,27 ---- mkdir -p $(DESTDIR)$(sysconfdir); \ fi ! if test ! -d $(DESTDIR)$(SWITCHER_PKGDATADIR); then \ ! mkdir -p $(DESTDIR)$(SWITCHER_PKGDATADIR); \ fi cp switcher.tcl $(DESTDIR)$(MODULEFILESDIR)/switcher/$(VERSION) Index: switcher.in =================================================================== RCS file: /cvsroot/env-switcher/env-switcher/src/switcher.in,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** switcher.in 7 Mar 2004 21:18:09 -0000 1.18 --- switcher.in 7 Mar 2004 22:06:55 -0000 1.19 *************** *** 22,26 **** my $prefix = "@prefix@"; my $system_filename = "@sysconfdir@/switcher.ini"; ! my $tag_dir = "@datadir@"; my $user_filename = $ENV{'HOME'} . "/.switcher.ini"; --- 22,26 ---- my $prefix = "@prefix@"; my $system_filename = "@sysconfdir@/switcher.ini"; ! my $tag_dir = "@SWITCHER_PKGDATADIR@"; my $user_filename = $ENV{'HOME'} . "/.switcher.ini"; *************** *** 420,431 **** sub list_names { ! my $dir = "$tag_dir/env-switcher/$clui_tag"; ! ! # Backwards compatability -- look in $tag_dir/$clui_tag as well. ! # Whoops. :-( ! ! if (! -d $dir) { ! $dir = "$tag_dir/$clui_tag"; ! } # Special case -- ignore the "global" tag --- 420,424 ---- sub list_names { ! my $dir = "$tag_dir/$clui_tag"; # Special case -- ignore the "global" tag *************** *** 529,533 **** # If it does, print a warning. If not, attempt to create it. ! my $dir = "$tag_dir/env-switcher/$clui_tag"; if (opendir DIR, $dir) { print_warning("Warning: tag directory already exists:\n" . --- 522,526 ---- # If it does, print a warning. If not, attempt to create it. ! my $dir = "$tag_dir/$clui_tag"; if (opendir DIR, $dir) { print_warning("Warning: tag directory already exists:\n" . *************** *** 566,578 **** # than implementing rm -rf. ! my $dir = "$tag_dir/env-switcher/$clui_tag"; ! ! # Backwards compatability; look in $tag_dir/$clui_tag if the ! # env-switcher/$clui_tag dir does not exist. Whoops... :-( ! ! if (! -d $dir) { ! my $dir = "$tag_dir/$clui_tag"; ! } ! if (! -w $dir || system("rm -rf $dir") != 0) { print_error("Unable to remove tag directory:\n" . --- 559,563 ---- # than implementing rm -rf. ! my $dir = "$tag_dir/$clui_tag"; if (! -w $dir || system("rm -rf $dir") != 0) { print_error("Unable to remove tag directory:\n" . *************** *** 613,617 **** sub add_name { my ($name, $src_dir) = @_; ! my $dir = "$tag_dir/env-switcher/$clui_tag"; my $dest_file = "$dir/$name"; my $src_file = "$src_dir/$name"; --- 598,602 ---- sub add_name { my ($name, $src_dir) = @_; ! my $dir = "$tag_dir/$clui_tag"; my $dest_file = "$dir/$name"; my $src_file = "$src_dir/$name"; *************** *** 699,712 **** sub rm_name { my ($name) = @_; ! my $dir = "$tag_dir/env-switcher/$clui_tag"; my $file = "$dir/$name"; - # Backwards compatability: use $tag_dir/$clui_tag if - # $tag_dir/env-switcher/$clui_tag does not exist. Whoops... - - if (! -d $dir) { - $dir = "$tag_dir/$clui_tag"; - } - # Does the name exist? --- 684,690 ---- sub rm_name { my ($name) = @_; ! my $dir = "$tag_dir/$clui_tag"; my $file = "$dir/$name"; # Does the name exist? *************** *** 998,1002 **** if ($want_default == 1 && $default_value && $default_value ne "none") { ! if (-f "$tag_dir/env-switcher/$clui_tag/$default_value") { print "$clui_tag/$default_value\n"; } --- 976,980 ---- if ($want_default == 1 && $default_value && $default_value ne "none") { ! if (-f "$tag_dir/$clui_tag/$default_value") { print "$clui_tag/$default_value\n"; } *************** *** 1006,1016 **** if ($want_announce && $default_value && $default_value ne "none") { ! if ($announce_load && ! (-f "$tag_dir/env-switcher/$clui_tag/$default_value" || ! -f "$tag_dir/$clui_tag/$default_value")) { ! print "echo switcher:$clui_tag: Loading $default_value;\n"; } elsif ($announce_warn && ! (! -f "$tag_dir/env-switcher/$clui_tag/$default_value" || ! ! -f "$tag_dir/$clui_tag/$default_value")) { print "echo switcher:$clui_tag: Cannot find modulefile for $default_value -- skipping;\n"; } --- 984,991 ---- if ($want_announce && $default_value && $default_value ne "none") { ! if ($announce_load &&-f "$tag_dir/$clui_tag/$default_value") { ! print "echo switcher:$clui_tag: Loading $default_value;\n"; } elsif ($announce_warn && ! ! -f "$tag_dir/$clui_tag/$default_value") { print "echo switcher:$clui_tag: Cannot find modulefile for $default_value -- skipping;\n"; } *************** *** 1218,1222 **** # switcher [--help|--more-help] # switcher --list ! # switcher --announce # switcher --show-exec (hidden command) # --- 1193,1197 ---- # switcher [--help|--more-help] # switcher --list ! # switcher --announce (hidden command) # switcher --show-exec (hidden command) # *************** *** 1335,1339 **** if ($a eq "--list" || $a eq "--add-tag" || $a eq "--rm-tag" || ! $a eq "--show" || $a eq "--show-exec") { push(@processed_argv, $a); ++$i; --- 1310,1314 ---- if ($a eq "--list" || $a eq "--add-tag" || $a eq "--rm-tag" || ! $a eq "--show" || $a eq "--show-exec" || $a eq "--announce") { push(@processed_argv, $a); ++$i; *************** *** 1487,1490 **** --- 1462,1466 ---- elsif ($a eq "--list") { $ret = list_names(); + ++$i; } Index: switcher.tcl.in =================================================================== RCS file: /cvsroot/env-switcher/env-switcher/src/switcher.tcl.in,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** switcher.tcl.in 15 Jan 2004 17:04:13 -0000 1.11 --- switcher.tcl.in 7 Mar 2004 22:06:55 -0000 1.12 *************** *** 14,18 **** puts stderr "\tThis module sets up the OSCAR switcher subsystem." puts stderr "\tIt adds the following path to the modules \"use\" path:" ! puts stderr "\t\t@SWITCHER_DATADIR@" puts stderr "\tIt also adds the following path to the path:" puts stderr "\t\t@SWITCHER_BINDIR@" --- 14,18 ---- puts stderr "\tThis module sets up the OSCAR switcher subsystem." puts stderr "\tIt adds the following path to the modules \"use\" path:" ! puts stderr "\t\t@SWITCHER_PKGDATADIR@" puts stderr "\tIt also adds the following path to the path:" puts stderr "\t\t@SWITCHER_BINDIR@" *************** *** 70,74 **** # the <name> modulefiles will be ! module use @SWITCHER_DATADIR@ # If we're not removing the module, call switcher to announce what --- 70,74 ---- # the <name> modulefiles will be ! module use @SWITCHER_PKGDATADIR@ # If we're not removing the module, call switcher to announce what |