diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-06-17 14:24:34 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2013-06-17 14:38:27 +0300 |
commit | 9d100378074d21f99dc26bae8417932dc110664e (patch) | |
tree | e66829190a5648b146698e372b2a9403d535f866 /src/apk_database.h | |
parent | dbb642206d2ef73c5428a04cb10bb27e7cdd3b29 (diff) | |
download | apk-tools-9d100378074d21f99dc26bae8417932dc110664e.tar.gz apk-tools-9d100378074d21f99dc26bae8417932dc110664e.tar.bz2 apk-tools-9d100378074d21f99dc26bae8417932dc110664e.tar.xz apk-tools-9d100378074d21f99dc26bae8417932dc110664e.zip |
db: refactor repository file construction
Fixes also 'fetch' applet to prefer copying/linking to files from
cache if possible.
Diffstat (limited to 'src/apk_database.h')
-rw-r--r-- | src/apk_database.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/apk_database.h b/src/apk_database.h index 43d879f..48bd5f9 100644 --- a/src/apk_database.h +++ b/src/apk_database.h @@ -21,9 +21,6 @@ #include "apk_provider_data.h" #include "apk_solver_data.h" -extern const char * const apk_index_gz; -extern const char * const apkindex_tar_gz; - struct apk_name; APK_ARRAY(apk_name_array, struct apk_name *); @@ -71,8 +68,8 @@ struct apk_db_dir { char name[]; }; -#define PKG_FILE_FMT "%s%s%s" -#define PKG_FILE_PRINTF(dir,file) (dir)->name, (dir)->namelen ? "/" : "", (file)->name +#define DIR_FILE_FMT "%s%s%s" +#define DIR_FILE_PRINTF(dir,file) (dir)->name, (dir)->namelen ? "/" : "", (file)->name struct apk_db_dir_instance { struct hlist_node pkg_dirs_list; @@ -220,15 +217,16 @@ 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); struct apk_repository *apk_db_select_repo(struct apk_database *db, struct apk_package *pkg); -int apk_repo_format_filename(char *buf, size_t len, - const char *repourl, apk_blob_t *arch, - const char *pkgfile); + +int apk_repo_format_cache_index(apk_blob_t to, struct apk_repository *repo); +int apk_repo_format_item(struct apk_database *db, struct apk_repository *repo, struct apk_package *pkg, + int *fd, char *buf, size_t len); + unsigned int apk_db_get_pinning_mask_repos(struct apk_database *db, unsigned short pinning_mask); int apk_db_cache_active(struct apk_database *db); -void apk_cache_format_index(apk_blob_t to, struct apk_repository *repo); -int apk_cache_download(struct apk_database *db, const char *url, apk_blob_t *arch, - const char *item, const char *cache_item, int verify); +int apk_cache_download(struct apk_database *db, struct apk_repository *repo, + struct apk_package *pkg, int verify); typedef void (*apk_cache_item_cb)(struct apk_database *db, int dirfd, const char *name, |