FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 03-09-2012, 02:21 PM
Dave Reisner
 
Default makepkg: abort when failing to create BUILDDIR

On Fri, Mar 09, 2012 at 05:59:07PM +1000, Allan McRae wrote:
> Signed-off-by: Allan McRae <allan@archlinux.org>
> ---
> scripts/makepkg.sh.in | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 8dd2d39..9cd8af8 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -2052,8 +2052,11 @@ readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
> BUILDDIR=${_BUILDDIR:-$BUILDDIR}
> BUILDDIR=${BUILDDIR:-$startdir} #default to $startdir if undefined
> if [[ ! -d $BUILDDIR ]]; then
> - mkdir -p "$BUILDDIR" ||
> - error "$(gettext "You do not have write permission to create packages in %s.")" "$BUILDDIR"
> + if ! mkdir -p "$BUILDDIR"; then
> + error "$(gettext "You do not have write permission to create packages in %s.")" "$BUILDDIR"

Hrmmm, permissions is only one possible reason for mkdir to fail. the
manpage for the syscall and library wrapper list a bunch more. Since
mkdir will happily report the error for us (with localization), should
we just ditch our own possibly-inaccurate error messaging?

> + plain "$(gettext "Aborting...")"
> + exit 1
> + fi
> chmod a-s "$BUILDDIR"
> fi
> if [[ ! -w $BUILDDIR ]]; then
> --
> 1.7.9.3
>
>
 
Old 03-10-2012, 10:17 AM
Allan McRae
 
Default makepkg: abort when failing to create BUILDDIR

On 10/03/12 01:21, Dave Reisner wrote:
> On Fri, Mar 09, 2012 at 05:59:07PM +1000, Allan McRae wrote:
>> Signed-off-by: Allan McRae <allan@archlinux.org>
>> ---
>> scripts/makepkg.sh.in | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>> index 8dd2d39..9cd8af8 100644
>> --- a/scripts/makepkg.sh.in
>> +++ b/scripts/makepkg.sh.in
>> @@ -2052,8 +2052,11 @@ readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
>> BUILDDIR=${_BUILDDIR:-$BUILDDIR}
>> BUILDDIR=${BUILDDIR:-$startdir} #default to $startdir if undefined
>> if [[ ! -d $BUILDDIR ]]; then
>> - mkdir -p "$BUILDDIR" ||
>> - error "$(gettext "You do not have write permission to create packages in %s.")" "$BUILDDIR"
>> + if ! mkdir -p "$BUILDDIR"; then
>> + error "$(gettext "You do not have write permission to create packages in %s.")" "$BUILDDIR"
>
> Hrmmm, permissions is only one possible reason for mkdir to fail. the
> manpage for the syscall and library wrapper list a bunch more. Since
> mkdir will happily report the error for us (with localization), should
> we just ditch our own possibly-inaccurate error messaging?
>

I guess mkdir is one of the functions we want a safe wrapper for and we
could have a generic "Failed to create directory: %s" type message
there. So I will just fix the bug for now under the assumption a bigger
fix is coming...

Allan
 

Thread Tools




All times are GMT. The time now is 10:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org