projects
/
oweals
/
opkg-lede.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libopkg: allow passing common package state flags to pkg_hash_add_from_file()
[oweals/opkg-lede.git]
/
libopkg
/
pkg_hash.c
diff --git
a/libopkg/pkg_hash.c
b/libopkg/pkg_hash.c
index 821cc71886e735e7f70a0446b73e4e8f8416e848..8c31aa99f0f8a26ac248c4d7ddb8e7324fcce62b 100644
(file)
--- a/
libopkg/pkg_hash.c
+++ b/
libopkg/pkg_hash.c
@@
-79,7
+79,7
@@
int dist_hash_add_from_file(const char *lists_dir, pkg_src_t * dist)
sprintf_alloc(&list_file, "%s/%s", lists_dir, subname);
if (file_exists(list_file)) {
sprintf_alloc(&list_file, "%s/%s", lists_dir, subname);
if (file_exists(list_file)) {
- if (pkg_hash_add_from_file(list_file, dist, NULL, 0)) {
+ if (pkg_hash_add_from_file(list_file, dist, NULL, 0
, 0
)) {
free(list_file);
return -1;
}
free(list_file);
return -1;
}
@@
-95,7
+95,7
@@
int dist_hash_add_from_file(const char *lists_dir, pkg_src_t * dist)
int
pkg_hash_add_from_file(const char *file_name,
int
pkg_hash_add_from_file(const char *file_name,
- pkg_src_t * src, pkg_dest_t * dest, int is_status_file)
+ pkg_src_t * src, pkg_dest_t * dest, int is_status_file
, int state_flags
)
{
pkg_t *pkg;
FILE *fp;
{
pkg_t *pkg;
FILE *fp;
@@
-121,6
+121,7
@@
pkg_hash_add_from_file(const char *file_name,
pkg = pkg_new();
pkg->src = src;
pkg->dest = dest;
pkg = pkg_new();
pkg->src = src;
pkg->dest = dest;
+ pkg->state_flag |= state_flags;
ret = parse_from_stream_nomalloc(pkg_parse_line, pkg, fp, 0,
&buf, len);
ret = parse_from_stream_nomalloc(pkg_parse_line, pkg, fp, 0,
&buf, len);
@@
-185,7
+186,7
@@
int pkg_hash_load_feeds(void)
sprintf_alloc(&list_file, "%s/%s", lists_dir, src->name);
if (file_exists(list_file)) {
sprintf_alloc(&list_file, "%s/%s", lists_dir, src->name);
if (file_exists(list_file)) {
- if (pkg_hash_add_from_file(list_file, src, NULL, 0)) {
+ if (pkg_hash_add_from_file(list_file, src, NULL, 0
, 0
)) {
free(list_file);
return -1;
}
free(list_file);
return -1;
}
@@
-213,7
+214,7
@@
int pkg_hash_load_status_files(void)
if (file_exists(dest->status_file_name)) {
if (pkg_hash_add_from_file
if (file_exists(dest->status_file_name)) {
if (pkg_hash_add_from_file
- (dest->status_file_name, NULL, dest, 1))
+ (dest->status_file_name, NULL, dest, 1
, SF_NEED_DETAIL
))
return -1;
}
}
return -1;
}
}