Skip to content

Commit 89889d5

Browse files
committed
lib: replace xbps_entry_is_a_conf_file with XBPS_FILE_CONF flag
1 parent fbb7b52 commit 89889d5

File tree

3 files changed

+1
-30
lines changed

3 files changed

+1
-30
lines changed

include/xbps_api_impl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ bool HIDDEN xbps_remove_pkg_from_array_by_pkgver(xbps_array_t, const char *);
8989
void HIDDEN xbps_fetch_set_cache_connection(int, int);
9090
void HIDDEN xbps_fetch_unset_cache_connection(void);
9191
int HIDDEN xbps_cb_message(struct xbps_handle *, xbps_dictionary_t, const char *);
92-
int HIDDEN xbps_entry_is_a_conf_file(xbps_dictionary_t, const char *);
9392
int HIDDEN xbps_entry_install_conf_file(struct xbps_handle *, xbps_dictionary_t,
9493
xbps_dictionary_t, struct archive_entry *, const char *,
9594
const char *, bool);

lib/package_config_files.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,6 @@
3131

3232
#include "xbps_api_impl.h"
3333

34-
/*
35-
* Returns true if entry is a configuration file, false otherwise.
36-
*/
37-
int HIDDEN
38-
xbps_entry_is_a_conf_file(xbps_dictionary_t filesd,
39-
const char *entry_pname)
40-
{
41-
xbps_array_t array;
42-
xbps_dictionary_t d;
43-
const char *cffile;
44-
45-
array = xbps_dictionary_get(filesd, "conf_files");
46-
if (xbps_array_count(array) == 0)
47-
return false;
48-
49-
for (unsigned int i = 0; i < xbps_array_count(array); i++) {
50-
d = xbps_array_get(array, i);
51-
xbps_dictionary_get_cstring_nocopy(d, "file", &cffile);
52-
if (strcmp(cffile, entry_pname) == 0)
53-
return true;
54-
}
55-
return false;
56-
}
57-
5834
/*
5935
* Returns 1 if entry should be installed, 0 if don't or -1 on error.
6036
*/

lib/package_unpack.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,7 @@ unpack_archive(struct xbps_handle *xhp,
293293
* Check if current entry is a configuration file,
294294
* that should be kept.
295295
*/
296-
if (!force && (entry_type == AE_IFREG)) {
297-
buf = strchr(entry_pname, '.') + 1;
298-
assert(buf != NULL);
299-
keep_conf_file = xbps_entry_is_a_conf_file(binpkg_filesd, buf);
300-
}
296+
keep_conf_file = (file->flags & XBPS_FILE_CONF) != 0;
301297

302298
/*
303299
* If file to be extracted does not match the file type of

0 commit comments

Comments
 (0)