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 01-08-2012, 11:04 AM
Allan McRae
 
Default makepkg: fix missing source file detection

Declaring the variable as local on the same line as the assignment
results in result of the assignment being returned rather than the
result of the function on the righthand side of the assignment.

Declaring the variable as local on a separate line means the result
of the function on the r.h.s. is returned and our error function
will be invoked if necessary (although it is practically impossible
to ever trigger it...).

Signed-off-by: Allan McRae <allan@archlinux.org>
---

@Dave: is my explanation correct there?

scripts/makepkg.sh.in | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index b06c78a..cfdb530 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -624,7 +624,8 @@ generate_checksums() {

local netfile
for netfile in "${source[@]}"; do
- local file="$(get_filepath "$netfile")" || missing_source_file "$netfile"
+ local file
+ file="$(get_filepath "$netfile")" || missing_source_file "$netfile"
local sum="$(openssl dgst -${integ} "$file")"
sum=${sum##* }
(( ct )) && echo -n "$indent"
--
1.7.8.1
 
Old 01-08-2012, 05:08 PM
Dave Reisner
 
Default makepkg: fix missing source file detection

On Sun, Jan 08, 2012 at 10:04:20PM +1000, Allan McRae wrote:
> Declaring the variable as local on the same line as the assignment
> results in result of the assignment being returned rather than the
> result of the function on the righthand side of the assignment.
>
> Declaring the variable as local on a separate line means the result
> of the function on the r.h.s. is returned and our error function
> will be invoked if necessary (although it is practically impossible
> to ever trigger it...).
>
> Signed-off-by: Allan McRae <allan@archlinux.org>
> ---
>
> @Dave: is my explanation correct there?

Spot on.

> scripts/makepkg.sh.in | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index b06c78a..cfdb530 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -624,7 +624,8 @@ generate_checksums() {
>
> local netfile
> for netfile in "${source[@]}"; do
> - local file="$(get_filepath "$netfile")" || missing_source_file "$netfile"
> + local file
> + file="$(get_filepath "$netfile")" || missing_source_file "$netfile"
> local sum="$(openssl dgst -${integ} "$file")"
> sum=${sum##* }
> (( ct )) && echo -n "$indent"
> --
> 1.7.8.1
>
>
 

Thread Tools




All times are GMT. The time now is 09:56 PM.

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