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 06-20-2010, 10:39 AM
Allan McRae
 
Default makepkg: less code duplication in create_package

On 17/06/10 22:44, Andres P wrote:

Combine changelog and install file creation as in previous commits.

Signed-off-by: Andres P<aepd87@gmail.com>
---
scripts/makepkg.sh.in | 26 +++++++++++---------------
1 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 0bfb607..37241bd 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -996,21 +996,17 @@ create_package() {

local comp_files=".PKGINFO"

- # check for an install script
- if [[ -n $install ]]; then
- msg2 "$(gettext "Adding install script...")"
- cp "$startdir/$install" .INSTALL
- chmod 644 .INSTALL
- comp_files="$comp_files .INSTALL"
- fi
-
- # do we have a changelog?
- if [[ -n $changelog ]]; then
- msg2 "$(gettext "Adding package changelog...")"
- cp "$startdir/$changelog" .CHANGELOG
- chmod 644 .CHANGELOG
- comp_files="$comp_files .CHANGELOG"
- fi
+ # check for changelog/install files
+ for i in 'changelog' 'install'; do
+ orig="${!i}"
+ dest=".${i^^}"


That is a bash4 command so will break cygwin compatibility (which
currently has bash-3.2). Resubmit with something like "tr [:lower:]
[:upper:]" usage.


(I know the ${i^^} is used elsewhere, but that slipped passed my notice
and will be being reverted.



+ if [[ -n $orig ]]; then
+ msg2 "$(gettext "Adding %s file...")" "$i"
+ cp "$startdir/$orig" "$dest"
+ chmod 644 "$dest"
+ comp_files+=" $dest"
+ fi
+ done

# tar it up
msg2 "$(gettext "Compressing package...")"
 
Old 06-20-2010, 05:21 PM
Andres P
 
Default makepkg: less code duplication in create_package

On Sun, Jun 20, 2010 at 6:09 AM, Allan McRae <allan@archlinux.org> wrote:
> That is a bash4 command so will break cygwin compatibility (which currently
> has bash-3.2). *Resubmit with something like "tr [:lower:] [:upper:]" usage.
>
> (I know the ${i^^} is used elsewhere, but that slipped passed my notice and
> will be being reverted.
>

bash_completion also has bash 4 only items...

Please write a style guide for all shell scripts....

Andres P
 
Old 06-21-2010, 03:54 AM
"Allan McRae"
 
Default makepkg: less code duplication in create_package

On 21/06/10 03:21, Andres P wrote:

On Sun, Jun 20, 2010 at 6:09 AM, Allan McRae<allan@archlinux.org> wrote:

That is a bash4 command so will break cygwin compatibility (which currently
has bash-3.2). Resubmit with something like "tr [:lower:] [:upper:]" usage.

(I know the ${i^^} is used elsewhere, but that slipped passed my notice and
will be being reverted.



bash_completion also has bash 4 only items...


Can you point them out?


Please write a style guide for all shell scripts....


Yes, _someone_ should... I have put it low down on my ever growing TODO
list.


Allan
 

Thread Tools




All times are GMT. The time now is 05:47 AM.

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