Help with patch

William Muriithi william.muriithi-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Mon Dec 13 20:49:26 UTC 2010


Hello pals,


I am trying to install a cacti plug-in architecture and I am having
difficulties patching one file and wonder if someone can point me on
how to work on it manually

Essentially, after patch was done, I was left with 3 files for the
problematic patch

data_sources.php.orig
data_sources.php
data_sources.php.rej

I am assuming  data_sources.php is a new files with as some hunks seem
to have been applied successfully.

I run a diff between data_sources.php.orig and data_sources.php and it
looks as follows

[root at gmkdxfdl cacti]# diff data_sources.php data_sources.php.orig
47,48d46
< $ds_actions = api_plugin_hook_function('data_source_action_array',
$ds_actions);
<
407,408d404
< 		} else {
< 			api_plugin_hook_function('data_source_action_execute',
$_POST['drp_action']);
552,557d547
< 		}else{
< 			$save['drp_action'] = $_POST['drp_action'];
< 			$save['ds_list'] = $ds_list;
< 			$save['ds_array'] = (isset($ds_array)? $ds_array : array());
< 			api_plugin_hook_function('data_source_action_prepare', $save);
< 			$save_html = "<input type='button' value='Cancel'
onClick='window.history.back()'> <input type='submit'
value='Continue'>";
696,697d685
< 	api_plugin_hook('data_source_edit_top');
<
990,991d977
< 	api_plugin_hook('data_source_edit_bottom');
<
992a979
>


The reject file has the following contents:-

[root at gmkdxfdl cacti]# cat data_sources.php.rej
***************
*** 1310,1315 ****
  	$i = 0;
  	if (sizeof($data_sources) > 0) {
  		foreach ($data_sources as $data_source) {
  			$data_template_name =
((empty($data_source["data_template_name"])) ? "<em>None</em>" :
$data_source["data_template_name"]);
  			$data_input_name    = ((empty($data_source["data_input_name"])) ?
"<em>External</em>" : $data_source["data_input_name"]);
  			$poller_interval    =
((isset($poller_intervals[$data_source["local_data_id"]])) ?
$poller_intervals[$data_source["local_data_id"]] : 0);
--- 1323,1329 ----
  	$i = 0;
  	if (sizeof($data_sources) > 0) {
  		foreach ($data_sources as $data_source) {
+ 			$data_source = api_plugin_hook_function('data_sources_table',
$data_source);
  			$data_template_name =
((empty($data_source["data_template_name"])) ? "<em>None</em>" :
$data_source["data_template_name"]);
  			$data_input_name    = ((empty($data_source["data_input_name"])) ?
"<em>External</em>" : $data_source["data_input_name"]);
  			$poller_interval    =
((isset($poller_intervals[$data_source["local_data_id"]])) ?
$poller_intervals[$data_source["local_data_id"]] : 0);



How would one go about applying the rejected hunk to the
data_sources.php file now?  Is it possible?

William
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list