You are not logged in.

#1 2011-08-22 08:14:06

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

[solved] comment in PKGBUILD

hi to all

i'm trying to edit a PKGBUILD (amule-adnza-svn)
so i've added some comment but this breaks the build
http://pastebin.com/uENBbNui

where i make error/s ?

thanks

Last edited by nTia89 (2011-08-22 10:27:09)


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#2 2011-08-22 08:21:11

steabert
Member
Registered: 2011-04-18
Posts: 78

Re: [solved] comment in PKGBUILD

It helps if you tell people:
-> what exactly you changed/added
-> what exactly goes wrong (error messages)?

probably, it's because you left uncommented empty lines

Offline

#3 2011-08-22 08:31:32

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [solved] comment in PKGBUILD

yes, i get this:

....
....
....
....
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: executing denoiser commands


  Configure script has finished system check.

  Configured aMule 2.2.6 (AdunanzA mod) for 'x86_64-unknown-linux-gnu'.

  aMule enabled options:

  **** aMule Core ****
  Prefix where aMule should be installed?                    /usr
  Should aMule be compiled with i18n support?                yes
  Should aMule be compiled in debug mode?                    yes
  Should aMule be compiled with profiling?                   no
  Should aMule be compiled with optimizations?               no
  Should aMule be compiled with UPnP support?                no
  Should aMule be compiled with IP2country support?          no
  Should aMule monolithic application be built?              yes
  Should aMule daemon version be built?                      no
  Should aMule remote gui be built? (EXPERIMENTAL)           no
  Crypto++ library/headers style?                            installed

  **** aMule TextClient ****
  Should aMule Command Line Client be built?                 no

  **** aMule WebServer ****
  Should aMule WebServer be built?                           no

  **** aMule ED2K Links Handler ****
  Should aMule ED2K Links Handler be built?                  yes

  **** aMuleLinkCreator ****
  Should aMuleLinkCreator GUI version (alc) be built?        no
  Should aMuleLinkCreator for console (alcc) be built?       no

  **** aMule Statistics ****
  Should C aMule Statistics (CAS) be built?                  no
  Should aMule GUI Statistics (wxCas) be built?              no

  **** General Libraries and Tools ****
  Should ccache support be enabled?                          no
  Libraries aMule will use to build:
                                       wxWidgets             2.8.12 (gtk2,shared)
                                       crypto++              5.6.1 (installed, in /usr)
                                       libintl               system
                                       zlib                  1.2.5
/home/mattia/Desktop/amule-adnza-svn/PKGBUILD: line 66: --disable-debug: command not found
==> ERRORE: Si è verificato un errore in build().
    L'operazione sta per essere interrotta...

seeing to output, the compiler misunderstand the option coming after the commented line....
because removing commented lines everything works fine, the problem is just the commented part !


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#4 2011-08-22 08:46:27

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [solved] comment in PKGBUILD

Put the comments just before 'make'.

Offline

#5 2011-08-22 09:02:17

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,400
Website

Re: [solved] comment in PKGBUILD

    --disable-debug \
    --enable-optimize

are being treated as new commands.   Move them up to the main configure line.

Offline

#6 2011-08-22 09:59:47

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [solved] comment in PKGBUILD

ok, but this isn't the solution !

if

#

stand for comment line, the interpreter should skip TOTALLY these lines .....

but this doesn't happen......

why ?
perhaps

#

doesn't stand for comment ?


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#7 2011-08-22 10:06:36

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,400
Website

Re: [solved] comment in PKGBUILD

I does not even get to the first comment...  You have a blank line after "--disable-upnp \" which is the end of the command.

Offline

#8 2011-08-22 10:09:18

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [solved] comment in PKGBUILD

No, that is the solution. The comment is ignored and the command ends. Consider it a feature of Bash's parser. Still not happy? Report it to upstream.

If you want to insist on inline comments in the middle of a command, work around it with an array:

configureopts=(
  --prefix=/usr
  --optfoo

  # enable bar for more bar
  # --enable-bar

  # disable baz if you don't want baz
  # --disable-baz

  --enablemoreopts
)

./configure "${configureopts[@]}"

Offline

#9 2011-08-22 10:22:06

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [solved] comment in PKGBUILD

@ Allan:
ok, then i replace empty lines with commented empty lines
but this doesn't work.... so blank lines aren't the problem
-----

reading what falconindy says, this is a "strange" bash feature ...... so because i can't do anything, i can bypass it by using an array
i'll try it

EDIT: yay, this works. thanks very much falconindy. a question i can substitute array with a variable ?

Last edited by nTia89 (2011-08-22 10:26:58)


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#10 2011-08-22 11:09:19

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [solved] comment in PKGBUILD

No. That wouldn't be any different that trying to shove it in the middle of the command.  Comments inside simple variables are not possible.

Consider that what you're trying to do is essentially the same as ...

./configure --prefix foo # this is a comment
  --enable-bar

You can't continue that line and there's no way you can differentiate that comment from noncommented text inside a var.

Offline

#11 2011-08-22 12:12:08

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [solved] comment in PKGBUILD

ok


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

Board footer

Powered by FluxBB