You are not logged in.

#1 2015-03-10 08:45:40

PâtéDeCerf
Member
Registered: 2014-07-18
Posts: 16

[SOLVED] Error with PKGBUILD for package hash-identifier

Hi,

I tried to install the package hash-identifier.

While running makepkg -s, there is an error:

==> ERROR: PKGBUILD contains CRLF characters and cannot be sourced.

I guess this is due to the New Line character at line 17 of the PKGBUILD:

  sed -e 's|
||g' -i Hash_ID_v${pkgver}.py

So I remove it, but then I get this other error and I don't know what to do with it:

==> Extracting sources...
==> Starting prepare()...
sed: -e expression #1, char 0: no previous regular expression
==> ERROR: A failure occurred in prepare().
    Aborting...

Last edited by PâtéDeCerf (2015-03-11 08:18:34)

Offline

#2 2015-03-10 09:44:27

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] Error with PKGBUILD for package hash-identifier

So you turned it into

sed -e 's|||g' -i Hash_ID_v${pkgver}.py

What do you expect that to do?

To remove the carriage returns, you can use a special string with an escape sequence:

sed -e $'s|\r||g' -i Hash_ID_v${pkgver}.py

Also, I think python has no problem with CRLF line endings; the only problem is the CR in the shebang, so the 'g' flag isn't necessary (and then this could be merged with the other substitution in the PKGBUILD).

Offline

#3 2015-03-10 12:03:21

PâtéDeCerf
Member
Registered: 2014-07-18
Posts: 16

Re: [SOLVED] Error with PKGBUILD for package hash-identifier

Thanks for your reply. I'm not familiar with package build syntax nor python, so I don't understand everything you wrote.

It would be good if you could explain more clearly though.

By applying the change you propose, I was able to build the package and install it.

NB: To run the program, type from the command-line :

$ hash-id

...and not simply "hash-identifier" hmm

Last edited by PâtéDeCerf (2015-03-11 08:21:10)

Offline

Board footer

Powered by FluxBB