[pacman-dev] [PATCH 0/5] Random fixes from my working branch
Posting this random collection of patches before they grow hair and develop a personality more likeable than mine. Dave Reisner (5): add real_line_size to alpm_read_buffer add line length parameter to _alpm_strip_newline contrib: sed out @SCRIPTNAME@ in edit command updpkgsums: avoid fancy quoting in error message diskspace: log errors when opening the mount table fails contrib/Makefile.am | 1 + contrib/updpkgsums.sh.in | 2 +- lib/libalpm/be_local.c | 14 +++++++------- lib/libalpm/be_package.c | 2 +- lib/libalpm/be_sync.c | 8 ++++---- lib/libalpm/diskspace.c | 6 ++++++ lib/libalpm/util.c | 12 +++++++----- lib/libalpm/util.h | 3 ++- 8 files changed, 29 insertions(+), 19 deletions(-) -- 1.7.10.4
We inevitably call strlen() or similar on the line returned from
_alpm_archive_fgets(), so include the line size of the interesting line
in the struct.
Signed-off-by: Dave Reisner
If known, callers can pass the line size to this function in order to
avoid an strlen call. Otherwise, they simply pass 0 and
_alpm_strip_newline will do the call instead.
Signed-off-by: Dave Reisner
Signed-off-by: Dave Reisner
m4 has a field day parsing escapes and actually vandalizes this string,
causing the error to look like:
==> ERROR: \PKGBUILD\ not found or is not a file
Avoid all quoting and just match up with how makepkg reports errors (no
quoting at all).
Signed-off-by: Dave Reisner
Signed-off-by: Dave Reisner
Signed-off-by: Dave Reisner
--- lib/libalpm/diskspace.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 1fc297e..df2bb71 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -82,6 +82,8 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle) fp = setmntent(MOUNTED, "r");
if(fp == NULL) { + _alpm_log(handle, ALPM_LOG_ERROR, "failed to open file: %s: %s\n", + MOUNTED, strerror(errno)); return NULL; }
@@ -118,6 +120,8 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle) fp = fopen("/etc/mnttab", "r");
if(fp == NULL) { + _alpm_log(handle, ALPM_LOG_ERROR, "failed to open file: /etc/mnttab: %s\n", If you use an %s substitution you don't have to introduce another
On Wed, Jun 13, 2012 at 1:00 PM, Dave Reisner
+ strerror(errno)); return NULL; }
@@ -153,6 +157,8 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle) entries = getmntinfo(&fsp, MNT_NOWAIT);
if(entries < 0) { + _alpm_log(handle, ALPM_LOG_ERROR, + "failed to open mount table for reading: %s\n", strerror(errno)); return NULL; }
-- 1.7.10.4
participants (2)
-
Dan McGee
-
Dave Reisner