You are not logged in.

#1 2012-06-29 16:09:39

wmarshall
Member
Registered: 2012-06-29
Posts: 4

[SOLVED] makepkg error: Why is it looking for '.part' files?

I've been seeing the following problem with every package I try to build with makepkg.  The download works, but then makepkg complains that it can't find the source file:

==> Making package: android-sdk r20-2 (Fri Jun 29 11:01:35 CDT 2012)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving Sources...
  -> Downloading android-sdk_r20-linux.tgz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 78.7M  100 78.7M    0     0  1640k      0  0:00:49  0:00:49 --:--:-- 2166k
mv: cannot stat ‘/usr/local/src/android-sdk_r20-linux.tgz.part’: No such file or directory
==> ERROR: Failure while downloading android-sdk_r20-linux.tgz
    Aborting...

Why is it looking for the .part file, instead of the .tgz file?  When I run makepkg again, without doing anything in between, it finds the .tgz file and goes on its merry way.

I'm using curl, and I haven't tried wget.  Judging by my unscientific sample of forum posts it looks like wget is the de facto standard, so this may not be on anyone else's radar.

Here's my makepkg.conf:

#
# /etc/makepkg.conf
#

#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
#  Format: 'protocol::agent'
DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
          'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'rsync::/usr/bin/rsync -z %u %o'
          'scp::/usr/bin/scp -C %u %o')

# Other common tools:
# /usr/bin/snarf
# /usr/bin/lftpget -c
# /usr/bin/wget

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="x86_64"
CHOST="x86_64-unknown-linux-gnu"

#-- Compiler and Linker Flags
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j4"

#########################################################################
# BUILD ENVIRONMENT
#########################################################################
#
# Defaults: BUILDENV=(fakeroot !distcc color !ccache check !sign)
#  A negated environment option will do the opposite of the comments below.
#
#-- fakeroot: Allow building packages as a non-root user
#-- distcc:   Use the Distributed C/C++/ObjC compiler
#-- color:    Colorize output messages
#-- ccache:   Use ccache to cache compilation
#-- check:    Run the check() function if present in the PKGBUILD
#-- sign:     Generate PGP signature file
#
BUILDENV=(fakeroot !distcc color !ccache check !sign)
#
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster.
#DISTCC_HOSTS=""
#
#-- Specify a directory for package building.
#BUILDDIR=/tmp/makepkg

#########################################################################
# GLOBAL PACKAGE OPTIONS
#   These are default values for the options=() settings
#########################################################################
#
# Default: OPTIONS=(strip docs libtool emptydirs zipman purge !upx)
#  A negated option will do the opposite of the comments below.
#
#-- strip:     Strip symbols from binaries/libraries
#-- docs:      Save doc directories specified by DOC_DIRS
#-- libtool:   Leave libtool (.la) files in packages
#-- emptydirs: Leave empty directories in packages
#-- zipman:    Compress manual (man and info) pages in MAN_DIRS with gzip
#-- purge:     Remove files specified by PURGE_TARGETS
#-- upx:       Compress binary executable files using UPX
#
OPTIONS=(strip docs !libtool emptydirs zipman purge !upx)

#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
INTEGRITY_CHECK=(md5)
#-- Options to be used when stripping binaries. See `man strip' for details.
STRIP_BINARIES="--strip-all"
#-- Options to be used when stripping shared libraries. See `man strip' for details.
STRIP_SHARED="--strip-unneeded"
#-- Options to be used when stripping static libraries. See `man strip' for details.
STRIP_STATIC="--strip-debug"
#-- Manual (man and info) directories to compress (if zipman is specified)
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
#-- Doc directories to remove (if !docs is specified)
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
#-- Files to be removed from all packages (if purge is specified)
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)

#########################################################################
# PACKAGE OUTPUT
#########################################################################
#
# Default: put built package and cached source in build directory
#
#-- Destination: specify a fixed directory where all packages will be placed
PKGDEST=/usr/local/pkgs
#-- Source cache: specify a fixed directory where source files will be cached
SRCDEST=/usr/local/src
#-- Source packages: specify a fixed directory where all src packages will be placed
#SRCPKGDEST=/home/srcpackages
#-- Packager: name/email of the person or organization building packages
PACKAGER="Whitney Marshall <whitney.marshall@gmail.com>"
#-- Specify a key to use for package signing
GPGKEY="E4FB694E"

#########################################################################
# EXTENSION DEFAULTS
#########################################################################
#
# WARNING: Do NOT modify these variables unless you know what you are
#          doing.
#
PKGEXT='.pkg.tar.xz'
SRCEXT='.src.tar.gz'

# vim: set ft=sh ts=2 sw=2 et:

Last edited by wmarshall (2012-07-02 15:39:16)

Offline

#2 2012-06-29 16:16:52

wmarshall
Member
Registered: 2012-06-29
Posts: 4

Re: [SOLVED] makepkg error: Why is it looking for '.part' files?

It looks like this code is the culprit.  I don't have time to dig into it right now, but presumably this works with wget.  I would have thought any cmdline downloader would manage renaming the .part file itself...?

makepkg, lines 395-417 (pacman 4.0.3-2):

 395   # replace %o by the temporary dlfile if it exists
 396   if [[ $dlcmd = *%o* ]]; then
 397     dlcmd=${dlcmd//\%o/\"$file.part\"}
 398     dlfile="$file.part"
 399   fi
...
 414   # rename the temporary download file to the final destination
 415   if [[ $dlfile != "$file" ]]; then
 416     mv -f "$SRCDEST/$dlfile" "$SRCDEST/$file"
 417   fi

Offline

#3 2012-07-01 12:31:07

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] makepkg error: Why is it looking for '.part' files?

That piece of the code probably has to do with the option to give a download file a different name then the URI.

The DLAGENTS part of makepkg.conf is the new default, i have exactly the same and no problems at all with downloading / makepkg.

wmarshall, have you changed curl configuration (i haven't) ?
If so, try using curl with default configuration.

Last edited by Lone_Wolf (2012-07-01 12:31:28)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2012-07-01 13:04:40

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

Re: [SOLVED] makepkg error: Why is it looking for '.part' files?

That code causes makepkg to download a source file as <file>.part, which allows for downloads to be continued.  Once the complete download is done, makepkg moves <file>.part to <file> and all carries on....

Also, curl has been the default for quite some time now.


Edit: where is the .tgz file being downloaded to?   /usr/local/src or the directory with the PKGBUILD?

Offline

#5 2012-07-02 14:45:16

wmarshall
Member
Registered: 2012-06-29
Posts: 4

Re: [SOLVED] makepkg error: Why is it looking for '.part' files?

Yeah, my bad, turns out I had a .curlrc lurking in my home directory that had a -O in it, so curl was ignoring the -o option that makepkg included.  Getting rid of that fixed it.  That explains why I only had trouble with makepkg or yaourt, since those run as my user; pacman  (run as root) was working with curl just fine.

Even better than axing my curlrc, I added -q to the curl commands in my DLAGENTS, which ignores curlrc altogether.  Would this be a good change to propagate upstream?  Is there a situation where you want your curlrc to be in effect for makepkg?

Offline

#6 2012-07-02 14:54:51

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

Re: [SOLVED] makepkg error: Why is it looking for '.part' files?

wmarshall wrote:

Even better than axing my curlrc, I added -q to the curl commands in my DLAGENTS, which ignores curlrc altogether.  Would this be a good change to propagate upstream?

Yup. This seems like a reasonable addition.

Offline

Board footer

Powered by FluxBB