Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Pinger modfication
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
jserink
Veteran
Veteran


Joined: 30 Jan 2004
Posts: 1008

PostPosted: Wed Aug 18, 2021 3:25 am    Post subject: Pinger modfication Reply with quote

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
View user's profile Send private message
xineg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Mar 2006
Posts: 115
Location: Australia.

PostPosted: Wed Aug 18, 2021 3:56 am    Post subject: Reply with quote

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
View user's profile Send private message
jserink
Veteran
Veteran


Joined: 30 Jan 2004
Posts: 1008

PostPosted: Wed Aug 18, 2021 4:23 am    Post subject: Reply with quote

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
View user's profile Send private message
xineg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Mar 2006
Posts: 115
Location: Australia.

PostPosted: Wed Aug 18, 2021 4:27 am    Post subject: Reply with quote

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
View user's profile Send private message
xineg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Mar 2006
Posts: 115
Location: Australia.

PostPosted: Wed Aug 18, 2021 4:34 am    Post subject: Reply with quote

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
View user's profile Send private message
xineg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Mar 2006
Posts: 115
Location: Australia.

PostPosted: Wed Aug 18, 2021 4:58 am    Post subject: Reply with quote

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
View user's profile Send private message
xineg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Mar 2006
Posts: 115
Location: Australia.

PostPosted: Wed Aug 18, 2021 1:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Wed Aug 18, 2021 3:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
xineg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Mar 2006
Posts: 115
Location: Australia.

PostPosted: Mon Aug 23, 2021 7:46 am    Post subject: Reply with quote

Hu
Are you doing any mentor work? Should I just contact recruits?
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3627

PostPosted: Mon Aug 23, 2021 9:46 am    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Mon Aug 23, 2021 6:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software 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