Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
apk-tools
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sertonix
apk-tools
Commits
b5b130e1
Commit
b5b130e1
authored
2 months ago
by
Timo Teräs
Browse files
Options
Downloads
Patches
Plain Diff
print: flush after progress notice if needed
fixes commit
4c776eb7
db: make index refresh notices a progress note
parent
10b467c0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/apk_print.h
+3
-1
3 additions, 1 deletion
src/apk_print.h
src/print.c
+4
-1
4 additions, 1 deletion
src/print.c
with
7 additions
and
2 deletions
src/apk_print.h
+
3
−
1
View file @
b5b130e1
...
...
@@ -38,8 +38,10 @@ void apk_url_parse(struct apk_url_print *, const char *);
#define URL_PRINTF(u) (int)u.len_before_pw, u.url, u.pwmask, u.url_or_host
struct
apk_out
{
int
verbosity
,
progress_disable
,
progress_fd
;
int
verbosity
,
progress_fd
;
unsigned
int
width
;
unsigned
int
progress_disable
:
1
;
unsigned
int
need_flush
:
1
;
const
char
*
progress_char
;
FILE
*
out
,
*
err
,
*
log
;
struct
apk_progress
*
prog
;
...
...
This diff is collapsed.
Click to expand it.
src/print.c
+
4
−
1
View file @
b5b130e1
...
...
@@ -198,6 +198,7 @@ static void apk_out_render_progress(struct apk_out *out, bool force)
for
(;
i
<
bar_width
;
i
++
)
fputc
(
' '
,
f
);
fflush
(
f
);
fputs
(
"\e8\e[0K"
,
f
);
out
->
need_flush
=
1
;
}
}
...
...
@@ -225,6 +226,7 @@ void apk_out_progress_note(struct apk_out *out, const char *format, ...)
fprintf
(
f
,
"\e7[%s]"
,
buf
);
fflush
(
f
);
fputs
(
"\e8\e[0K"
,
f
);
out
->
need_flush
=
1
;
}
void
apk_out_fmt
(
struct
apk_out
*
out
,
const
char
*
prefix
,
const
char
*
format
,
...)
...
...
@@ -232,8 +234,9 @@ void apk_out_fmt(struct apk_out *out, const char *prefix, const char *format, ..
va_list
va
;
if
(
prefix
!=
APK_OUT_LOG_ONLY
)
{
va_start
(
va
,
format
);
if
(
prefix
&&
out
->
prog
)
fflush
(
out
->
out
);
if
(
prefix
&&
out
->
need_flush
)
fflush
(
out
->
out
);
log_internal
(
prefix
?
out
->
err
:
out
->
out
,
prefix
,
format
,
va
);
out
->
need_flush
=
0
;
va_end
(
va
);
apk_out_render_progress
(
out
,
true
);
}
...
...
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