PDA

View Full Version : how to use an outdated diff



scruff1963
13-04-2007, 05:10 PM
diffs are a pain in the butt as the cvs is updated regular they go out of date all to often.
to modify diffs is not hard but can be time consuming, here is a section from an out of date enigma diff file


diff -ur tuxbox-cvs.orig/apps/tuxbox/enigma/lib/dvb/dvb.cpp tuxbox-cvs/apps/tuxbox/enigma/lib/dvb/dvb.cpp
--- tuxbox-cvs.orig/apps/tuxbox/enigma/lib/dvb/dvb.cpp 2005-12-04 08:44:45.000000000 +0000
+++ tuxbox-cvs/apps/tuxbox/enigma/lib/dvb/dvb.cpp 2006-09-20 22:47:05.000000000 +0100
@@ -1000,7 +1000,7 @@
(i->first.getOriginalNetworkID() == onid) && // if service on this on
(i->first.getTransportStreamID() == tsid) && // and on this transponder (war das "first" hier wichtig?)
(i->first.getDVBNamespace() == dvbnamespace) && // and in this namespace
- (newServiceIds.find(i->first.getServiceID())==newServiceIds.end())) // but does not exist
+ (checkedServiceIds.find(i->first.getServiceID())==checkedServiceIds.end())) // but does not exist
{
for (std::map<int,eServiceReferenceDVB>::iterator m(channel_number.begin()); m != channel_number.end(); ++m)
if (i->first == m->second)
@@ -1103,7 +1103,7 @@
service.service_name=eString().sprintf("%d%c",
t->satellite.frequency/1000,
t->satellite.polarisation ? 'V' : 'H');
- service.service_provider=eString().sprintf("%d %d.%d%c",
+ service.service_provider=eString().sprintf("%d %d.%d%c",
t->satellite.frequency/1000,
abs(t->satellite.orbital_position)/10,
abs(t->satellite.orbital_position)%10,
if ( u != serviceLastUpdated.end() )

this tells you what file is to be patched


diff -ur tuxbox-cvs.orig/apps/tuxbox/enigma/lib/dvb/dvb.cpp tuxbox-cvs/apps/tuxbox/enigma/lib/dvb/dvb.cpp
--- tuxbox-cvs.orig/apps/tuxbox/enigma/lib/dvb/dvb.cpp 2005-12-04 08:44:45.000000000 +0000
+++ tuxbox-cvs/apps/tuxbox/enigma/lib/dvb/dvb.cpp 2006-09-20 22:47:05.000000000 +0100

this tells you the rough line numbers


@@ -1000,7 +1000,7 @@
[/code]
what the diff does is remove all the lines starting with a - and replace them with the + lines so if you looks for this line around 1007
[quote]
(i->first.getDVBNamespace() == dvbnamespace) && // and in this namespace

and underneath it you delete the line


- (newServiceIds.find(i->first.getServiceID())==newServiceIds.end())) // but does not exist

and replace it with


+ (checkedServiceIds.find(i->first.getServiceID())==checkedServiceIds.end())) // but does not exist

then remove the + so it looks like this


(checkedServiceIds.find(i->first.getServiceID())==checkedServiceIds.end())) // but does not exist

The complete section would look like this


diff -ur tuxbox-cvs.orig/apps/tuxbox/enigma/lib/dvb/dvb.cpp tuxbox-cvs/apps/tuxbox/enigma/lib/dvb/dvb.cpp
--- tuxbox-cvs.orig/apps/tuxbox/enigma/lib/dvb/dvb.cpp 2005-12-04 08:44:45.000000000 +0000
+++ tuxbox-cvs/apps/tuxbox/enigma/lib/dvb/dvb.cpp 2006-09-20 22:47:05.000000000 +0100
@@ -1000,7 +1000,7 @@
(i->first.getOriginalNetworkID() == onid) && // if service on this on
(i->first.getTransportStreamID() == tsid) && // and on this transponder (war das "first" hier wichtig?)
(i->first.getDVBNamespace() == dvbnamespace) && // and in this namespace
(checkedServiceIds.find(i->first.getServiceID())==checkedServiceIds.end())) // but does not exist
{
for (std::map<int,eServiceReferenceDVB>::iterator m(channel_number.begin()); m != channel_number.end(); ++m)
if (i->first == m->second)
@@ -1103,7 +1103,7 @@
service.service_name=eString().sprintf("%d%c",
t->satellite.frequency/1000,
t->satellite.polarisation ? 'V' : 'H');
service.service_provider=eString().sprintf("%d %d.%d%c",
t->satellite.frequency/1000,
abs(t->satellite.orbital_position)/10,
abs(t->satellite.orbital_position)%10,
if ( u != serviceLastUpdated.end() )

it is easy once you get the hang but very time consuming.
Update
Just noticed all the formatting has gone to pot but hopefully you get the rough idea :)

nitr8
13-04-2007, 06:17 PM
scruff use [quote instead of [code :) you keep your formating.

--me