On Monday 03 October 2005 13:39, Tres Melton wrote:
> I've coded the parts that 
> extract and parse the information from the /etc/{passwd,group} files
I think with this you're already out of portability. /etc/passwd structure in 
Linux and FreeBSD is different, and on Darwin the users part is completely 
another story. Take a look to enewuser/enewgroup functions on eutils eclass.

> find
This is mostly compatible a part a couple of commands (like -printf) and the 
fact that it *needs* that you give him a path to work on.

> ps
This is different from OS to OS, the Linux version is not portable. Have a 
look to pgrep, but that's not completely portable, too.

> tar
As long as you use the basic commands, it should be safe. You cannot ignore 
the format of the archive, tho, as just bsdtar and later GNU tars support 
that.

> gzip ? (or something else to compress things with)
That's just the same.

> Although Gentoo is my primary goal I want things to work on a
> minimal system of any flavor of *nix that has bash.
You'll probably have not to use directly the /etc/{passwd,group} files, as 
they are not universal. Every os uses its own ways to access those data, and 
things do not get better when adding pam as a variable in all this.

Take a look to egetent, egethome functions in eutils and portability eclass if 
you want to take a look to what is done now. That is still incomplete, 
though, so you will probably have other things to arrange...

You're wellcome to join gentoo-alt mailing list to discuss of portability in 
case :)

-- 
Diego "Flameeyes" Pettenò - http://dev.gentoo.org/~flameeyes/
Gentoo/ALT lead, Gentoo/FreeBSD, Video, AMD64, Sound, PAM, KDE

-- 
gentoo-dev@gentoo.org mailing list

Reply via email to