public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Howto patch ebuilds?
@ 2006-06-30  6:57 Leonardo
  2006-06-30  7:54 ` Neil Bothwick
  2006-06-30  8:06 ` Rumen Yotov
  0 siblings, 2 replies; 8+ messages in thread
From: Leonardo @ 2006-06-30  6:57 UTC (permalink / raw
  To: gentoo-user

Hi again,

I'm trying to apply a patch from gentoo bugzilla on a ebuild
that's in portage, but cannot find infos on how to do it.

Can anybody please tell me what should I do or wher to find the
necessary info?

Ciao and thanks again to everybody.

Leo

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Howto patch ebuilds?
  2006-06-30  6:57 [gentoo-user] Howto patch ebuilds? Leonardo
@ 2006-06-30  7:54 ` Neil Bothwick
  2006-06-30  8:06 ` Rumen Yotov
  1 sibling, 0 replies; 8+ messages in thread
From: Neil Bothwick @ 2006-06-30  7:54 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 643 bytes --]

On Thu, 29 Jun 2006 23:57:56 -0700 (PDT), Leonardo wrote:

> I'm trying to apply a patch from gentoo bugzilla on a ebuild
> that's in portage, but cannot find infos on how to do it.

If you are trying to patch the ebuild itself:

Download the patch file
cd to the directory containing the ewbuild
patch -p0 <patchfile

man patch explains this. When you modifiy an ebuild you have to generate
new digests; either "ebuild foo.ebuild digest" or use the --digest option
when emerging it. The latter is not advised when emerge is also installing
dependencies.


-- 
Neil Bothwick

OPERATOR ERROR: Nyah, Nyah, Nyah, Nyah, Nyah!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Howto patch ebuilds?
  2006-06-30  6:57 [gentoo-user] Howto patch ebuilds? Leonardo
  2006-06-30  7:54 ` Neil Bothwick
@ 2006-06-30  8:06 ` Rumen Yotov
  2006-06-30  8:44   ` Leonardo
  2006-06-30  9:17   ` Bo Ørsted Andresen
  1 sibling, 2 replies; 8+ messages in thread
From: Rumen Yotov @ 2006-06-30  8:06 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1330 bytes --]

Leonardo wrote:
> Hi again,
> 
> I'm trying to apply a patch from gentoo bugzilla on a ebuild
> that's in portage, but cannot find infos on how to do it.
> 
> Can anybody please tell me what should I do or wher to find the
> necessary info?
> 
> Ciao and thanks again to everybody.
> 
> Leo
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
Hi,
If you don't have portage-overlay configured:
#mkdir /usr/local/portage
#echo "PORTDIR_OVERLAY=/usr/local/portage" >> /etc/make.conf
...SKIP ABOVE... if PORTDIR_OVERLAY etc. already there
category=category package belongs to (e.g. sys-apps)
package=package-name (e.g. 'acl')
#mkdir /usr/local/portage/$category
#mkdir /usr/local/portage/$category/$package
#cp -arv /usr/portage/$category/$package/*
/usr/local/portage/$category/$package
copy "patch-name..." in /usr/local/portage/$category/$package/files
Edit /usr/local/portage/$category/$package/$package-version-rev.ebuild
adding in src_unpack() function:
epatch ${FILESDIR}/"patch-name..."
Save&exit
#ebuild
/usr/local/portage/$category/$package/$package-version-rev.ebuild digest
#emerge $category/$package -av
Hope i didn't screwed something so check it again (some things might be
made shorter though).
HTH.Rumen

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3493 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Howto patch ebuilds?
  2006-06-30  8:06 ` Rumen Yotov
@ 2006-06-30  8:44   ` Leonardo
  2006-06-30  9:30     ` Rumen Yotov
  2006-06-30  9:17   ` Bo Ørsted Andresen
  1 sibling, 1 reply; 8+ messages in thread
