From dee8144ce5ca96ceca643d74fd6152ecf812f8af Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 13 Nov 2011 23:45:55 -0600 Subject: Add helper method for creating and opening archive object This moves the common setup code of about 5 different callers into one method. Error messages will now be common and shared in all places; several paths did not have any messages at all before. In addition, we now pick an ideal block size for the archive read based off the larger value of our default buffer size or the st.st_blksize field. For a filesystem such as NFS, this is often much larger than the default 8192- values such as 32768 and 131072 are common. Signed-off-by: Dan McGee --- lib/libalpm/util.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libalpm/util.h') diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h index df16543c..fa86679f 100644 --- a/lib/libalpm/util.h +++ b/lib/libalpm/util.h @@ -117,6 +117,9 @@ int _alpm_makepath_mode(const char *path, mode_t mode); int _alpm_copyfile(const char *src, const char *dest); char *_alpm_strtrim(char *str); size_t _alpm_strip_newline(char *str); + +int _alpm_open_archive(alpm_handle_t *handle, const char *path, + struct stat *buf, struct archive **archive, alpm_errno_t error); int _alpm_unpack_single(alpm_handle_t *handle, const char *archive, const char *prefix, const char *filename); int _alpm_unpack(alpm_handle_t *handle, const char *archive, const char *prefix, -- cgit v1.2.3-24-g4f1b