diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-07-31 16:08:09 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-07-31 16:08:09 +0300 |
commit | ea901526648c43ef8e961b3d7e051b9ca14b65ca (patch) | |
tree | cea5a96dc83518a94f79dddd645f3e4404179530 /src/apk_database.h | |
parent | 67108bf07a67811ea91fc965f3f1592a4a70044e (diff) | |
download | apk-tools-ea901526648c43ef8e961b3d7e051b9ca14b65ca.tar.gz apk-tools-ea901526648c43ef8e961b3d7e051b9ca14b65ca.tar.bz2 apk-tools-ea901526648c43ef8e961b3d7e051b9ca14b65ca.tar.xz apk-tools-ea901526648c43ef8e961b3d7e051b9ca14b65ca.zip |
apk: use *at instead of chdir+normal file syscall
this way we never change cwd, and relative filenames are always
parsed consistently. this also helps filename construction in many
places. this patch also changes '--root' to override location of
all configuration to be in the new root. previously it depended
on the file which one was used.
Diffstat (limited to 'src/apk_database.h')
-rw-r--r-- | src/apk_database.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/apk_database.h b/src/apk_database.h index 241719d..094725d 100644 --- a/src/apk_database.h +++ b/src/apk_database.h @@ -80,7 +80,7 @@ struct apk_repository { struct apk_database { char *root; - int root_fd, lock_fd; + int root_fd, lock_fd, cache_fd, cachetmp_fd, keys_fd; unsigned name_id, num_repos; const char *cache_dir; int permanent; @@ -134,7 +134,6 @@ struct apk_db_file *apk_db_file_query(struct apk_database *db, int apk_db_open(struct apk_database *db, const char *root, unsigned int flags); int apk_db_write_config(struct apk_database *db); void apk_db_close(struct apk_database *db); -int apk_db_cache_active(struct apk_database *db); int apk_db_permanent(struct apk_database *db); struct apk_package *apk_db_pkg_add(struct apk_database *db, struct apk_package *pkg); @@ -147,10 +146,11 @@ int apk_db_index_write(struct apk_database *db, struct apk_ostream *os); int apk_db_add_repository(apk_database_t db, apk_blob_t repository); int apk_repository_update(struct apk_database *db, struct apk_repository *repo); -int apk_cache_download(struct apk_database *db, struct apk_checksum *csum, - const char *url, const char *item, int verify); -int apk_cache_exists(struct apk_database *db, struct apk_checksum *csum, - const char *item); + +int apk_db_cache_active(struct apk_database *db); +void apk_cache_format_index(apk_blob_t to, struct apk_repository *repo, int ver); +int apk_cache_download(struct apk_database *db, const char *url, + const char *item, const char *cache_item, int verify); int apk_db_install_pkg(struct apk_database *db, struct apk_package *oldpkg, |