View previous topic :: View next topic |
Author |
Message |
jserink Veteran
Joined: 30 Jan 2004 Posts: 1008
|
Posted: Wed Aug 18, 2021 3:25 am Post subject: Pinger modfication |
|
|
Hi All:
The pinger package, net-analyzer/pinger-0.33-r100, which I use for monitoring has a compiled hard limit of 100 hosts.
You need the change a constant in globals.h, MAX_HOSTS, which is what I want to do.
But then the ebuild will fail the manifest test.
How do I go about doing this and still allow it to build?
Cheers,
john |
|
Back to top |
|
|
xineg Tux's lil' helper
Joined: 14 Mar 2006 Posts: 115 Location: Australia.
|
Posted: Wed Aug 18, 2021 3:56 am Post subject: |
|
|
To fix this you really need to patch the program and sit it in the 'files' directory of the pinger ebuild, then rebuild the manifest. Specifically to rebuild the manifest go to the ebuilds directory and run the ebuild utility like this
Code: | # ebuild pinger-0.33-r100.ebuild manifest | You should probably create an overlay for your modified ebuild also. So all up copy the globals.h file and change the value, then diff it with the original globals.h to create a patch and sit the patch in the ebuilds 'files' directory. Then run the manifest and you should be good to go. If you need help with any of the details just comment back here.
Last edited by xineg on Wed Aug 18, 2021 4:26 am; edited 1 time in total |
|
Back to top |
|
|
jserink Veteran
Joined: 30 Jan 2004 Posts: 1008
|
Posted: Wed Aug 18, 2021 4:23 am Post subject: |
|
|
vaako wrote: | To fix this you really need to patch the program and sit it in the 'files' directory of the pinger ebuild, then rebuild the manifest. Specifically to rebuild the manifest go to the ebuilds directory and run the ebuild utility like this
Code: | # ebuild pinger-0.33-r100.ebuild manifest | You should probably create an overlay for your modified ebuild also. Y |
Problem is, when you do this is downloads a whole new pinger-0.33.tar.gz which means the edits I made are gone.
Cheers,
john |
|
Back to top |
|
|
xineg Tux's lil' helper
Joined: 14 Mar 2006 Posts: 115 Location: Australia.
|
Posted: Wed Aug 18, 2021 4:27 am Post subject: |
|
|
That's why you put a patch in the files directory so it will patch the globals.h after it downloads. Re read my post as I've changed it. |
|
Back to top |
|
|
xineg Tux's lil' helper
Joined: 14 Mar 2006 Posts: 115 Location: Australia.
|
Posted: Wed Aug 18, 2021 4:34 am Post subject: |
|
|
So all up unpack using ebuilds pinger-0.33-r100.eduild unpack then go to /var/tmp/portage etc to the pinger work directory and create a diff with your new globals.h and the old globals.h and call it something like globals.h-maxhosts.patch and put it in the files directory of the ebuilds. Then when it compiles it will automatically apply the patch to globals.h like magic sort of. If you get the diff right and run manifest it will build. |
|
Back to top |
|
|
xineg Tux's lil' helper
Joined: 14 Mar 2006 Posts: 115 Location: Australia.
|
Posted: Wed Aug 18, 2021 4:58 am Post subject: |
|
|
jserink
Follow this guide to create a patch that you will then put in the pinger files directory.
https://wiki.gentoo.org/wiki/Patches |
|
Back to top |
|
|
xineg Tux's lil' helper
Joined: 14 Mar 2006 Posts: 115 Location: Australia.
|
Posted: Wed Aug 18, 2021 1:09 pm Post subject: |
|
|
I created a patch called globals.h.maxhosts.patch and got the ebuild to apply it with the following
Code: | epatch "${FILESDIR}"/globals.h.maxhosts.patch |
inserted into the pinger.ebuild. The pinger ebuild already had another patch being applied the same way in the src_prepare().To test it just call the prepare function with the ebuild utility. |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21635
|
Posted: Wed Aug 18, 2021 3:39 pm Post subject: |
|
|
This would be a good opportunity to update the ebuild to an EAPI that guarantees support for user patches. After that, put the patch in the user patches area, and you will not need to modify the ebuild again.
Alternatively, although less desirable, you could use the Portage bashrc mechanism to run a shell fragment during the src_prepare phase and patch the header that way. That, too, would avoid needing to modify the ebuild. |
|
Back to top |
|
|
xineg Tux's lil' helper
Joined: 14 Mar 2006 Posts: 115 Location: Australia.
|
Posted: Mon Aug 23, 2021 7:46 am Post subject: |
|
|
Hu
Are you doing any mentor work? Should I just contact recruits? |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3627
|
Posted: Mon Aug 23, 2021 9:46 am Post subject: |
|
|
Arbeitslager, gulag & laogai are more real than ever, i.e. spreading everywhere nowadays.
Hoping Gentoo will remain all about choices for long...
Thks 4 ur attention, interest & support. _________________ USE="-* ..." in /etc/portage/make.conf here.
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. " |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21635
|
Posted: Mon Aug 23, 2021 6:16 pm Post subject: |
|
|
vaako wrote: | Hu
Are you doing any mentor work? Should I just contact recruits? | I don't follow. I'm happy to answer questions here. I'm not involved in the Gentoo mentoring or recruiting processes that lead to the enrollment of new Gentoo developers. |
|
Back to top |
|
|
|