From: Leonardo @ 2006-06-30  8:44 UTC (permalink / raw
  To: gentoo-user

Thanks Rumen,
that was it; now I have problems applying the patch, but I think
I can figure it out.

Thanks to Neil too.

Ciao, Leo

--- Rumen Yotov <rumen@qrypto.org> wrote:
> Hi,
> If you don't have portage-overlay configured:
> #mkdir /usr/local/portage
> #echo "PORTDIR_OVERLAY=/usr/local/portage" >> /etc/make.conf
> ...SKIP ABOVE... if PORTDIR_OVERLAY etc. already there
> category=category package belongs to (e.g. sys-apps)
> package=package-name (e.g. 'acl')
> #mkdir /usr/local/portage/$category
> #mkdir /usr/local/portage/$category/$package
> #cp -arv /usr/portage/$category/$package/*
> /usr/local/portage/$category/$package
> copy "patch-name..." in
> /usr/local/portage/$category/$package/files
> Edit
>
/usr/local/portage/$category/$package/$package-version-rev.ebuild
> adding in src_unpack() function:
> epatch ${FILESDIR}/"patch-name..."
> Save&exit
> #ebuild
>
/usr/local/portage/$category/$package/$package-version-rev.ebuild
> digest
> #emerge $category/$package -av
> Hope i didn't screwed something so check it again (some things
> might be
> made shorter though).
> HTH.Rumen
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Howto patch ebuilds?
  2006-06-30  8:06 ` Rumen Yotov
  2006-06-30  8:44   ` Leonardo
@ 2006-06-30  9:17   ` Bo Ørsted Andresen
  1 sibling, 0 replies; 8+ messages in thread
From: Bo Ørsted Andresen @ 2006-06-30  9:17 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1377 bytes --]

On Friday 30 June 2006 10:06, Rumen Yotov wrote:
> Hope i didn't screwed something so check it again (some things might be
> made shorter though).

I have a neat little script for this:

######################################################
#!/bin/bash

# collect vars
ebuild=`equery which $1`
patch=$2
category=`echo ${ebuild} | awk -F/ '{cat=NF-2;print $cat}'`
package=`echo ${ebuild} | awk -F/ '{pkg=NF-1;print $pkg}'`
portagepath=`dirname ${ebuild}`
overlaypath=/usr/local/portage/${category}/${package}

# copy to overlay
mkdir -pv ${overlaypath}/local-files
cp -v ${ebuild} ${overlaypath}/
ln -sv ${portagepath}/files ${overlaypath}/files
cp -v ${patch} ${overlaypath}/local-files/

# print instructions - wait for acknowledgement - edit file
echo -e 'Insert:\n\tepatch ${FILESDIR/files/local-files}/'${patch}'\nin 
src_unpack{ }'
read
${EDITOR} ${overlaypath}/${ebuild##*/}

# digest ebuild
ebuild ${overlaypath}/${ebuild##*/} digest
######################################################

This only copies the newest ebuild and makes a symlink to the filesdir 
in /usr/portage so that patches in portage do not have to be copied... The 
first argument must be the name of the package in a format that `equery 
which` understands and the second argument must be the path to the patch that 
needs to be applied.

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Howto patch ebuilds?
  2006-06-30  8:44   ` Leonardo
@ 2006-06-30  9:30     ` Rumen Yotov
  2006-06-30  9:52       ` Leonardo
  0 siblings, 1 reply; 8+ messages in thread
From: Rumen Yotov @ 2006-06-30  9:30 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 2200 bytes --]

