Jump to content
Read the Funtoo Newsletter: Summer 2023 ×

Split atom name to atom base and atom version


quantum

Recommended Posts

Hello together,

in my new project I am reading all ebuilds from a given path and then I would like to split the filename (string) that i found to its components: atom base and atom version.

For example:

/var/git/overlay/sys-apps/portage-2.1.4_rc1

I would like to get back

Atom base: portage

Atom version: 2.1.4_rc1

It would be even better if atom version will be split to "major.minor.micro" and "rc".

Thanks for your help

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...