Jump to content
Forums in Read-Only Mode - Please use Reddit ×

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 New...