diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | mandrake_desk.spec | 15 | ||||
-rw-r--r-- | sbin/chksession | 29 |
3 files changed, 29 insertions, 22 deletions
@@ -1,3 +1,10 @@ +2000-07-11 Chmouel Boudjnah <chmouel@mandrakesoft.com> + + * sbin/chksession: make window-managers file dynamic by simple + entry in /etc/X11/wmsession.d/ + * sbin/convertsession: a new greatest hit. + * mandrake_desk.spec: %post with convertsession + 2000-05-29 dam's <damien@mandrakesoft.com> * corrected doc url in gnome desktop diff --git a/mandrake_desk.spec b/mandrake_desk.spec index fb3049f..f405e55 100644 --- a/mandrake_desk.spec +++ b/mandrake_desk.spec @@ -1,6 +1,6 @@ -%define release 22mdk +%define release 1mdk %define name mandrake_desk -%define version 1.0.3 +%define version 1.0.4 Summary: The Desktop configuration files for Linux Mandrake Name: %{name} @@ -28,8 +28,14 @@ rm -rf $RPM_BUILD_ROOT %install make install RPM_BUILD_ROOT=$RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/etc/X11/wmsession.d/ rm -f special/mandrake-small.xpm +%post +if [ -f /etc/X11/window-managers.rpmsave ];then + /usr/sbin/convertsession -f /etc/X11/window-managers.rpmsave || exit 0 +fi + %clean rm -rf $RPM_BUILD_ROOT @@ -37,6 +43,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root) %doc TRANSLATORS special/* README.CVS %config /etc/X11/window-managers +%dir /etc/X11/wmsession.d/ /usr/sbin/* /usr/bin/* /usr/share/icons/*.xpm @@ -54,6 +61,10 @@ rm -rf $RPM_BUILD_ROOT /usr/man/*/* %changelog +* Tue Jul 11 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 1.0.4-1mdk +- Add convertsession +- Make window-managers file dynamic and set them in /etc/X11/wmsession.d/. + * Mon May 29 2000 dam's <damien@mandrakesoft.com> 1.0.3-22mdk - corrected doc url on gnome-desktop diff --git a/sbin/chksession b/sbin/chksession index 77a067d..c21b034 100644 --- a/sbin/chksession +++ b/sbin/chksession @@ -17,7 +17,6 @@ Usage: $0 [OPTION]... -f=FILE, --file=FILE: Specify an alternarte config files other than /etc/X11/window-manager -x=ENTRY, --xsession=ENTRY: Product window-managers script of ENTRY. --r=ENTRY, --remove=ENTRY: remove an entry (product to stdin). -k, --kdm: Product window-managers list for kdm sessions. -g, --gdm: Product window-managers script for gdm sessions. -h, --help: Product this help. @@ -29,7 +28,7 @@ EOF sub parse_file { my $f=shift @_; open F, $f or die "Can't open $f\n"; - local $/ = "--@@--"; + local $/ = ""; while (<F>) { $n = $1 if /^NAME=(.*)/m; $e = $1 if /^EXEC=(.*)/m; @@ -40,17 +39,6 @@ sub parse_file { } } -sub remove_entry { - my $e = shift @_; - my $f = shift @_; - open F, $f or die "Can't open $f\n"; - local $/ = "--@@--"; - while (<F>) { - next if /^NAME=$e/m; - print; - } -} - usage(1) if @ARGV < 1; @@ -69,10 +57,8 @@ while ($ARGV[0] =~ /^--/ || $ARGV[0] =~ /^-/) { $kdm++; } elsif (/^--test/ || /^-t/) { $test++; - } elsif (/^--file=([^ ]+)/ || /^-f=([^ ]+)/) { - $file = $1; - } elsif (/^--remove=([^ ]+)/ || /^-r=([^ ]+)/) { - $remove=$1; + } elsif (/^--dir=([^ ]+)/ || /^-d=([^ ]+)/) { + $dir = $1; } elsif (/^--help/ || /^-h/ || /^-\?/) { usage(0); } else { @@ -81,9 +67,12 @@ while ($ARGV[0] =~ /^--/ || $ARGV[0] =~ /^-/) { } } -$file = $test ? './window-managers' : '/etc/X11/window-managers' unless $file; -die "$file don't exist\n" unless -r $file; -$remove ? remove_entry($remove, $file) : parse_file ($file); +$dir = $test ? './wmsession.d/' : '/etc/X11/wmsession.d/' unless $dir; +opendir D, $dir or die "Can't open $dir\n"; +for (readdir(D)) { + my $file = $_; + parse_file ("$dir/$file"); +} sub cat { my ($f) = @_; local *F; open F, $f; join '', <F> } my ($e) = cat("/etc/sysconfig/desktop") =~ /(\S+)/; |