Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
9e32be4a
Commit
9e32be4a
authored
May 30, 2017
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build directory, directory created if it doesn't exist
parent
49e06cc1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
wb/lib/wb/src/wb_build.cpp
wb/lib/wb/src/wb_build.cpp
+14
-0
wb/lib/wb/src/wb_expwnav.cpp
wb/lib/wb/src/wb_expwnav.cpp
+23
-3
No files found.
wb/lib/wb/src/wb_build.cpp
View file @
9e32be4a
...
...
@@ -1687,7 +1687,9 @@ void wb_build::directories( char *dir, bld_ePass pass)
// Check if file should be updated
int
update
=
0
;
pwr_tFileName
source
,
target
;
pwr_tFileName
target_dir
;
pwr_tTime
source_time
,
target_time
;
char
*
s
;
strncpy
(
source
,
found_file
,
sizeof
(
source
));
strncpy
(
target
,
line_item
[
3
],
sizeof
(
target
));
...
...
@@ -1714,6 +1716,18 @@ void wb_build::directories( char *dir, bld_ePass pass)
if
(
!
opt
.
force
&&
!
update
)
continue
;
if
(
EVEN
(
sts
))
{
// Check that directory exist, create if it doesn't
strcpy
(
target_dir
,
target
);
if
(
(
s
=
strrchr
(
target_dir
,
'/'
)))
{
*
s
=
0
;
sts
=
dcli_file_time
(
target_dir
,
&
target_time
);
if
(
EVEN
(
sts
))
{
sprintf
(
cmd
,
"mkdir -p %s"
,
target_dir
);
system
(
cmd
);
}
}
}
sprintf
(
cmd
,
"cp %s %s"
,
source
,
target
);
system
(
cmd
);
sprintf
(
cmd
,
"Build: copy %s %s -> %s"
,
line_item
[
1
],
source
,
target
);
...
...
wb/lib/wb/src/wb_expwnav.cpp
View file @
9e32be4a
...
...
@@ -1194,6 +1194,25 @@ pwr_tStatus WbExpWNav::exp()
sprintf
(
cmd
,
"cp %s %s"
,
cp
->
source
,
cp
->
target
);
printf
(
"%s
\n
"
,
cmd
);
sts
=
system
(
cmd
);
if
(
sts
!=
0
)
{
// Check that directory exist, create if it doesn't
pwr_tFileName
target_dir
;
pwr_tTime
target_time
;
char
*
s
;
strcpy
(
target_dir
,
cp
->
target
);
if
(
(
s
=
strrchr
(
target_dir
,
'/'
)))
{
*
s
=
0
;
sts
=
dcli_file_time
(
target_dir
,
&
target_time
);
if
(
EVEN
(
sts
))
{
sprintf
(
cmd
,
"mkdir -p %s"
,
target_dir
);
system
(
cmd
);
sprintf
(
cmd
,
"cp %s %s"
,
cp
->
source
,
cp
->
target
);
printf
(
"%s
\n
"
,
cmd
);
sts
=
system
(
cmd
);
}
}
if
(
sts
!=
0
)
{
char
msg
[
250
];
snprintf
(
msg
,
sizeof
(
msg
),
"Build error %d, %s"
,
WEXITSTATUS
(
sts
),
cmd
);
...
...
@@ -1201,6 +1220,7 @@ pwr_tStatus WbExpWNav::exp()
}
}
}
}
for
(
ExpWDir
*
dp
=
dirlist
;
dp
;
dp
=
dp
->
next
)
{
if
(
!
dp
->
update
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment