Shell pkg ${ABI} variable

Hello.

I'm curious how pkg determines ABI (if undefined). man 7 pkg states that
Default ABI is determined from /bin/sh
May you explain how exactly strings such as "freebsd:10:x86:64" are generated?

Thanks.
 
I thought it is something easier, but it uses libelf and other stuff unfamiliar to me. In pkg_elf.c the function pkg_get_myarch_elfparse(...)

C:
snprintf(dest, sz, "%s:%s", ei.osname, ei.strversion);

C:
default:
        snprintf(dest + strlen(dest), sz - strlen(dest), ":%s:%s",
            arch, wordsize_corres_str);
        break;

It is interesting that the mentioned string contains additional data for the different architectures.
 
Back
Top