Skip to content
Snippets Groups Projects
Commit 395d6fc3 authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

follow ss_resolve func change

parent 7765703e
No related branches found
No related tags found
No related merge requests found
......@@ -316,13 +316,19 @@ static int deps_src(stralloc *newsrc, char const *name, char const *tree, unsign
if (!stralloc_obreplace(newsrc, home.s)) retstralloc(0,"deps_src") ;
}
if (!ss_resolve_src(&tmpsrc,&sa,name,newsrc->s,&found))
r = ss_resolve_src(&tmpsrc,&sa,name,newsrc->s,&found) ;
if (r < 0) strerr_diefu2sys(111,"parse source directory: ",newsrc->s) ;
if (!r)
{
if (!stralloc_obreplace(newsrc, SS_SERVICE_SYSDIR)) retstralloc(0,"deps_src") ;
if (!ss_resolve_src(&tmpsrc,&sa,name,newsrc->s,&found))
r = ss_resolve_src(&tmpsrc,&sa,name,newsrc->s,&found) ;
if (r < 0) strerr_diefu2sys(111,"parse source directory: ",newsrc->s) ;
if (!r)
{
if (!stralloc_obreplace(newsrc, SS_SERVICE_PACKDIR)) retstralloc(0,"deps_src") ;
if (!ss_resolve_src(&tmpsrc,&sa,name,newsrc->s,&found))
r = ss_resolve_src(&tmpsrc,&sa,name,newsrc->s,&found) ;
if (r < 0) strerr_diefu2sys(111,"parse source directory: ",newsrc->s) ;
if (!r)
{
VERBO3 strerr_warnwu2sys("find dependency ",name) ;
err = 0 ;
......@@ -338,6 +344,7 @@ static int deps_src(stralloc *newsrc, char const *name, char const *tree, unsign
stralloc_free(&home) ;
return err ;
}
/** @Return 0 on fail
* @Return 1 on success
* @Return 2 service already added */
......
......@@ -52,19 +52,17 @@ int write_services(ssexec_t *info,sv_alltype *sv, char const *workdir, unsigned
char *name = keep.s+sv->cname.name ;
size_t namelen = strlen(name) ;
int type = sv->cname.itype ;
if (ss_resolve_check(info,name,SS_RESOLVE_LIVE))
{
ss_resolve_t res = RESOLVE_ZERO ;
stralloc sares = STRALLOC_ZERO ;
if (!ss_resolve_pointo(&sares,info,SS_NOTYPE,SS_RESOLVE_LIVE)) strerr_diefu1sys(111,"set revolve pointer to live") ;
if (!ss_resolve_read(&res,sares.s,name)) strerr_diefu2sys(111,"read resolve file of: ",name) ;
if (res.type != type) strerr_dief6x(111,"Detection of incompatible type format for: ",name," -- current: ",get_keybyid(type)," previous: ",get_keybyid(res.type)) ;
stralloc_free(&sares) ;
if (ss_resolve_check(workdir,name))
{
if (!ss_resolve_read(&res,workdir,name)) strerr_diefu2sys(111,"read resolve file of: ",name) ;
if (res.type != type) strerr_dief6x(111,"Detection of incompatible type format for: ",name," -- current: ",get_keybyid(type)," previous: ",get_keybyid(res.type)) ;
}
ss_resolve_free(&res) ;
}
size_t wnamelen ;
char wname[workdirlen + SS_SVC_LEN + SS_SRC_LEN + namelen + 1 + 1] ;
memcpy(wname,workdir,workdirlen) ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment