Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Creazione patch per ebuild [RISOLTO]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
mrfree
Veteran
Veteran


Joined: 15 Mar 2003
Posts: 1303
Location: Europe.Italy.Sulmona

PostPosted: Fri Dec 24, 2004 11:24 am    Post subject: Creazione patch per ebuild [RISOLTO] Reply with quote

Da premettere che non sono un esperto sulla creazione di ebuild ;)

Ho deciso di modificare un'ebuild per aggiungere una mia micro-patch ma ho qualche problema

La patch l'ho creata nel seguente modo:
Code:
$ diff -aurN gai-temp-0.1.0 gai-temp-0.1.0.mrfree/

diff -aurN gai-temp-0.1.0/readtemp.h gai-temp-0.1.0.mrfree/readtemp.h
--- gai-temp-0.1.0/readtemp.h   2004-09-29 14:08:44.000000000 +0200
+++ gai-temp-0.1.0.mrfree/readtemp.h    2004-12-24 11:36:46.371056504 +0100
@@ -8,7 +8,7 @@
 #include <netinet/in.h>
 #include <netdb.h>

-#define ACPI_CPU_PATH "/proc/acpi/thermal_zone/THRM/temperature"
+#define ACPI_CPU_PATH "/proc/acpi/thermal_zone/THM0/temperature"

 #define DEV_PREFIX_ACPI_CPU "acpi_cpu"
 #define DEV_PREFIX_HDDTEMP  "hddtemp"

NOTA: Ovviamente ho reindirizzato l'output su un file ... mrTHM0.patch

Ho copiato tale file nella directory files dove si trova l'ebuild e ho creato una nuova versione dell'ebuild stessa con il suffisso -r1 aggiungento il codice che segue:
Code:
inherit eutils

src_unpack() {
        epatch ${FILESDIR}/mrTHM0.patch
}

come indicato nella documentazione per gli sviluppatori gentoo

Emergendo il pacchetto ottengo il seguente errore:
Code:
>>> emerge (1 of 1) x11-plugins/gai-temp-0.1.0-r1 to /
>>> md5 src_uri ;-) gai-temp-0.1.0.tar.gz
>>> Unpacking source...
 * Applying mrTHM0.patch ...

 * Failed Patch: mrTHM0.patch!
 *
 * Include in your bugreport the contents of:
 *
 *   /var/tmp/portage/gai-temp-0.1.0-r1/temp/mrTHM0.patch-26153.out


!!! ERROR: x11-plugins/gai-temp-0.1.0-r1 failed.
!!! Function epatch, Line 402, Exitcode 0
!!! Failed Patch: mrTHM0.patch!
!!! If you need support, post the topmost build error, NOT this status message.


Questo è il contenuto del file indicato nel messaggio di errore:
Code:
***** mrTHM0.patch *****

========================

PATCH COMMAND:  patch -p0 -g0 < /usr/local/portage/x11-plugins/gai-temp/files/mrTHM0.patch

========================
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN gai-temp-0.1.0/readtemp.h gai-temp-0.1.0.mrfree/readtemp.h
|--- gai-temp-0.1.0/readtemp.h  2004-09-29 14:08:44.000000000 +0200
|+++ gai-temp-0.1.0.mrfree/readtemp.h   2004-12-24 11:36:46.371056504 +0100
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
========================

PATCH COMMAND:  patch -p1 -g0 < /usr/local/portage/x11-plugins/gai-temp/files/mrTHM0.patch

========================
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN gai-temp-0.1.0/readtemp.h gai-temp-0.1.0.mrfree/readtemp.h
|--- gai-temp-0.1.0/readtemp.h  2004-09-29 14:08:44.000000000 +0200
|+++ gai-temp-0.1.0.mrfree/readtemp.h   2004-12-24 11:36:46.371056504 +0100
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
========================

PATCH COMMAND:  patch -p2 -g0 < /usr/local/portage/x11-plugins/gai-temp/files/mrTHM0.patch

========================
missing header for unified diff at line 4 of patch
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN gai-temp-0.1.0/readtemp.h gai-temp-0.1.0.mrfree/readtemp.h
|--- gai-temp-0.1.0/readtemp.h  2004-09-29 14:08:44.000000000 +0200
|+++ gai-temp-0.1.0.mrfree/readtemp.h   2004-12-24 11:36:46.371056504 +0100
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
========================

PATCH COMMAND:  patch -p3 -g0 < /usr/local/portage/x11-plugins/gai-temp/files/mrTHM0.patch

========================
missing header for unified diff at line 4 of patch
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN gai-temp-0.1.0/readtemp.h gai-temp-0.1.0.mrfree/readtemp.h
|--- gai-temp-0.1.0/readtemp.h  2004-09-29 14:08:44.000000000 +0200
|+++ gai-temp-0.1.0.mrfree/readtemp.h   2004-12-24 11:36:46.371056504 +0100
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
========================

PATCH COMMAND:  patch -p4 -g0 < /usr/local/portage/x11-plugins/gai-temp/files/mrTHM0.patch

========================
missing header for unified diff at line 4 of patch
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN gai-temp-0.1.0/readtemp.h gai-temp-0.1.0.mrfree/readtemp.h
|--- gai-temp-0.1.0/readtemp.h  2004-09-29 14:08:44.000000000 +0200
|+++ gai-temp-0.1.0.mrfree/readtemp.h   2004-12-24 11:36:46.371056504 +0100
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored


In pratica la directory gai-temp-0.1.0 contiene i sorgenti originali mentre gai-temp-0.1.0.mrfree quelli modificati da me, le opzioni che ho usato per diff dovrebbero essere giusto, le ho confrontate con altre patch nel portage e molte usano quest'approccio

Qualche idea?
_________________
Please EU, pimp my country!

ICE: /etc/init.d/iptables panic


Last edited by mrfree on Fri Dec 24, 2004 2:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
motaboy
Developer
Developer


Joined: 15 Dec 2003
Posts: 1483

PostPosted: Fri Dec 24, 2004 1:13 pm    Post subject: Reply with quote

Code:

inherit eutils
 
src_unpack() {
        epatch ${FILESDIR}/mrTHM0.patch
}


Ed il sorgente chi lo scompatta? Devi prima mettere qualcosa tipo

Code:

unpack ${A}

_________________
...
Back to top
View user's profile Send private message
mrfree
Veteran
Veteran


Joined: 15 Mar 2003
Posts: 1303
Location: Europe.Italy.Sulmona

PostPosted: Fri Dec 24, 2004 2:04 pm    Post subject: Reply with quote

Ops... :roll:

Adesso funziona, grazie ;)

Ma allora quando la funzione src_unpack() non è presente nell'ebuild emerge decoprime i sorgenti di default?
_________________
Please EU, pimp my country!

ICE: /etc/init.d/iptables panic
Back to top
View user's profile Send private message
motaboy
Developer
Developer


Joined: 15 Dec 2003
Posts: 1483

PostPosted: Fri Dec 24, 2004 3:51 pm    Post subject: Reply with quote

usa le funzioni di default presenti in ebuild.sh
_________________
...
Back to top
View user's profile Send private message
mrfree
Veteran
Veteran


Joined: 15 Mar 2003
Posts: 1303
Location: Europe.Italy.Sulmona

PostPosted: Fri Dec 24, 2004 4:30 pm    Post subject: Reply with quote

Ok grazie di nuovo, mi sa che appena ho un po di tempo una bella letta alla documentazione per gli sviluppatori mi ci vorrebbe ;)
_________________
Please EU, pimp my country!

ICE: /etc/init.d/iptables panic
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum