[PATCH 2/2] makepkg: Fixed logging for split packages

View: New views
4 Messages — Rating Filter:   Alert me  

[PATCH 2/2] makepkg: Fixed logging for split packages

by Eric Bélanger-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Signed-off-by: Eric Bélanger <snowmaniscool@...>
---
 scripts/makepkg.sh.in |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index e2b28c1..180e128 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -142,7 +142,7 @@ clean_up() {
  rm -f "${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-package.log"*
  elif [ "$SPLITPKG" -eq 1 ]; then
  for pkg in ${pkgname[@]}; do
- rm -f "${pkg}-${pkgver}-${pkgrel}-${CARCH}-package.log"*
+ rm -f "${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-package_${pkg}.log"*
  done
  fi
  fi
@@ -707,6 +707,8 @@ run_function() {
  msg "$(gettext "Starting %s()...")" "$pkgfunc"
  cd "$srcdir"
 
+ local _pkgbase=$pkgbase
+
  # ensure all necessary build variables are exported
  export CFLAGS CXXFLAGS LDFLAGS MAKEFLAGS CHOST
  # save our shell options so pkgfunc() can't override what we need
@@ -714,7 +716,7 @@ run_function() {
 
  local ret=0
  if [ "$LOGGING" -eq 1 ]; then
- BUILDLOG="${startdir}/${pkgname}-${pkgver}-${pkgrel}-${CARCH}-$pkgfunc.log"
+ BUILDLOG="${startdir}/${_pkgbase}-${pkgver}-${pkgrel}-${CARCH}-$pkgfunc.log"
  if [ -f "$BUILDLOG" ]; then
  local i=1
  while true; do
--
1.6.5.2



Re: [PATCH 2/2] makepkg: Fixed logging for split packages

by Allan McRae-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Eric Bélanger wrote:

> Signed-off-by: Eric Bélanger <snowmaniscool@...>
> ---
>  scripts/makepkg.sh.in |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index e2b28c1..180e128 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -142,7 +142,7 @@ clean_up() {
>   rm -f "${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-package.log"*
>   elif [ "$SPLITPKG" -eq 1 ]; then
>   for pkg in ${pkgname[@]}; do
> - rm -f "${pkg}-${pkgver}-${pkgrel}-${CARCH}-package.log"*
> + rm -f "${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-package_${pkg}.log"*
>  

This looks good and makes the logging more consistent in terms of log
file naming.

>   done
>   fi
>   fi
> @@ -707,6 +707,8 @@ run_function() {
>   msg "$(gettext "Starting %s()...")" "$pkgfunc"
>   cd "$srcdir"
>  
> + local _pkgbase=$pkgbase
>  

Why are you doing this?  Can you not just use $pkgbase directly below?

> +
>   # ensure all necessary build variables are exported
>   export CFLAGS CXXFLAGS LDFLAGS MAKEFLAGS CHOST
>   # save our shell options so pkgfunc() can't override what we need
> @@ -714,7 +716,7 @@ run_function() {
>  
>   local ret=0
>   if [ "$LOGGING" -eq 1 ]; then
> - BUILDLOG="${startdir}/${pkgname}-${pkgver}-${pkgrel}-${CARCH}-$pkgfunc.log"
> + BUILDLOG="${startdir}/${_pkgbase}-${pkgver}-${pkgrel}-${CARCH}-$pkgfunc.log"
>   if [ -f "$BUILDLOG" ]; then
>   local i=1
>   while true; do
>  




Re: [PATCH 2/2] makepkg: Fixed logging for split packages

by Eric Bélanger-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Nov 3, 2009 at 9:08 AM, Allan McRae <allan@...> wrote:

> Eric Bélanger wrote:
>>
>> Signed-off-by: Eric Bélanger <snowmaniscool@...>
>> ---
>>  scripts/makepkg.sh.in |    6 ++++--
>>  1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>> index e2b28c1..180e128 100644
>> --- a/scripts/makepkg.sh.in
>> +++ b/scripts/makepkg.sh.in
>> @@ -142,7 +142,7 @@ clean_up() {
>>                                rm -f
>> "${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-package.log"*
>>                        elif [ "$SPLITPKG" -eq 1 ]; then
>>                                for pkg in ${pkgname[@]}; do
>> -                                       rm -f
>> "${pkg}-${pkgver}-${pkgrel}-${CARCH}-package.log"*
>> +                                       rm -f
>> "${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-package_${pkg}.log"*
>>
>
> This looks good and makes the logging more consistent in terms of log file
> naming.
>
>>                                done
>>                        fi
>>                fi
>> @@ -707,6 +707,8 @@ run_function() {
>>        msg "$(gettext "Starting %s()...")" "$pkgfunc"
>>        cd "$srcdir"
>>  +       local _pkgbase=$pkgbase
>>
>
> Why are you doing this?  Can you not just use $pkgbase directly below?
>
For some reasons, pkgbase wasn't defined anymore after the:
local shellopts=$(shopt -p)
line. But now it works. I've attached a new patch.

[0002-makepkg-Fixed-logging-for-split-packages.patch]

From e3cea2bdd83ea70fb1ce11374477363871a800ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eric=20B=C3=A9langer?= <snowmaniscool@...>
Date: Tue, 3 Nov 2009 08:47:18 -0500
Subject: [PATCH 2/2] makepkg: Fixed logging for split packages
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Eric Bélanger <snowmaniscool@...>
---
 scripts/makepkg.sh.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index e2b28c1..38cb26a 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -142,7 +142,7 @@ clean_up() {
  rm -f "${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-package.log"*
  elif [ "$SPLITPKG" -eq 1 ]; then
  for pkg in ${pkgname[@]}; do
- rm -f "${pkg}-${pkgver}-${pkgrel}-${CARCH}-package.log"*
+ rm -f "${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-package_${pkg}.log"*
  done
  fi
  fi
@@ -714,7 +714,7 @@ run_function() {
 
  local ret=0
  if [ "$LOGGING" -eq 1 ]; then
- BUILDLOG="${startdir}/${pkgname}-${pkgver}-${pkgrel}-${CARCH}-$pkgfunc.log"
+ BUILDLOG="${startdir}/${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-$pkgfunc.log"
  if [ -f "$BUILDLOG" ]; then
  local i=1
  while true; do
--
1.6.5.2





Re: [PATCH 2/2] makepkg: Fixed logging for split packages

by Allan McRae-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Eric Bélanger wrote:

> On Tue, Nov 3, 2009 at 9:08 AM, Allan McRae <allan@...> wrote:
>  
>> Eric Bélanger wrote:
>>    
>>> Signed-off-by: Eric Bélanger <snowmaniscool@...>
>>> ---
>>>  scripts/makepkg.sh.in |    6 ++++--
>>>  1 files changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>>> index e2b28c1..180e128 100644
>>> --- a/scripts/makepkg.sh.in
>>> +++ b/scripts/makepkg.sh.in
>>> @@ -142,7 +142,7 @@ clean_up() {
>>>                                rm -f
>>> "${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-package.log"*
>>>                        elif [ "$SPLITPKG" -eq 1 ]; then
>>>                                for pkg in ${pkgname[@]}; do
>>> -                                       rm -f
>>> "${pkg}-${pkgver}-${pkgrel}-${CARCH}-package.log"*
>>> +                                       rm -f
>>> "${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-package_${pkg}.log"*
>>>
>>>      
>> This looks good and makes the logging more consistent in terms of log file
>> naming.
>>
>>    
>>>                                done
>>>                        fi
>>>                fi
>>> @@ -707,6 +707,8 @@ run_function() {
>>>        msg "$(gettext "Starting %s()...")" "$pkgfunc"
>>>        cd "$srcdir"
>>>  +       local _pkgbase=$pkgbase
>>>
>>>      
>> Why are you doing this?  Can you not just use $pkgbase directly below?
>>
>>    
>
> For some reasons, pkgbase wasn't defined anymore after the:
> local shellopts=$(shopt -p)
> line. But now it works. I've attached a new patch.
>  

Looks good.  Applied to my working branch.

Allan