[arch-commits] Commit in lxdm/trunk (PKGBUILD git-fixes.patch)

Balló György bgyorgy at archlinux.org
Sun Nov 23 17:04:39 UTC 2014


    Date: Sunday, November 23, 2014 @ 18:04:39
  Author: bgyorgy
Revision: 123002

upgpkg: lxdm 0.5.0-3

Apply some fixes from git

Added:
  lxdm/trunk/git-fixes.patch
Modified:
  lxdm/trunk/PKGBUILD

-----------------+
 PKGBUILD        |    7 +-
 git-fixes.patch |  183 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 189 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-11-23 15:56:17 UTC (rev 123001)
+++ PKGBUILD	2014-11-23 17:04:39 UTC (rev 123002)
@@ -6,7 +6,7 @@
 
 pkgname=lxdm
 pkgver=0.5.0
-pkgrel=2
+pkgrel=3
 pkgdesc='Lightweight X11 Display Manager'
 arch=('i686' 'x86_64')
 url="https://sourceforge.net/projects/lxdm/"
@@ -22,10 +22,12 @@
         'etc/lxdm/PreLogin' 'etc/lxdm/LoginReady' 'etc/lxdm/PostLogin'
         'etc/lxdm/PostLogout' 'etc/lxdm/PreReboot' 'etc/lxdm/PreShutdown')
 source=(http://downloads.sourceforge.net/lxdm/$pkgname-$pkgver.tar.xz
+        git-fixes.patch
         default-config.patch
         lxdm.pam
         Xsession)
 md5sums=('a51686720e606ca456d7f56ae4159d1f'
+         '3463d9b886d9ee847cbbb23bc586a3d3'
          'f0ae6c072f151104c53a030fd7757821'
          'c941ef896248bc7c03901b513490425c'
          'd9c8f8c9e6de52dbc389696454c8f572')
