You are not logged in.

#1 2008-02-24 13:07:00

Jurassic
Member
Registered: 2006-10-31
Posts: 51

makepkg does not extract sources

Hi folks! I am trying to build bacula from AUR and Makepkg refuses to unpack the bacula.tar.gz. I was able to find what was happening but couldn't understand why.

/usr/bin/makepkg lines 618-631:

                local file_type=$(file -bizL "$file")
                local cmd=''
                case "$file_type" in
                        *application/x-tar*|*application/zip*|*application/x-zip*|*applica$
                                cmd="bsdtar -x -f $file" ;;
                        *application/x-gzip*)
                                cmd="gunzip -d -f $file" ;;
                        *application/x-bzip*)
                                cmd="bunzip2 -f $file" ;;
                        *)
                                # Don't know what to use to extract this file,
                                # skip to the next file
                                continue;;
                esac

For some reason it always falls through to the last case - skip to the next file.

sa@arch ~ $ file -bizL bacula-2.2.8.tar.gz
application/x-tar compressed-encoding=application/x-gzip
sa@arch ~ $ sudo pacman -Q file
file 4.23-1

Any idea what could be wrong and how to fix it?


Arch linux

Offline

#2 2008-02-24 13:21:28

bangkok_manouel
Member
From: indicates a starting point
Registered: 2005-02-07
Posts: 1,554

Re: makepkg does not extract sources

did you md5'd the archive to check if it's not corrupted ?


All design goals must be phrased in such a way that it is hard to use them as slogans to justify stupidity.

Offline

#3 2008-02-24 13:24:36

Jurassic
Member
Registered: 2006-10-31
Posts: 51

Re: makepkg does not extract sources

I didn't, makepkg did. Here's the output:

==> Making package: bacula-sqlite 2.2.8-3  (Sun Feb 24 08:23:02 EST 2008)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
  -> Found bacula-2.2.8.tar.gz in build dir
  -> Found bacula-dir in build dir
  -> Found bacula-fd in build dir
  -> Found bacula-sd in build dir
  -> Found bacula-2.2.8-sqlite.patch in build dir
==> Validating source files with md5sums...
    bacula-2.2.8.tar.gz ... Passed
    bacula-dir ... Passed
    bacula-fd ... Passed
    bacula-sd ... Passed
    bacula-2.2.8-sqlite.patch ... Passed
==> Extracting Sources...
==> Removing existing pkg/ directory...
==> Entering fakeroot environment...
==> Starting build()...
PKGBUILD: line 24: cd: /var/abs/local/bacula-sqlite/src/bacula-2.2.8: No such file or directory
PKGBUILD: line 28: ./configure: No such file or directory
make: *** No targets specified and no makefile found.  Stop.
==> ERROR: Build Failed.
    Aborting...

Arch linux

Offline

#4 2008-02-24 13:35:17

bangkok_manouel
Member
From: indicates a starting point
Registered: 2005-02-07
Posts: 1,554

Re: makepkg does not extract sources

looks like the problem is elsewhere... the package is extracted... seems to be only a directory name problem... check the name of the extracted directory and adjust your PKGBUILD


All design goals must be phrased in such a way that it is hard to use them as slogans to justify stupidity.

Offline

#5 2008-02-24 13:43:28

bangkok_manouel
Member
From: indicates a starting point
Registered: 2005-02-07
Posts: 1,554

Re: makepkg does not extract sources

hmmm... i may have posted too fast, my bad... i've check the PKGBUILD from AUR and it's working properly...

[edit]what happens when you untar the archive (out of the makepkg process) ? Is everything correct ? If yes, you can try makepkg -e, it won't untar the archive again...[/edit]

Last edited by bangkok_manouel (2008-02-24 13:45:34)


All design goals must be phrased in such a way that it is hard to use them as slogans to justify stupidity.

Offline

#6 2008-02-24 14:10:59

Jurassic
Member
Registered: 2006-10-31
Posts: 51

Re: makepkg does not extract sources

bangkok_manouel wrote:

looks like the problem is elsewhere... the package is extracted...

That's the problem, the package IS NOT extracted. Read the initial post.
There seems to be something wrong between "file" and mime types....


Arch linux

Offline

#7 2008-02-24 14:14:45

Jurassic
Member
Registered: 2006-10-31
Posts: 51

Re: makepkg does not extract sources

Hmmm...this piece of code always produces "unknown" on my machine. I just extracted it from makepkg and made standalone.
I wonder if same is true for any tar.gz file. Will test it next...

#!/bin/bash
file="bacula-2.2.8.tar.gz"
file_type=$(file -bizL "$file")
cmd=''
case "$file_type" in
        *application/x-tar*|*application/zip*|*application/x-zip*|*application/x-cpio*)
                cmd="bsdtar -x -f $file" ;;
        *application/x-gzip*)
                cmd="gunzip -d -f $file" ;;
        *application/x-bzip*)
                cmd="bunzip2 -f $file" ;;
        *)
                # Don't know what to use to extract this file,
                # skip to the next file
                #continue;;
                cmd="unknown";
esac
printf "${cmd}\n";

Arch linux

Offline

#8 2008-02-24 14:29:21

Jurassic
Member
Registered: 2006-10-31
Posts: 51

Re: makepkg does not extract sources

Okay, for every single *.tar.gz file I've tested "file -bizL" output is "application/x-tar compressed-encoding=application/x-gzip". And for all of them the script above failed to find a proper command for extracting source...Proly need a little more knowledge in bash to figure it out.


Arch linux

Offline

#9 2008-02-24 16:38:45

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: makepkg does not extract sources

really strange...
Could you add a "echo $file_type" in the script maybe just to check?
Are you using a strange locale? Apparently not, but well, I have no idea..


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#10 2008-02-24 17:18:45

Jurassic
Member
Registered: 2006-10-31
Posts: 51

Re: makepkg does not extract sources

"echo $file_type" produces "application/x-tar compressed-encoding=application/x-gzip", locale is "en_US.utf8"
I can extract tar.gz manually and then the build goes on fine. But I'd still like to find out why it fails !?


Arch linux

Offline

Board footer

Powered by FluxBB