Leonardo wrote:
> Thanks Rumen,
> that was it; now I have problems applying the patch, but I think
> I can figure it out.
> 
> Thanks to Neil too.
> 
> Ciao, Leo
> 
> --- Rumen Yotov <rumen@qrypto.org> wrote:
>> Hi,
>> If you don't have portage-overlay configured:
>> #mkdir /usr/local/portage
>> #echo "PORTDIR_OVERLAY=/usr/local/portage" >> /etc/make.conf
>> ...SKIP ABOVE... if PORTDIR_OVERLAY etc. already there
>> category=category package belongs to (e.g. sys-apps)
>> package=package-name (e.g. 'acl')
>> #mkdir /usr/local/portage/$category
>> #mkdir /usr/local/portage/$category/$package
>> #cp -arv /usr/portage/$category/$package/*
>> /usr/local/portage/$category/$package
>> copy "patch-name..." in
>> /usr/local/portage/$category/$package/files
>> Edit
>>
> /usr/local/portage/$category/$package/$package-version-rev.ebuild
>> adding in src_unpack() function:
>> epatch ${FILESDIR}/"patch-name..."
>> Save&exit
>> #ebuild
>>
> /usr/local/portage/$category/$package/$package-version-rev.ebuild
>> digest
>> #emerge $category/$package -av
>> Hope i didn't screwed something so check it again (some things
>> might be
>> made shorter though).
>> HTH.Rumen
>>
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
Hi,
To trouble-shoot the patching process try the following:
1.Comment the "epatch ..." line in src_unpack();
#ebuild /usr/local/portage/$category/$package-version-rev.ebuild unpack
#cd /var/tmp/portage/$package-version-rev./work/$package-version-rev./
patch -pX[0|1|2] --dry-run -i /path/to/patch/file/file-patch
Watch for errors, if any.
If patching is successful run:
#ebuild /usr/local/portage/$category/$package-version-rev.ebuild compile
#ebuild /usr/local/portage/$category/$package-version-rev.ebuild install
#ebuild /usr/local/portage/$category/$package-version-rev.ebuild qmerge
#ebuild /usr/local/portage/$category/$package-version-rev.ebuild clean
Last one is optional (it just cleans the WORKDIR under /var/tmp/portage)
Replace "epatch ..." with patch...-optional(watch out for path issues).
PS: please don't top-post (preferred ML-policy).
HTH.Rumen

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3493 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Howto patch ebuilds?
  2006-06-30  9:30     ` Rumen Yotov
@ 2006-06-30  9:52       ` Leonardo
  2006-06-30 10:11         ` Bo Ørsted Andresen
  0 siblings, 1 reply; 8+ messages in thread
From: Leonardo @ 2006-06-30  9:52 UTC (permalink / raw
  To: gentoo-user

--- Rumen Yotov <rumen@qrypto.org> wrote:

> Hi,
> To trouble-shoot the patching process try the following:
> 1.Comment the "epatch ..." line in src_unpack();
> #ebuild
> /usr/local/portage/$category/$package-version-rev.ebuild
> unpack
> #cd
>
/var/tmp/portage/$package-version-rev./work/$package-version-rev./
> patch -pX[0|1|2] --dry-run -i /path/to/patch/file/file-patch
> Watch for errors, if any.
> If patching is successful run:
> #ebuild
> /usr/local/portage/$category/$package-version-rev.ebuild
> compile
> #ebuild
> /usr/local/portage/$category/$package-version-rev.ebuild
> install
> #ebuild
> /usr/local/portage/$category/$package-version-rev.ebuild
> qmerge
> #ebuild
> /usr/local/portage/$category/$package-version-rev.ebuild clean
> Last one is optional (it just cleans the WORKDIR under
> /var/tmp/portage)
> Replace "epatch ..." with patch...-optional(watch out for path
> issues).
> PS: please don't top-post (preferred ML-policy).
> HTH.Rumen
> 

Hi Rumen,

thanks, the patch was supposed to be applied to a previous
version of the ebuild; by masking and emerging the correct
version it worked.
Sorry for top-posting (I should have read the policy ;P )

Bo, thanks to you too.

Now please, stop it, is it possible that a such simple post
gives so much feedback!!?
No, kidding, thanks again, it's nice to get in contact with you
all.

Ciao, Leo

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Howto patch ebuilds?
  2006-06-30  9:52       ` Leonardo
@ 2006-06-30 10:11         ` Bo Ørsted Andresen
  0 siblings, 0 replies; 8+ messages in thread
From: Bo Ørsted Andresen @ 2006-06-30 10:11 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 735 bytes --]

On Friday 30 June 2006 11:52, Leonardo wrote:
> the patch was supposed to be applied to a previous
> version of the ebuild

note that these are allowed:

# equery which portage
/usr/local/portage/sys-apps/portage/portage-2.1.1_pre1-r5.ebuild
# equery which sys-apps/portage
/usr/local/portage/sys-apps/portage/portage-2.1.1_pre1-r5.ebuild
# equery which =sys-apps/portage-2.0*
/usr/portage/sys-apps/portage/portage-2.0.54-r2.ebuild
# equery which =sys-apps/portage-2.1
/usr/portage/sys-apps/portage/portage-2.1.ebuild
# equery which ~sys-apps/portage-2.1
/usr/portage/sys-apps/portage/portage-2.1-r1.ebuild

so the version of the ebuild can be specified like that for the script I gave 
too.. :)

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-06-30 10:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-30  6:57 [gentoo-user] Howto patch ebuilds? Leonardo
2006-06-30  7:54 ` Neil Bothwick
2006-06-30  8:06 ` Rumen Yotov
2006-06-30  8:44   ` Leonardo
2006-06-30  9:30     ` Rumen Yotov
2006-06-30  9:52       ` Leonardo
2006-06-30 10:11         ` Bo Ørsted Andresen
2006-06-30  9:17   ` Bo Ørsted Andresen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox