Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 305125 Details for
Bug 442248
Add patches necessary for gnome-lirc-properties
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
lirc-g-l-p-support-3.patch
lirc-g-l-p-support-3.patch (text/plain), 14.60 KB, created by
Bastien Nocera
on 2008-05-12 13:39:21 UTC
(
hide
)
Description:
lirc-g-l-p-support-3.patch
Filename:
MIME Type:
Creator:
Bastien Nocera
Created:
2008-05-12 13:39:21 UTC
Size:
14.60 KB
patch
obsolete
>Index: 0001-Use-new-instead-of-conf-as-filename-suffix.patch >=================================================================== >RCS file: 0001-Use-new-instead-of-conf-as-filename-suffix.patch >diff -N 0001-Use-new-instead-of-conf-as-filename-suffix.patch >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ 0001-Use-new-instead-of-conf-as-filename-suffix.patch 11 May 2008 12:12:58 -0000 >@@ -0,0 +1,28 @@ >+From 3e45e512719feccaa16edfd208273bade4f724e4 Mon Sep 17 00:00:00 2001 >+From: Mathias Hasselmann <mathias@openismus.com> >+Date: Wed, 13 Feb 2008 21:16:09 +0100 >+Subject: Use '.new' instead of '.conf' as filename suffix in template mode, >+ and append that the suffix to 'filename_new' instead of 'filename', >+ to prevent a buffer overrun for 'argv[optind]'. >+ >+--- >+ daemons/irrecord.c | 3 ++- >+ 1 files changed, 2 insertions(+), 1 deletions(-) >+ >+diff --git a/daemons/irrecord.c b/daemons/irrecord.c >+index ea298e3..df03c7b 100644 >+--- a/daemons/irrecord.c >++++ b/daemons/irrecord.c >+@@ -364,7 +364,7 @@ int main(int argc,char **argv) >+ exit(EXIT_FAILURE); >+ } >+ strcpy(filename_new, filename); >+- strcat(filename_new, ".conf"); >++ strcat(filename_new,".new"); >+ filename = filename_new; >+ } >+ fout=fopen(filename,"w"); >+ if(fout==NULL) >+-- >+1.5.3.7 >+ >Index: 0002-Add-resume-switch-to-irrecord.patch >=================================================================== >RCS file: 0002-Add-resume-switch-to-irrecord.patch >diff -N 0002-Add-resume-switch-to-irrecord.patch >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ 0002-Add-resume-switch-to-irrecord.patch 11 May 2008 12:12:58 -0000 >@@ -0,0 +1,109 @@ >+From d5f3f9853d87c319c33ade71811c225db11855f7 Mon Sep 17 00:00:00 2001 >+From: Mathias Hasselmann <mathias@openismus.com> >+Date: Wed, 13 Feb 2008 21:23:43 +0100 >+Subject: Add --resume switch to irrecord. >+ >+This switch asks irrecord to take hardware parameters from the provided >+template file, instead of trying to interactively discover them. >+ >+This change is needed for gnome-lirc-properties to allow it having a >+self-contained key-code learning mode, that's consistent with >+gnome-keybinding-properties. >+ >+The 'remotes==NULL' check for LIRC_MODE_MODE2 seems to indicate, that its >+author had a similar behaviour in mind. Still I prefer having that switch, >+instead of silently switching to --resume behaviour when a templates file >+was found, for backwards compability and for being able to detect that >+feature. >+--- >+ daemons/irrecord.c | 17 ++++++++++++----- >+ 1 files changed, 12 insertions(+), 5 deletions(-) >+ >+diff --git a/daemons/irrecord.c b/daemons/irrecord.c >+index df03c7b..a2420a8 100644 >+--- a/daemons/irrecord.c >++++ b/daemons/irrecord.c >+@@ -192,6 +192,7 @@ int main(int argc,char **argv) >+ lirc_t min_remaining_gap, max_remaining_gap; >+ int force; >+ int retries; >++ int resume; >+ struct ir_remote *remotes=NULL; >+ char *device=NULL; >+ #ifdef DEBUG >+@@ -200,6 +201,7 @@ int main(int argc,char **argv) >+ >+ progname=argv[0]; >+ force=0; >++ resume=0; >+ hw_choose_driver(NULL); >+ while(1) >+ { >+@@ -211,6 +213,7 @@ int main(int argc,char **argv) >+ {"device",required_argument,NULL,'d'}, >+ {"driver",required_argument,NULL,'H'}, >+ {"force",no_argument,NULL,'f'}, >++ {"resume",no_argument,NULL,'r'}, >+ #ifdef DEBUG >+ {"pre",no_argument,NULL,'p'}, >+ {"post",no_argument,NULL,'P'}, >+@@ -221,9 +224,9 @@ int main(int argc,char **argv) >+ {0, 0, 0, 0} >+ }; >+ #ifdef DEBUG >+- c = getopt_long(argc,argv,"hvd:H:fpPtiT",long_options,NULL); >++ c = getopt_long(argc,argv,"hvd:H:frpPtiT",long_options,NULL); >+ #else >+- c = getopt_long(argc,argv,"hvd:H:f",long_options,NULL); >++ c = getopt_long(argc,argv,"hvd:H:fr",long_options,NULL); >+ #endif >+ if(c==-1) >+ break; >+@@ -234,6 +237,7 @@ int main(int argc,char **argv) >+ printf("\t -h --help\t\tdisplay this message\n"); >+ printf("\t -v --version\t\tdisplay version\n"); >+ printf("\t -f --force\t\tforce raw mode\n"); >++ printf("\t -r --resume\t\tcontinue recording\n"); >+ printf("\t -H --driver=driver\tuse given driver\n"); >+ printf("\t -d --device=device\tread from given device\n"); >+ exit(EXIT_SUCCESS); >+@@ -254,6 +258,9 @@ int main(int argc,char **argv) >+ case 'f': >+ force=1; >+ break; >++ case 'r': >++ resume=1; >++ break; >+ #ifdef DEBUG >+ case 'p': >+ get_pre=1; >+@@ -460,7 +467,7 @@ int main(int argc,char **argv) >+ switch(hw.rec_mode) >+ { >+ case LIRC_MODE_MODE2: >+- if(remotes==NULL && !get_lengths(&remote,force)) >++ if((!remotes || !resume) && !get_lengths(&remote,force)) >+ { >+ if(remote.gap==0) >+ { >+@@ -494,7 +501,7 @@ int main(int argc,char **argv) >+ case LIRC_MODE_LIRCCODE: >+ if(hw.rec_mode==LIRC_MODE_CODE) remote.bits=CHAR_BIT; >+ else remote.bits=hw.code_length; >+- if(!get_gap_length(&remote)) >++ if((!remotes || !resume) && !get_gap_length(&remote)) >+ { >+ fprintf(stderr,"%s: gap not found," >+ " can't continue\n",progname); >+@@ -767,7 +774,7 @@ int main(int argc,char **argv) >+ exit(EXIT_FAILURE); >+ } >+ >+- if(!has_toggle_bit_mask(remotes)) >++ if((!remotes || !resume) && !has_toggle_bit_mask(remotes)) >+ { >+ get_toggle_bit_mask(remotes); >+ } >+-- >+1.5.3.7 >+ >Index: lirc-include-3.patch >=================================================================== >RCS file: lirc-include-3.patch >diff -N lirc-include-3.patch >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ lirc-include-3.patch 11 May 2008 12:12:58 -0000 >@@ -0,0 +1,303 @@ >+--- config_file.c 2007/07/29 18:20:06 5.27 >++++ config_file.c 2008/05/09 18:40:59 5.28 >+@@ -20,6 +20,7 @@ >+ #include <stdio.h> >+ #include <stdlib.h> >+ #include <string.h> >++#include <libgen.h> >+ #include <sys/socket.h> >+ #include <sys/un.h> >+ #include <sys/stat.h> >+@@ -32,9 +33,14 @@ >+ #include "config_file.h" >+ >+ #define LINE_LEN 1024 >++#define MAX_INCLUDES 10 >+ >+-int line; >+-int parse_error; >++const char *whitespace = " \t"; >++ >++static int line; >++static int parse_error; >++ >++static struct ir_remote * read_config_recursive(FILE *f, const char *name, int depth); >+ >+ void **init_void_array(struct void_array *ar,size_t chunk_size, size_t item_size) >+ { >+@@ -643,7 +649,84 @@ >+ return top; >+ } >+ >+-struct ir_remote * read_config(FILE *f) >++static const char *lirc_parse_include(char *s) >++{ >++ char *last; >++ size_t len; >++ >++ len=strlen(s); >++ if(len<2) >++ { >++ return NULL; >++ } >++ last = s+len-1; >++ while(last > s && strchr(whitespace, *last) != NULL) >++ { >++ last--; >++ } >++ if(last <= s) >++ { >++ return NULL; >++ } >++ if(*s!='"' && *s!='<') >++ { >++ return NULL; >++ } >++ if(*s=='"' && *last!='"') >++ { >++ return NULL; >++ } >++ else if(*s=='<' && *last!='>') >++ { >++ return NULL; >++ } >++ *last = 0; >++ memmove(s, s+1, len-2+1); /* terminating 0 is copied, and >++ maybe more, but we don't care */ >++ return s; >++} >++ >++static const char *lirc_parse_relative(char *dst, size_t dst_size, >++ const char *child, const char *current) >++{ >++ char *dir; >++ size_t dirlen; >++ >++ if (!current) >++ return child; >++ >++ /* Not a relative path */ >++ if (*child == '/') >++ return child; >++ >++ if(strlen(current) >= dst_size) >++ { >++ return NULL; >++ } >++ strcpy(dst, current); >++ dir = dirname(dst); >++ dirlen = strlen(dir); >++ if(dir != dst) >++ { >++ memmove(dst, dir, dirlen + 1); >++ } >++ >++ if(dirlen + 1 + strlen(child) + 1 > dst_size) >++ { >++ return NULL; >++ } >++ strcat(dst, "/"); >++ strcat(dst, child); >++ >++ return dst; >++} >++ >++struct ir_remote * read_config(FILE *f, const char *name) >++{ >++ return read_config_recursive(f, name, 0); >++} >++ >++static struct ir_remote * read_config_recursive(FILE *f, const char *name, int depth) >+ { >+ char buf[LINE_LEN+1], *key, *val, *val2; >+ int len,argc; >+@@ -656,6 +739,7 @@ >+ >+ line=0; >+ parse_error=0; >++ LOGPRINTF(2, "parsing '%s'", name); >+ >+ while(fgets(buf,LINE_LEN,f)!=NULL) >+ { >+@@ -683,14 +767,74 @@ >+ if(buf[0]=='#'){ >+ continue; >+ } >+- key=strtok(buf," \t"); >++ key=strtok(buf, whitespace); >+ /* ignore empty lines */ >+ if(key==NULL) continue; >+- val=strtok(NULL, " \t"); >++ val=strtok(NULL, whitespace); >+ if(val!=NULL){ >+- val2=strtok(NULL, " \t"); >++ val2=strtok(NULL, whitespace); >+ LOGPRINTF(3,"\"%s\" \"%s\"",key,val); >+- if (strcasecmp("begin",key)==0){ >++ if (strcasecmp("include",key)==0){ >++ FILE* childFile; >++ const char *childName; >++ const char *fullPath; >++ char result[FILENAME_MAX+1]; >++ >++ >++ if (depth > MAX_INCLUDES) { >++ logprintf(LOG_ERR,"error opening child file defined at %s:%d",name,line); >++ logprintf(LOG_ERR,"too many files included"); >++ parse_error=-1; >++ break; >++ } >++ >++ childName = lirc_parse_include(val); >++ if (!childName){ >++ logprintf(LOG_ERR,"error parsing child file value defined at line %d:",line); >++ logprintf(LOG_ERR,"invalid quoting"); >++ parse_error=-1; >++ break; >++ } >++ >++ fullPath = lirc_parse_relative(result, sizeof(result), childName, name); >++ if (!fullPath) { >++ logprintf(LOG_ERR,"error composing relative file path defined at line %d:",line); >++ logprintf(LOG_ERR,"resulting path too long"); >++ parse_error=-1; >++ break; >++ } >++ >++ childFile = fopen(fullPath, "r"); >++ if (childFile == NULL){ >++ logprintf(LOG_ERR,"error opening child file '%s' defined at line %d:",fullPath, line); >++ logprintf(LOG_ERR,"ignoring this child file for now."); >++ } >++ else{ >++ int save_line = line; >++ >++ if (!top_rem){ >++ /* create first remote */ >++ LOGPRINTF(2,"creating first remote"); >++ rem = read_config_recursive(childFile, fullPath, depth + 1); >++ if(rem != (void *) -1 && rem != NULL) { >++ top_rem = rem; >++ } else { >++ rem = NULL; >++ } >++ }else{ >++ /* create new remote */ >++ LOGPRINTF(2,"creating next remote"); >++ rem->next=read_config_recursive(childFile, fullPath, depth + 1); >++ if(rem->next != (void *) -1 && rem->next != NULL) { >++ rem=rem->next; >++ } else { >++ rem->next = NULL; >++ } >++ } >++ fclose(childFile); >++ line = save_line; >++ } >++ }else if (strcasecmp("begin",key)==0){ >+ if (strcasecmp("codes", val)==0){ >+ /* init codes mode */ >+ LOGPRINTF(2," begin codes"); >+@@ -744,7 +888,7 @@ >+ >+ if(val2[0]=='#') break; /* comment */ >+ node=defineNode(code, val2); >+- val2=strtok(NULL, " \t"); >++ val2=strtok(NULL, whitespace); >+ } >+ code->current=NULL; >+ add_void_array(&codes_list, code); >+@@ -822,7 +966,7 @@ >+ >+ if(val2[0]=='#') break; /* comment */ >+ node=defineNode(code, val2); >+- val2=strtok(NULL, " \t"); >++ val2=strtok(NULL, whitespace); >+ } >+ code->current=NULL; >+ add_void_array(&codes_list, code); >+@@ -842,7 +986,7 @@ >+ case ID_remote: >+ argc=defineRemote(key, val, val2, rem); >+ if(!parse_error && ((argc==1 && val2!=NULL) || >+- (argc==2 && val2!=NULL && strtok(NULL," \t")!=NULL))) >++ (argc==2 && val2!=NULL && strtok(NULL, whitespace)!=NULL))) >+ { >+ logprintf(LOG_WARNING,"garbage after '%s'" >+ " token in line %d ignored", >+@@ -857,7 +1001,7 @@ >+ >+ if(val2[0]=='#') break; /* comment */ >+ node=defineNode(code, val2); >+- val2=strtok(NULL, " \t"); >++ val2=strtok(NULL, whitespace); >+ } >+ code->current=NULL; >+ add_void_array(&codes_list, code); >+@@ -905,7 +1049,7 @@ >+ break; >+ } >+ } >+- while ((val=strtok(NULL," \t"))){ >++ while ((val=strtok(NULL, whitespace))){ >+ if (!addSignal(&signals, val)) break; >+ } >+ } >+@@ -950,7 +1094,15 @@ >+ } >+ } >+ if (parse_error){ >++ static int print_error = 1; >++ >++ if(print_error) { >++ logprintf(LOG_ERR, "reading of file '%s' failed", >++ name); >++ print_error = 0; >++ } >+ free_config(top_rem); >++ if(depth == 0) print_error = 1; >+ return((void *) -1); >+ } >+ /* kick reverse flag */ >+--- config_file.h 2006/01/28 18:36:44 5.10 >++++ config_file.h 2008/05/09 18:40:59 5.11 >+@@ -86,7 +86,7 @@ >+ struct ir_ncode * defineCode(char *key, char *val, struct ir_ncode *code); >+ struct ir_code_node *defineNode(struct ir_ncode *code, const char *val); >+ int defineRemote(char * key, char * val, char *val2, struct ir_remote *rem); >+-struct ir_remote *read_config(FILE *f); >++struct ir_remote *read_config(FILE *f, const char *name); >+ void free_config(struct ir_remote *remotes); >+ >+ #endif >+--- irrecord.c 2008/05/04 18:30:39 5.70 >++++ irrecord.c 2008/05/09 18:40:59 5.71 >+@@ -312,7 +312,7 @@ >+ progname, filename, progname); >+ exit(EXIT_FAILURE); >+ } >+- remotes=read_config(fin); >++ remotes=read_config(fin, filename); >+ fclose(fin); >+ if(remotes==(void *) -1 || remotes==NULL) >+ { >+@@ -754,7 +754,7 @@ >+ if(hw.deinit_func) hw.deinit_func(); >+ exit(EXIT_FAILURE); >+ } >+- remotes=read_config(fin); >++ remotes=read_config(fin,filename); >+ fclose(fin); >+ if(remotes==NULL) >+ { >+--- lircd.c 2008/03/30 14:53:06 5.76 >++++ lircd.c 2008/05/09 18:40:59 5.77 >+@@ -406,7 +406,7 @@ >+ logperror(LOG_ERR,NULL); >+ return; >+ } >+- config_remotes=read_config(fd); >++ config_remotes=read_config(fd, configfile); >+ fclose(fd); >+ if(config_remotes==(void *) -1) >+ { >Index: lirc.spec >=================================================================== >RCS file: /cvs/pkgs/rpms/lirc/devel/lirc.spec,v >retrieving revision 1.31 >diff -u -p -u -p -r1.31 lirc.spec >--- lirc.spec 4 May 2008 18:08:35 -0000 1.31 >+++ lirc.spec 11 May 2008 12:12:58 -0000 >@@ -18,7 +18,7 @@ > > Name: lirc > Version: 0.8.3 >-Release: 1%{?pre:.%{pre}}%{?dist} >+Release: 2%{?pre:.%{pre}}%{?dist} > Summary: The Linux Infrared Remote Control package > > Group: System Environment/Daemons >@@ -30,6 +30,11 @@ Source1: %{name}.init > Source2: %{name}.sysconfig > BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) > >+Patch0: http://svn.gnome.org/svn/gnome-lirc-properties/trunk/patches/0001-Use-new-instead-of-conf-as-filename-suffix.patch >+Patch1: http://svn.gnome.org/svn/gnome-lirc-properties/trunk/patches/0002-Add-resume-switch-to-irrecord.patch >+# Upstream patch >+Patch2: lirc-include-3.patch >+ > BuildRequires: %{__perl} > BuildRequires: libusb-devel > %if %{with alsa} >@@ -97,6 +102,11 @@ documentation and a collection of remote > > %prep > %setup -q -n %{name}-%{version}%{?pre} >+%patch0 -p1 -b .conf-suffix >+%patch1 -p1 -b .resume >+pushd daemons/ >+%patch2 -p0 -b .include >+popd > > chmod 644 contrib/* > >@@ -233,6 +243,9 @@ fi > > > %changelog >+* Sun May 11 2008 - Bastien Nocera <bnocera@redhat.com> - 0.8.3-2 >+- Add patches necessary for gnome-lirc-properties (#442248) >+ > * Sun May 04 2008 Jarod Wilson <jwilson@redhat.com> - 0.8.3-1 > - Update to 0.8.3 release >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 442248
:
302325
|
305060
|
305125
|
305285
|
305286