db: index file location is a URL
parent
4c7f1e0dec
commit
cfdef51bee
2
TODO
2
TODO
|
@ -6,8 +6,6 @@
|
||||||
- Compress 'installed' and 'scripts'
|
- Compress 'installed' and 'scripts'
|
||||||
- Repository support:
|
- Repository support:
|
||||||
- always keep local copy of index
|
- always keep local copy of index
|
||||||
- index/package fetching from URLs
|
|
||||||
- read from config file
|
|
||||||
- cache .apks on USB stick when using network repo for reboot
|
- cache .apks on USB stick when using network repo for reboot
|
||||||
|
|
||||||
- Error handling and rollback
|
- Error handling and rollback
|
||||||
|
|
|
@ -50,6 +50,7 @@ struct apk_istream *apk_istream_from_fd(int fd);
|
||||||
struct apk_istream *apk_istream_from_file(const char *file);
|
struct apk_istream *apk_istream_from_file(const char *file);
|
||||||
struct apk_istream *apk_istream_from_file_gz(const char *file);
|
struct apk_istream *apk_istream_from_file_gz(const char *file);
|
||||||
struct apk_istream *apk_istream_from_url(const char *url);
|
struct apk_istream *apk_istream_from_url(const char *url);
|
||||||
|
struct apk_istream *apk_istream_from_url_gz(const char *url);
|
||||||
size_t apk_istream_skip(struct apk_istream *istream, size_t size);
|
size_t apk_istream_skip(struct apk_istream *istream, size_t size);
|
||||||
size_t apk_istream_splice(void *stream, int fd, size_t size,
|
size_t apk_istream_splice(void *stream, int fd, size_t size,
|
||||||
apk_progress_cb cb, void *cb_ctx);
|
apk_progress_cb cb, void *cb_ctx);
|
||||||
|
|
|
@ -813,7 +813,7 @@ int apk_db_add_repository(apk_database_t _db, apk_blob_t repository)
|
||||||
};
|
};
|
||||||
|
|
||||||
snprintf(tmp, sizeof(tmp), "%s/APK_INDEX.gz", db->repos[r].url);
|
snprintf(tmp, sizeof(tmp), "%s/APK_INDEX.gz", db->repos[r].url);
|
||||||
is = apk_istream_from_file_gz(tmp);
|
is = apk_istream_from_url_gz(tmp);
|
||||||
if (is == NULL) {
|
if (is == NULL) {
|
||||||
apk_error("Failed to open index file %s", tmp);
|
apk_error("Failed to open index file %s", tmp);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -66,6 +66,11 @@ struct apk_istream *apk_istream_from_url(const char *url)
|
||||||
return apk_istream_from_fd(fork_wget(url));
|
return apk_istream_from_fd(fork_wget(url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct apk_istream *apk_istream_from_url_gz(const char *file)
|
||||||
|
{
|
||||||
|
return apk_bstream_gunzip(apk_bstream_from_url(file), TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
struct apk_bstream *apk_bstream_from_url(const char *url)
|
struct apk_bstream *apk_bstream_from_url(const char *url)
|
||||||
{
|
{
|
||||||
if (url_is_file(url))
|
if (url_is_file(url))
|
||||||
|
@ -73,3 +78,4 @@ struct apk_bstream *apk_bstream_from_url(const char *url)
|
||||||
|
|
||||||
return apk_bstream_from_fd(fork_wget(url));
|
return apk_bstream_from_fd(fork_wget(url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue