Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
alpine
apk-tools
Commits
366e7d07
Commit
366e7d07
authored
Dec 21, 2009
by
Timo Teräs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db: read time only once when writing scriptsdb
less syscalls.
parent
507d34d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/database.c
src/database.c
+3
-1
No files found.
src/database.c
View file @
366e7d07
...
...
@@ -642,6 +642,7 @@ static int apk_db_scriptdb_write(struct apk_database *db, struct apk_ostream *os
char
filename
[
256
];
apk_blob_t
bfn
;
int
r
,
i
;
time_t
now
=
time
(
NULL
);
list_for_each_entry
(
ipkg
,
&
db
->
installed
.
packages
,
installed_pkgs_list
)
{
pkg
=
ipkg
->
pkg
;
...
...
@@ -654,6 +655,7 @@ static int apk_db_scriptdb_write(struct apk_database *db, struct apk_ostream *os
.
name
=
filename
,
.
size
=
ipkg
->
script
[
i
].
len
,
.
mode
=
0755
|
S_IFREG
,
.
mtime
=
now
,
};
/* The scripts db expects file names in format:
* pkg-version.<hexdump of package checksum>.action */
...
...
@@ -1892,7 +1894,7 @@ static void apk_db_migrate_files(struct apk_database *db,
}
else
{
/* check if want keep existing files */
if
((
apk_flags
&
APK_NEVER_OVERWRITE
)
&&
(
faccessat
(
db
->
root_fd
,
name
,
F_OK
,
(
faccessat
(
db
->
root_fd
,
name
,
F_OK
,
AT_SYMLINK_NOFOLLOW
)
==
0
))
{
unlinkat
(
db
->
root_fd
,
tmpname
,
0
);
}
else
{
...
...
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