[pacman-dev] [PATCH] libalpm: fix documentation for alpm_pkg_mtree_next

2019-06-13 Thread morganamilo
libarchive uses 1 for EOF, not 0. Instead of using the actual ints, use
libarchive's error codes.
---

By the way, not familiar with doxygen. Is my wording fine or is there
some built in "see also" functionality?

diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index ffb2ad96..ece894cf 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -1326,7 +1326,8 @@ struct archive *alpm_pkg_mtree_open(alpm_pkg_t *pkg);
  * @param pkg the package that the mtree file is being read from
  * @param archive the archive structure reading from the mtree file
  * @param entry an archive_entry to store the entry header information
- * @return 0 if end of archive is reached, non-zero otherwise.
+ * @return ARCHIVE_OK on success, ARCHIVE_EOF if end of archive is reached,
+ * otherwise an error occured (see archive.h).
  */
 int alpm_pkg_mtree_next(const alpm_pkg_t *pkg, struct archive *archive,
struct archive_entry **entry);
-- 
2.21.0


[pacman-dev] [PATCH] pacman: correctly free lists

2019-06-13 Thread morganamilo


diff --git a/src/pacman/database.c b/src/pacman/database.c
index f3b890ce..7a792bad 100644
--- a/src/pacman/database.c
+++ b/src/pacman/database.c
@@ -105,7 +105,8 @@ static int check_db_missing_deps(alpm_list_t *pkglist)
free(depstring);
ret++;
}
-   FREELIST(data);
+   alpm_list_free_inner(data, (alpm_list_fn_free)alpm_depmissing_free);
+   alpm_list_free(data);
return ret;
 }
 
@@ -159,7 +160,8 @@ static int check_db_local_package_conflicts(alpm_list_t 
*pkglist)
conflict->package1, conflict->package2);
ret++;
}
-   FREELIST(data);
+   alpm_list_free_inner(data, (alpm_list_fn_free)alpm_conflict_free);
+   alpm_list_free(data);
return ret;
 }
 
-- 
2.21.0