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
alpine
apk-tools
Commits
90228c4d
Commit
90228c4d
authored
3 years ago
by
kpcyrd
Committed by
Timo Teräs
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
io_archive: Use SOURCE_DATE_EPOCH for meta files instead of current time
[TT: minor stylistic changes]
parent
c1405f93
No related branches found
No related tags found
No related merge requests found
Pipeline
#88548
passed
3 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/apk_defines.h
+2
-0
2 additions, 0 deletions
src/apk_defines.h
src/common.c
+15
-0
15 additions, 0 deletions
src/common.c
src/io_archive.c
+1
-1
1 addition, 1 deletion
src/io_archive.c
with
18 additions
and
1 deletion
src/apk_defines.h
+
2
−
0
View file @
90228c4d
...
...
@@ -177,6 +177,8 @@ static inline uint32_t get_unaligned32(const void *ptr)
typedef
void
(
*
apk_progress_cb
)(
void
*
cb_ctx
,
size_t
);
time_t
apk_get_build_time
(
void
);
void
*
apk_array_resize
(
void
*
array
,
size_t
new_size
,
size_t
elem_size
);
#define APK_ARRAY(array_type_name, elem_type_name) \
...
...
This diff is collapsed.
Click to expand it.
src/common.c
+
15
−
0
View file @
90228c4d
...
...
@@ -40,3 +40,18 @@ void *apk_array_resize(void *array, size_t new_size, size_t elem_size)
return
tmp
;
}
time_t
apk_get_build_time
(
void
)
{
static
int
initialized
=
0
;
static
time_t
timestamp
=
0
;
char
*
source_date_epoch
;
if
(
initialized
)
return
timestamp
;
source_date_epoch
=
getenv
(
"SOURCE_DATE_EPOCH"
);
if
(
source_date_epoch
&&
*
source_date_epoch
)
timestamp
=
strtoull
(
source_date_epoch
,
NULL
,
10
);
else
timestamp
=
time
(
NULL
);
initialized
=
1
;
return
timestamp
;
}
This diff is collapsed.
Click to expand it.
src/io_archive.c
+
1
−
1
View file @
90228c4d
...
...
@@ -291,7 +291,7 @@ int apk_tar_write_entry(struct apk_ostream *os, const struct apk_file_info *ae,
PUT_OCTAL
(
buf
.
uid
,
ae
->
uid
);
PUT_OCTAL
(
buf
.
gid
,
ae
->
gid
);
PUT_OCTAL
(
buf
.
mode
,
ae
->
mode
&
07777
);
PUT_OCTAL
(
buf
.
mtime
,
ae
->
mtime
?:
time
(
NULL
));
PUT_OCTAL
(
buf
.
mtime
,
ae
->
mtime
?:
apk_get_build_
time
());
/* Checksum */
strcpy
(
buf
.
magic
,
"ustar "
);
...
...
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