Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/xbps-checkvers/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,8 @@ static int
rcv_check_version(rcv_t *rcv)
{
const char *repover = NULL;
char srcver[BUFSIZ] = { '\0' }, *binpkgname = NULL, *s = NULL;
const char *pkgname, *version, *revision, *reverts, *repourl;
char srcver[BUFSIZ] = { '\0' }, *binpkgname = NULL;
const char *pkgname, *version, *revision, *reverts, *repourl, *s;
int sz;
size_t len;

Expand Down Expand Up @@ -660,8 +660,8 @@ template_removed_cb(struct xbps_handle *xhp UNUSED,
void *arg,
bool *done UNUSED)
{
const char *last_dash;
char *pkgname;
char *last_dash;
bool dummy_bool = false;
rcv_t *rcv = arg;

Expand Down
2 changes: 1 addition & 1 deletion bin/xbps-create/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ process_one_alternative(const char *altgrname, const char *val)
{
xbps_dictionary_t d;
xbps_array_t a;
char *altfiles;
const char *altfiles;
bool alloc = false;

if ((d = xbps_dictionary_get(pkg_propsd, "alternatives")) == NULL) {
Expand Down
3 changes: 2 additions & 1 deletion bin/xbps-uchroot/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ static void
add_bindmount(const char *bm, bool ro)
{
struct bindmnt *bmnt;
char *b, *src, *dest;
const char *dest, *b;
char *src;
size_t len;

src = strdup(bm);
Expand Down
5 changes: 3 additions & 2 deletions lib/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,10 @@ cmpkey(const void *a, const void *b)
static int
parse_option(char *line, size_t linelen, char **valp, size_t *vallen)
{
size_t len;
struct key needle;
const struct key *result;
char *p;
struct key needle, *result;
size_t len;

p = strpbrk(line, " \t=");
if (p == NULL)
Expand Down
2 changes: 1 addition & 1 deletion lib/fetch/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ struct index_parser {
};

static ssize_t
parse_index(struct index_parser *parser, const char *buf, size_t len)
parse_index(struct index_parser *parser, char *buf, size_t len)
{
char *end_attr, p = *buf;

Expand Down
23 changes: 12 additions & 11 deletions lib/package_unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ unpack_archive(struct xbps_handle *xhp,
struct archive_entry *entry;
ssize_t entry_size;
const char *entry_pname, *pkgname;
char *buf = NULL;
const char *file;
int ar_rv, rv, error, entry_type, flags;
bool preserve, update, file_exists, keep_conf_file;
bool skip_extract, force, xucd_stats;
Expand Down Expand Up @@ -132,19 +132,19 @@ unpack_archive(struct xbps_handle *xhp,
xbps_dictionary_get_dict(xhp->transd, "obsolete_files", &obsd) &&
(obsoletes = xbps_dictionary_get(obsd, pkgname))) {
for (unsigned int i = 0; i < xbps_array_count(obsoletes); i++) {
const char *file = NULL;
xbps_array_get_cstring_nocopy(obsoletes, i, &file);
if (remove(file) == -1) {
const char *obsolete = NULL;
xbps_array_get_cstring_nocopy(obsoletes, i, &obsolete);
if (remove(obsolete) == -1) {
xbps_set_cb_state(xhp,
XBPS_STATE_REMOVE_FILE_OBSOLETE_FAIL,
errno, pkgver,
"%s: failed to remove obsolete entry `%s': %s",
pkgver, file, strerror(errno));
pkgver, obsolete, strerror(errno));
continue;
}
xbps_set_cb_state(xhp,
XBPS_STATE_REMOVE_FILE_OBSOLETE,
0, pkgver, "%s: removed obsolete entry: %s", pkgver, file);
0, pkgver, "%s: removed obsolete entry: %s", pkgver, obsolete);
}
}

Expand Down Expand Up @@ -296,9 +296,9 @@ unpack_archive(struct xbps_handle *xhp,
* that should be kept.
*/
if (!force && (entry_type == AE_IFREG)) {
buf = strchr(entry_pname, '.') + 1;
assert(buf != NULL);
keep_conf_file = xbps_entry_is_a_conf_file(binpkg_filesd, buf);
file = strchr(entry_pname, '.') + 1;
assert(file != NULL);
keep_conf_file = xbps_entry_is_a_conf_file(binpkg_filesd, file);
}

/*
Expand Down Expand Up @@ -337,7 +337,7 @@ unpack_archive(struct xbps_handle *xhp,
rv = 0;
} else {
rv = xbps_file_hash_check_dictionary(
xhp, binpkg_filesd, "files", buf);
xhp, binpkg_filesd, "files", file);
if (rv == -1) {
/* error */
xbps_dbg_printf(
Expand Down Expand Up @@ -448,6 +448,7 @@ unpack_archive(struct xbps_handle *xhp,
* Externalize binpkg files.plist to disk, if not empty.
*/
if (xbps_dictionary_count(binpkg_filesd)) {
char *buf;
mode_t prev_umask;
prev_umask = umask(022);
buf = xbps_xasprintf("%s/.%s-files.plist", xhp->metadir, pkgname);
Expand All @@ -468,7 +469,7 @@ unpack_archive(struct xbps_handle *xhp,
* If unpacked pkg has no files, remove its files metadata plist.
*/
if (!xbps_dictionary_count(binpkg_filesd)) {
buf = xbps_xasprintf("%s/.%s-files.plist", xhp->metadir, pkgname);
char *buf = xbps_xasprintf("%s/.%s-files.plist", xhp->metadir, pkgname);
unlink(buf);
free(buf);
}
Expand Down
Loading