@@ -33,6 +35,9 @@
 prepare(){
   cd "$srcdir/$pkgname-$pkgver"
 
+  # Apply some fixes from git
+  patch -Np1 -i ../git-fixes.patch
+
   # Adjust Arch-specific settings
   patch -Np1 -i ../default-config.patch
 

Added: git-fixes.patch
===================================================================
--- git-fixes.patch	                        (rev 0)
+++ git-fixes.patch	2014-11-23 17:04:39 UTC (rev 123002)
@@ -0,0 +1,183 @@
+diff --git a/src/lxcom.c b/src/lxcom.c
+index 9491cb2..397d1b5 100644
+--- a/src/lxcom.c
++++ b/src/lxcom.c
+@@ -183,7 +183,6 @@ static GString *lxcom_func(gpointer data,int uid,int pid,int argc,char **argv)
+ 	GSList *p,*n;
+ 	GString *res=NULL;
+ 	assert(argc>0 && argv!=NULL);
+-
+ 	do{
+ 	if(!strcmp(argv[0],"SIGNAL"))
+ 	{
+@@ -193,16 +192,18 @@ static GString *lxcom_func(gpointer data,int uid,int pid,int argc,char **argv)
+ 			int sig=atoi(argv[1]);
+ 			if(sig==SIGCHLD)
+ 			{
+-				for(p=child_watch_list;p!=NULL;p=n)
++				CHECK_SIGCHLD:
++				for(p=child_watch_list;p!=NULL;p=p->next)
+ 				{
+ 					ChildWatch *item=p->data;
+ 					int status;
+-					n=p->next;
+ 					if(waitpid(item->pid,&status,WNOHANG)>0)
+ 					{
+ 						child_watch_list=g_slist_delete_link(child_watch_list,p);
++						// item->func may change the child_watch_list
+ 						item->func(item->data,item->pid,status);
+ 						g_free(item);
++						goto CHECK_SIGCHLD;
+ 					}
+ 				}
+ 			}
+@@ -438,7 +439,7 @@ gboolean lxcom_send(const char *sock,const char *buf,char **res)
+ int lxcom_add_child_watch(int pid,void (*func)(void*,int,int),void *data)
+ {
+ 	ChildWatch *item;
+-	if(pid<0 || !func)
++	if(pid<=0 || !func)
+ 		return -1;
+ 	item=g_new(ChildWatch,1);
+ 	item->func=func;
+diff --git a/src/lxdm.c b/src/lxdm.c
+index 638c30f..62ac31d 100644
+--- a/src/lxdm.c
++++ b/src/lxdm.c
+@@ -669,7 +669,7 @@ static void xauth_write_file(const char *file,int dpy,char data[16])
+ 	gethostname(addr,sizeof(addr));
+ 	
+ 	fd=open(file,O_CREAT|O_TRUNC|O_WRONLY,0600);
+-	if(!fd==-1) return;
++	if(fd==-1) return;
+ 	xauth_write_uint16(fd,256);		//FamilyLocalHost
+ 	xauth_write_string(fd,addr);
+ 	xauth_write_string(fd,buf);
+@@ -1022,7 +1022,18 @@ static void on_session_stop(void *data,int pid, int status)
+ 	int level;
+ 	LXSession *s=data;
+ 
+-	lxsession_stop(s);
++	gchar *argv[] = { "/etc/lxdm/PostLogout", NULL };
++	g_spawn_async(NULL, argv, s->env, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
++
++	if(g_key_file_get_integer(config,"server","reset",NULL)!=1)
++	{
++		lxsession_stop(s);
++	}
++	else
++	{
++		lxsession_free(s);
++		s=NULL;
++	}
+ 
+ 	level=get_run_level();
+ 	if(level=='0' || level=='6')
+@@ -1034,22 +1045,19 @@ static void on_session_stop(void *data,int pid, int status)
+ 		g_message("run level %c\n",level);
+ 		lxdm_quit_self(0);
+ 	}
+-	if(s!=lxsession_greeter())
++	if(s && s!=lxsession_greeter())
+ 	{
+ 		lxsession_free(s);
+ 	}
+-	else if(g_key_file_get_integer(config,"server","reset",NULL)==1)
++	else if(!s)
+ 	{
+-		lxsession_free(s);
+ 		lxsession_greeter();
+ 	}
+-	gchar *argv[] = { "/etc/lxdm/PostLogout", NULL };
+-	g_spawn_async(NULL, argv, s->env, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
+ }
+ 
+-gboolean lxdm_get_session_info(char *session,char **pname,char **pexec)
++gboolean lxdm_get_session_info(const char *session,char **pname,char **pexec,char **pdesktop_names)
+ {
+-	char *name=NULL,*exec=NULL;
++	char *name=NULL,*exec=NULL,**names=NULL,*desktop_names=NULL;
+ 	if(!session || !session[0])
+ 	{
+ 		name=g_key_file_get_string(config, "base", "session", 0);
+@@ -1072,6 +1080,11 @@ gboolean lxdm_get_session_info(char *session,char **pname,char **pexec)
+ 			}
+ 			name=g_key_file_get_string(cfg,"Desktop Entry","Name",NULL);
+ 			exec=g_key_file_get_string(cfg,"Desktop Entry","Exec",NULL);
++			names = g_key_file_get_string_list (cfg, "Desktop Entry", "DesktopNames", NULL, NULL);
++			if (names != NULL) {
++				desktop_names = g_strjoinv (":", names);
++				g_strfreev (names);
++			}
+ 			g_key_file_free(cfg);
+ 			if(!name || !exec)
+ 			{
+@@ -1097,6 +1110,11 @@ gboolean lxdm_get_session_info(char *session,char **pname,char **pexec)
+ 			{
+ 				name = g_key_file_get_locale_string(f, "Desktop Entry", "Name", NULL, NULL);
+ 				exec = g_key_file_get_string(f, "Desktop Entry", "Exec", NULL);
++				names = g_key_file_get_string_list (f, "Desktop Entry", "DesktopNames", NULL, NULL);
++				if (names != NULL) {
++					desktop_names = g_strjoinv (":", names);
++					g_strfreev (names);
++				}
+ 			}
+ 			else
+ 			{
+@@ -1120,6 +1138,7 @@ gboolean lxdm_get_session_info(char *session,char **pname,char **pexec)
+ 	}
+ 	if(pname) *pname=name;
+ 	if(pexec) *pexec=exec;
++	if(pdesktop_names) *pdesktop_names=desktop_names;
+ 	return TRUE;
+ }
+ 
+@@ -1194,7 +1213,7 @@ static void lxdm_save_login(char *session,char *lang)
+ 
+ void lxdm_do_login(struct passwd *pw, char *session, char *lang, char *option)
+ {
+-	char *session_name=0,*session_exec=0;
++	char *session_name=0,*session_exec=0,*session_desktop_names=0;
+ 	gboolean alloc_session=FALSE,alloc_lang=FALSE;
+ 	int pid;
+ 	LXSession *s,*prev;
+@@ -1222,7 +1241,7 @@ void lxdm_do_login(struct passwd *pw, char *session, char *lang, char *option)
+ 		g_key_file_free(dmrc);
+ 	}
+ 
+-	if(!lxdm_get_session_info(session,&session_name,&session_exec))
++	if(!lxdm_get_session_info(session,&session_name,&session_exec,&session_desktop_names))
+ 	{
+ 		if(alloc_session)
+ 			g_free(session);
+@@ -1329,6 +1348,9 @@ void lxdm_do_login(struct passwd *pw, char *session, char *lang, char *option)
+ 		env=g_environ_setenv(env, "LC_MESSAGES", lang, TRUE);
+ 		env=g_environ_setenv(env, "LANGUAGE", lang, TRUE);
+ 	}
++
++	if( session_desktop_names && session_desktop_names[0] )
++		env=g_environ_setenv(env, "XDG_CURRENT_DESKTOP", session_desktop_names, TRUE);
+ 	
+ #ifndef DISABLE_XAUTH
+ 	env=create_client_auth(pw,env);
+@@ -1348,6 +1370,7 @@ void lxdm_do_login(struct passwd *pw, char *session, char *lang, char *option)
+ 	
+ 	g_free(session_name);
+ 	g_free(session_exec);
++	g_free(session_desktop_names);
+ 	if(alloc_session)
+ 		g_free(session);
+ 	if(alloc_lang)
+diff --git a/src/ui.c b/src/ui.c
+index f233589..efe02a1 100644
+--- a/src/ui.c
++++ b/src/ui.c
+@@ -145,7 +145,7 @@ static gboolean on_greeter_input(GIOChannel *source, GIOCondition condition, gpo
+ 	else if( !strncmp(str, "shutdown", 6) )
+ 		lxdm_do_shutdown();
+ 	else if( !strncmp(str, "log ", 4) )
+-		g_message(str + 4);
++		g_message("%s",str + 4);
+ 	else if( !strncmp(str, "login ", 6) )
+ 	{
+ 		char *user = greeter_param(str, "user");


More information about the arch-commits mailing list