CESNET / libyang

YANG data modeling language library
BSD 3-Clause "New" or "Revised" License
368 stars 292 forks source link

How to load a submodule from A directory, and main module with a same submodule in B directory. #906

Closed longjianglzt closed 5 years ago

longjianglzt commented 5 years ago

HI, I have two directorys, A directory may exist or not, submodule or deviation yang(eg. aaa-sub.yang) in this directory. B directory must exist and with main module(aaa.yang), and it's submodule(aaa-sub.yang) same with A directory's.How to load aaa-sub.yang if A directory exist but from B directory? Thanks.

michalvasko commented 5 years ago

Hi, this is not really the way the modules should be loaded. But, I believe you should be able to do this by setting dir B in the searchpath before dir A. Use this function or some of the later ones in the documentation to achieve this.

Regards, Michal

longjianglzt commented 5 years ago

Hi, this is not really the way the modules should be loaded. But, I believe you should be able to do this by setting dir B in the searchpath before dir A. Use this function or some of the later ones in the documentation to achieve this.

Regards, Michal

I main if A dir exists and aaa-sub.yang(diffrent from aaa-sub.yang in B dir) is modified, when load aaa.yang(it includes aaa-sub.yang) how could libyang find aaa-sub.yang from A dir but B. Whether libyang will load aaa-sub.yang from dir A If I set dir A to searchpath before dir B?

Thanks

longjianglzt commented 5 years ago

Hi, this is not really the way the modules should be loaded. But, I believe you should be able to do this by setting dir B in the searchpath before dir A. Use this function or some of the later ones in the documentation to achieve this. Regards, Michal

I main if A dir exists and aaa-sub.yang(diffrent from aaa-sub.yang in B dir) is modified, when load aaa.yang(it includes aaa-sub.yang) how could libyang find aaa-sub.yang from A dir but B. Whether libyang will load aaa-sub.yang from dir A If I set dir A to searchpath before dir B?

Thanks

I test the way to set dir B in the searchpath before dir A, it works, Thanks.