summaryrefslogtreecommitdiff
path: root/src/apk_io.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-11-09 12:47:23 +0200
committerTimo Teräs <timo.teras@iki.fi>2015-11-09 12:51:01 +0200
commitcce4cff55310cddb2e2ec61d19b758e52a4e2c97 (patch)
treede2735305369fc75caee961485a6d44bc2782ce5 /src/apk_io.h
parent7501f6012fc06ebfa8c6d8f928f38318267abe72 (diff)
downloadapk-tools-cce4cff55310cddb2e2ec61d19b758e52a4e2c97.tar.gz
apk-tools-cce4cff55310cddb2e2ec61d19b758e52a4e2c97.tar.bz2
apk-tools-cce4cff55310cddb2e2ec61d19b758e52a4e2c97.tar.xz
apk-tools-cce4cff55310cddb2e2ec61d19b758e52a4e2c97.zip
io, database: preserve [am]time for cached and fetched files
preserve [am]time for all packages and indexes. this fixes the caching error that 'apk update' is after new index is generated, but before the used mirror is synchronized. this caused local apkindex timestamp to be newer than file in mirror, when in fact it was outdated index. this also fixes fetched files to have build timestamp so that files going to .iso or custom images have proper timestamps (rsync with appropriate --modify-window now works)
Diffstat (limited to 'src/apk_io.h')
-rw-r--r--src/apk_io.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/apk_io.h b/src/apk_io.h
index 6e2e37c..b0e15a4 100644
--- a/src/apk_io.h
+++ b/src/apk_io.h
@@ -33,6 +33,11 @@ struct apk_xattr {
};
APK_ARRAY(apk_xattr_array, struct apk_xattr);
+struct apk_file_meta {
+ time_t mtime, atime;
+};
+void apk_file_meta_to_fd(int fd, struct apk_file_meta *meta);
+
struct apk_file_info {
char *name;
char *link_target;
@@ -50,6 +55,7 @@ struct apk_file_info {
};
struct apk_istream {
+ void (*get_meta)(void *stream, struct apk_file_meta *meta);
ssize_t (*read)(void *stream, void *ptr, size_t size);
void (*close)(void *stream);
};
@@ -59,6 +65,7 @@ struct apk_istream {
struct apk_bstream {
unsigned int flags;
+ void (*get_meta)(void *stream, struct apk_file_meta *meta);
apk_blob_t (*read)(void *stream, apk_blob_t token);
void (*close)(void *stream, size_t *size);
};