rpms/grip/EL-5 grip-3.2.0-lookup.patch,NONE,1.1

Adrian Reber (adrian) fedora-extras-commits at redhat.com
Mon Jul 28 07:15:30 UTC 2008


Author: adrian

Update of /cvs/extras/rpms/grip/EL-5
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv3556

Added Files:
	grip-3.2.0-lookup.patch 
Log Message:
* Sat Jul 26 2008 Adrian Reber <adrian at lisas.de> - 1:3.2.0-20
- fixed "Grip silently crahses on F8" (#456721)
  (converted non UTF-8 .po files to UTF-8)


grip-3.2.0-lookup.patch:

--- NEW FILE grip-3.2.0-lookup.patch ---
diff -ur grip-3.2.0/src/gripcfg.c grip-3.2.0.new/src/gripcfg.c
--- grip-3.2.0/src/gripcfg.c	2007-07-23 09:49:12.000000000 +0200
+++ grip-3.2.0.new/src/gripcfg.c	2007-07-23 09:50:46.000000000 +0200
@@ -62,13 +62,6 @@
 				      {"",""}
 };
 
-static CFGEntry encoder_cfg_entries[]={
-  {"name",CFG_ENTRY_STRING,256,NULL},
-  {"cmdline",CFG_ENTRY_STRING,256,NULL},
-  {"exe",CFG_ENTRY_STRING,256,NULL},
-  {"extension",CFG_ENTRY_STRING,10,NULL}
-};
-
 static void UseProxyChanged(GtkWidget *widget,gpointer data)
 {
   GripInfo *ginfo;
@@ -781,7 +774,7 @@
   };
 
 #ifdef CDPAR
-  if(ripcfg==0) return;
+  if(ripcfg==0) return TRUE;
 #endif
 
   sprintf(buf,"%s/%s-%s",getenv("HOME"),ginfo->config_filename,
@@ -825,6 +818,9 @@
 
   if(LoadEncoderConfig(ginfo,ginfo->selected_encoder)) {
     strcpy(buf,ginfo->mp3exename);
+    /* in addition to searching the path during rip and encode
+     * also do a path lookup of the executable during config switches */
+    FindExeInPath(ginfo->mp3exename, buf, sizeof(buf));
     gtk_entry_set_text(GTK_ENTRY(uinfo->mp3exename_entry),buf);
 
     strcpy(buf,ginfo->mp3cmdline);
diff -ur grip-3.2.0/src/rip.c grip-3.2.0.new/src/rip.c
--- grip-3.2.0/src/rip.c	2004-04-15 20:21:15.000000000 +0200
+++ grip-3.2.0.new/src/rip.c	2007-07-23 09:47:34.000000000 +0200
@@ -1100,8 +1100,6 @@
 {
   static char res[PATH_MAX];
   EncodeTrack *enc_track;
-  gchar *conv_str,*st;
-  gsize rb,wb;
 
   enc_track=(EncodeTrack *)data;
 
@@ -1250,12 +1248,17 @@
 {
   GripInfo *ginfo;
   gboolean result;
+  char buf[sizeof(ginfo->ripexename) > sizeof(ginfo->mp3exename) ? sizeof(ginfo->ripexename) : sizeof(ginfo->mp3exename)];
 
   ginfo=(GripInfo *)data;
 
   if(widget) ginfo->doencode=FALSE;
   else ginfo->doencode=TRUE;
 
+  /* Let's find the ripper in the path; this changes the config */
+  FindExeInPath(ginfo->ripexename, buf, sizeof(buf));
+  strncpy(ginfo->ripexename, buf, sizeof(ginfo->ripexename));
+
   if(!ginfo->using_builtin_cdp&&!FileExists(ginfo->ripexename)) {
     DisplayMsg(_("Invalid rip executable\nCheck your rip config"));
 
@@ -1263,6 +1266,9 @@
     return;
   }
 
+  /* the same for mp3exename */
+  FindExeInPath(ginfo->mp3exename, buf, sizeof(buf));
+  strncpy(ginfo->mp3exename, buf, sizeof(ginfo->mp3exename));
   if(ginfo->doencode&&!FileExists(ginfo->mp3exename)) {
     DisplayMsg(_("Invalid encoder executable\nCheck your encoder config"));
 
@@ -1504,8 +1510,9 @@
       ginfo->rippid=fork();
       
       if(ginfo->rippid==0) {
+	int i;
 	CloseStuff(ginfo);
-	nice(ginfo->ripnice);
+	i=nice(ginfo->ripnice);
 	execv(ginfo->ripexename,char_args);
 	
 	LogStatus(ginfo,_("Exec failed\n"));
@@ -1539,6 +1546,7 @@
   int paranoia_mode;
   int dup_output_fd;
   FILE *output_fp;
+  int i;
 
   ginfo=(GripInfo *)arg;
 
@@ -1559,7 +1567,7 @@
   
   ginfo->rip_smile_level=0;
   
-  nice(ginfo->ripnice);
+  i=nice(ginfo->ripnice);
 
   dup_output_fd=dup(GetStatusWindowPipe(ginfo->gui_info.rip_status_window));
   output_fp=fdopen(dup_output_fd,"w");
@@ -1742,9 +1750,10 @@
   ginfo->mp3pid[cpu]=fork();
   
   if(ginfo->mp3pid[cpu]==0) {
+    int i;
     CloseStuff(ginfo);
     setsid();
-    nice(ginfo->mp3nice);
+    i=nice(ginfo->mp3nice);
     execv(ginfo->mp3exename,char_args);
     _exit(0);
   }




More information about the fedora-extras-commits mailing list