8000 lib: replace xbps_entry_is_a_conf_file with XBPS_FILE_CONF flag · void-linux/xbps@b1831a6 · GitHub
[go: up one dir, main page]

Skip to content

Commit b1831a6

Browse files
committed
lib: replace xbps_entry_is_a_conf_file with XBPS_FILE_CONF flag
1 parent 2dedfd1 commit b1831a6

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
@@ -84,7 +84,6 @@ bool HIDDEN xbps_remove_pkg_from_array_by_pkgver(xbps_array_t, const char *);
8484
void HIDDEN xbps_fetch_set_cache_connection(int, int);
8585
void HIDDEN xbps_fetch_unset_cache_connection(void);
8686
int HIDDEN xbps_cb_message(struct xbps_handle *, xbps_dictionary_t, const char *);
87-
int HIDDEN xbps_entry_is_a_conf_file(xbps_dictionary_t, const char *);
8887
int HIDDEN xbps_entry_install_conf_file(struct xbps_handle *, xbps_dictionary_t,
8988
xbps_dictionary_t, struct archive_entry *, const char *,
9089
const char *, bool);

lib/package_config_files.c

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

3434
#include "xbps_api_impl.h"
3535

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

lib/package_unpack.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,7 @@ unpack_archive(struct xbps_handle *xhp,
304304
* Check if current entry is a configuration file,
305305
* that should be kept.
306306
*/
307-
if (!force && (entry_type == AE_IFREG)) {
308-
buf = strchr(entry_pname, '.') + 1;
309-
assert(buf != NULL);
310-
keep_conf_file = xbps_entry_is_a_conf_file(binpkg_filesd, buf);
311-
}
307+
keep_conf_file = (file->flags & XBPS_FILE_CONF) != 0;
312308

313309
/*
314310
* If file to be extracted does not match the file type of

0 commit comments

Comments
 (0)
0