[arch-projects] [mkinitcpio] [PATCH 2/3] mkinitcpio: Improve output when -T option is used.

Thomas Bächler thomas at archlinux.org
Tue Nov 19 04:12:57 EST 2013


Am 19.11.2013 04:17, schrieb Dave Reisner:
> On Mon, Nov 18, 2013 at 08:21:47PM +0100, Thomas Bächler wrote:
>> ---
>>  mkinitcpio | 24 ++++++++++++++----------
>>  1 file changed, 14 insertions(+), 10 deletions(-)
>>
>> diff --git a/mkinitcpio b/mkinitcpio
>> index 489e199..16f1b98 100755
>> --- a/mkinitcpio
>> +++ b/mkinitcpio
>> @@ -444,19 +444,21 @@ if (( _optshowautomods )); then
>>      cleanup 0
>>  fi
>>  
>> -if [[ -z $_optgenimg ]]; then
>> +if [[ ( -z $_optgenimg && -z $_optsavetree ) ]]; then
> 
> Did you mean to check $_opttargetdir rather than $_optsavetree?

I think I did.

>>      msg "Starting dry run: %s" "$KERNELVERSION"
>>  else
> 
> I think you save yourself some patch noise by making this an elif on the
> $_optgenimg conditional.

Patch looks nice when you ignore whitespace :)

I'll have another look.

>> -    # check for permissions. if the image doesn't already exist,
>> -    # then check the directory
>> -    if [[ ( -e $_optgenimg && ! -w $_optgenimg ) ||
>> -            ( ! -d ${_optgenimg%/*} || ! -w ${_optgenimg%/*} ) ]]; then
>> -        die 'Unable to write to %s' "$_optgenimg"
>> -    fi
>> +    if [[ $_optgenimg ]]; then
>> +        # check for permissions. if the image doesn't already exist,
>> +        # then check the directory
>> +        if [[ ( -e $_optgenimg && ! -w $_optgenimg ) ||
>> +                ( ! -d ${_optgenimg%/*} || ! -w ${_optgenimg%/*} ) ]]; then
>> +            die 'Unable to write to %s' "$_optgenimg"
>> +        fi
>>  
>> -    _optcompress=${_optcompress:-${COMPRESSION:-gzip}}
>> -    if ! type -P "$_optcompress" >/dev/null; then
>> -        die "Unable to locate compression method: %s" "$_optcompress"
>> +        _optcompress=${_optcompress:-${COMPRESSION:-gzip}}
>> +        if ! type -P "$_optcompress" >/dev/null; then
>> +            die "Unable to locate compression method: %s" "$_optcompress"
>> +        fi
>>      fi
>>  
>>      msg "Starting build: %s" "$KERNELVERSION"
>> @@ -498,6 +500,8 @@ ldconfig -r "$BUILDROOT" &>/dev/null
>>  
>>  if [[ $_optgenimg ]]; then
>>      build_image "$_optgenimg" "$_optcompress"
>> +elif [[ $_optsavetree ]]; then
>> +    msg "Build complete."
> 
> Maybe reaffirm the output directory here?

If the output directory cannot be accessed, the build should already
have failed in initialize_buildoot, right?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.archlinux.org/pipermail/arch-projects/attachments/20131119/e129c109/attachment.asc>


More information about the arch-projects mailing list