Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
6
66
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eric Vidal
66
Commits
ca8c6ac0
Commit
ca8c6ac0
authored
1 year ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
removes service of a module if it not present in new configuration of the module
parent
a213eca8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lib66/module/parse_module.c
+4
-4
4 additions, 4 deletions
src/lib66/module/parse_module.c
src/lib66/parse/parse_db_migrate.c
+80
-1
80 additions, 1 deletion
src/lib66/parse/parse_db_migrate.c
with
84 additions
and
5 deletions
src/lib66/module/parse_module.c
+
4
−
4
View file @
ca8c6ac0
...
...
@@ -314,6 +314,10 @@ void parse_module(resolve_service_t *res, resolve_service_t *ares, unsigned int
}
/** append the module name at each inner depends/requiredby dependencies service name
* and define contents field.*/
parse_rename_interdependences
(
res
,
name
,
ares
,
areslen
)
;
/** Remove the module name from requiredby field
* of the dependencies if the service disappears with the
* fresh parse process.
...
...
@@ -333,10 +337,6 @@ void parse_module(resolve_service_t *res, resolve_service_t *ares, unsigned int
* compare it with the new one.*/
parse_db_migrate
(
res
,
info
)
;
/** append the module name at each inner depends/requiredby dependencies service name
* and define contents field.*/
parse_rename_interdependences
(
res
,
name
,
ares
,
areslen
)
;
free
(
wres
)
;
stralloc_free
(
&
list
)
;
}
This diff is collapsed.
Click to expand it.
src/lib66/parse/parse_db_migrate.c
+
80
−
1
View file @
ca8c6ac0
...
...
@@ -12,11 +12,87 @@
* except according to the terms contained in the LICENSE file./
*/
#include
<stdint.h>
#include
<oblibs/log.h>
#include
<oblibs/stack.h>
#include
<oblibs/string.h>
#include
<66/service.h>
#include
<66/resolve.h>
#include
<66/ssexec.h>
#include
<66/tree.h>
#include
<66/constants.h>
static
void
service_db_tree
(
resolve_service_t
*
old
,
resolve_service_t
*
new
,
ssexec_t
*
info
)
{
log_flow
()
;
char
*
ocontents
=
old
->
sa
.
s
+
old
->
dependencies
.
contents
;
char
*
ncontents
=
new
->
sa
.
s
+
new
->
dependencies
.
contents
;
size_t
pos
=
0
,
olen
=
strlen
(
ocontents
)
;
_init_stack_
(
sremove
,
olen
+
1
)
;
{
_init_stack_
(
sold
,
olen
+
1
)
;
if
(
!
stack_convert_string_g
(
&
sold
,
ocontents
))
log_dieusys
(
LOG_EXIT_SYS
,
"convert string"
)
;
{
size_t
nlen
=
strlen
(
ncontents
)
;
_init_stack_
(
snew
,
nlen
+
1
)
;
if
(
!
stack_convert_string_g
(
&
snew
,
ncontents
))
log_dieusys
(
LOG_EXIT_SYS
,
"convert string"
)
;
FOREACH_STK
(
&
sold
,
pos
)
{
if
(
stack_retrieve_element
(
&
snew
,
sold
.
s
+
pos
)
<
0
)
{
if
(
!
stack_add_g
(
&
sremove
,
sold
.
s
+
pos
))
log_dieu
(
LOG_EXIT_SYS
,
"add string"
)
;
}
}
}
}
if
(
sremove
.
len
)
{
unsigned
int
m
=
0
;
int
nargc
=
3
+
sremove
.
count
;
char
const
*
prog
=
PROG
;
char
const
*
newargv
[
nargc
]
;
char
const
*
help
=
info
->
help
;
char
const
*
usage
=
info
->
usage
;
info
->
help
=
help_remove
;
info
->
usage
=
usage_remove
;
newargv
[
m
++
]
=
"remove"
;
newargv
[
m
++
]
=
"-P"
;
pos
=
0
;
FOREACH_STK
(
&
sremove
,
pos
)
{
char
*
name
=
sremove
.
s
+
pos
;
if
(
get_rstrlen_until
(
name
,
SS_LOG_SUFFIX
)
<
0
)
newargv
[
m
++
]
=
name
;
}
newargv
[
m
]
=
0
;
PROG
=
"remove"
;
int
e
=
ssexec_remove
(
m
,
newargv
,
info
)
;
PROG
=
prog
;
info
->
help
=
help
;
info
->
usage
=
usage
;
if
(
e
)
log_dieu
(
LOG_EXIT_SYS
,
"unable to remove selection from module: "
,
new
->
sa
.
s
+
new
->
name
)
;
}
}
void
parse_db_migrate
(
resolve_service_t
*
res
,
ssexec_t
*
info
)
{
...
...
@@ -42,6 +118,9 @@ void parse_db_migrate(resolve_service_t *res, ssexec_t *info)
/* requiredby */
service_db_migrate
(
&
ores
,
res
,
info
->
base
.
s
,
1
)
;
/* contents of the previous tree */
service_db_tree
(
&
ores
,
res
,
info
)
;
}
resolve_free
(
owres
)
;
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment