Commit Graph

4922 Commits

Author SHA1 Message Date
Barbu Paul - Gheorghe e94876089a Fix wrong parameter name in alpm_db_update's signature
Signed-off-by: Barbu Paul - Gheorghe <barbu.paul.gheorghe@gmail.com>
2012-08-01 09:14:52 -05:00
Dan McGee f619bc61f5 Clean up exclusion list in sync cache cleanup
Make an array out of our various glob skip patterns and loop through
them looking for items to skip. Additionally, when doing a full clean,
delete all objects rather than respect this skip list.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01 09:14:40 -05:00
Dan McGee cc6fb2e8a7 Skip deltas and partial downloads in package cleanup
This affects -Sc only, not -Scc.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01 09:14:32 -05:00
Andrew Gregory 3fb934b59a pactree: show tree vertical "limbs"
Showing vertical limbs makes the tree easier to follow.

Old:            New:
|--pkg          |--pkg
   |--dep1         |--dep1
      |--dep2      |  |--dep2
   |--dep3         |--dep3
      |--dep4         |--dep4

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
[Allan: fix shadow warning]
Signed-off-by: Allan McRae <allan@archlinux.org>

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01 09:12:45 -05:00
Andrew Gregory a6bd14285d pactree: consolidate both walk_deps functions
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
[Allan: fix shadow warning]
Signed-off-by: Allan McRae <allan@archlinux.org>

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01 09:12:29 -05:00
Dave Reisner ddbd36103d util: fix line length calc in _alpm_archive_fgets
74274b5dc3 which added the real_line_size to the buffer struct
didn't properly account for what happens when archive_fgets has to loop
more than once to find the end of a line. In most cases, this isn't a
problem, but could potentially cause a longer line such as PGP signature
to be improperly read.

This patch fixes the oversight and focuses on only calculating the line
length when we hit the end of line marker. The effective length is then
calculated via pointer arithmetic as:

  (start_of_last_read + read_length) - start_of_line

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-08-01 08:53:10 -05:00
Dave Reisner 35ac4e7ef3 lib/conflict: use a binary search within filelists
Take advantage of the fact that our filelists are arrays sorted by
filename with a known length and use a binary search. This should speed
up file conflict checking, particularly when larger packages are
involved.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01 08:53:10 -05:00
Dave Reisner c5e7eeece7 lib/be_local: ensure local filelists are sorted
This may very well be a no-op, but better safe than sorry.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01 08:53:10 -05:00
Dave Reisner 8fe383860e lib/be_package: use qsort instead of our own msort
On the assumption that these arrays are already mostly sorted, use the
standard quicksort method to sort the files arrays. The files_msort
function name is tweaked to give it a more general name to reflect this
change.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01 08:53:10 -05:00
Dan McGee e41ca0f2f6 Merge branch 'maint'
Conflicts:
	etc/makepkg.conf.in
2012-07-10 08:41:18 -05:00
Dave Reisner 392fffe241 pacman: be more descriptive when opening an include fails
if fopen returns NULL, append the libc strerror-ized error message to
our own error message.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-10 08:39:20 -05:00
Dave Reisner e0daaea38c update comments referring to alpm_option_get_syncdbs
This function was renamed alpm_get_syncdbs as part of b488f229d.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-07-10 08:37:59 -05:00
Dave Reisner 5c1ba2d5fd makepkg.conf: add -q option for curl
Avoid involving the user's ~/.curlrc file as this may alter the expected
behavior of downloads.

ref: https://bbs.archlinux.org/viewtopic.php?pid=1124441

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-10 08:36:20 -05:00
Dave Reisner d7c3164fd5 makepkg.conf: enable curl's cookie engine for http
Implements FS#28098.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-10 08:36:17 -05:00
Dave Reisner ea3439f928 diskspace: log errors when opening the mount table fails
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-10 08:33:33 -05:00
Allan McRae 44e9fdd0e8 Check empty subdirectory ownership
When checking if a package owns a directory, it is important to check
not only that all the files in the directory are part of the package,
but also if the directory is part of a package.  This catches empty
subdirectories during conflict checking for directory to file/symlink
replacements.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-10 08:31:48 -05:00
Allan McRae 717fdb8ee0 Add conflict for replacing owned empty directory
When two packages own an empty directory, pacman finds no conflict when
one of those packages wants to replace the directory with a file or a
symlink.  When it comes to actually extracting the new file/symlink,
pacman sees the directory is still there (we do not remove empty
directories if they are owned by a package) and refuses to extract.

Detect this potential conflict early and bail. Note that it is a
_potential_ conflict and not a guaranteed one as the other package owning
the directory could be updated or removed first which would remove
the conflict.  However, pacman currently can not sort package installation
order to ensure this, so this conflict requires manual upgrade ordering.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-10 08:29:37 -05:00
Ram Bhamidipaty d6f31dc788 Add man page for pactree
Add a man page for the pactree utility.

Feedback-from: Allan McRae <allan@archlinux.org>
Feedback-from: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Ram Bhamidipaty <rambham@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-10 08:02:08 -05:00
Allan McRae 0c62b36c19 Allow leading "local/" in query operations
I find that when copying the output of "pacman -Qs foo" into a
"pacman -Qi" operation to get more information on the packages, I
consistently copy the "local/" prefix. It is a minor usability
improvement to strip this if present.

Dan: Pluck out LOCAL_PREFIX and magic numbers.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-06-25 23:43:36 -05:00
Allan McRae 47711947dd Scripts testsuite output consistency
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-06-25 23:39:52 -05:00
Dave Reisner b1bb2eaa50 paccache: adopt size_to_human
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-25 23:39:46 -05:00
Dave Reisner a98fce0896 scripts/library: add size_to_human
This function is the reverse of human_to_size, and converts integer byte
sizes to human readable SI prefixed values.

A logical extension of this might be to mimic the formatter that pacman
uses and allow a second argument to be passed in which can coerce the
size, rather than reducing until the unit count is below 1024.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-25 23:39:34 -05:00
Dave Reisner ab8431c929 pkgdelta: use human_to_size to parse --min-pkg-size
Update the documentation accordingly to mention that users can expect
huamn readable sizes to be acceptable.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-25 23:39:28 -05:00
Dave Reisner b58489d29a scripts/library: add human_to_size
This is a bash wrapper around an awk function that parses human readable
sizes and returns their representative values in bytes, as a string. A
small test harness is added to validate the functionality.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-25 23:39:12 -05:00
Dave Reisner e183522e31 diskspace: only load filesystem info on demand
Only load filesystem details for the mount points that we're actually
going to write to. This reduces our syscall count considerably. In the
case of installation, we would actually stat every mountpoint twice (an
extra round for download diskspace) which means (on my system) a total
of 60 syscalls to write to 3 partitions when installing the kernel
package. This change reduces the 60 syscalls down to the expected 3.

A slight debug output change is added here to discern between a
mountpoint added to our linked list versus when we actually load the fs
info.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:37:10 -05:00
Dave Reisner 82c999a8bf diskspace: dedupe code for loading FS usage
add mount_point_load_fsinfo() for platforms using getmntent().

Dan: move the #ifdef slightly so we don't have unused functions on
certain platforms (e.g., OS X).

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:26:50 -05:00
Daniel Wallace 377cc23a09 zsh-completion: Allow use of names in pacman-key
With pacman-key now having the ability to use names in --list-keys etc,
we can remove the comments that temporarily blocked this in the zsh
completion file.

Signed-off-by: Daniel Wallace <daniel.wallace@gatech.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-06-25 23:09:04 -05:00
Jason St. John 12866ba791 Added syntax highlighting for the sha256sums, sha384sums, and sha512sums arrays Fixed FS#29213
Signed-off-by: Jason St. John <jstjohn .. purdue . edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:08:35 -05:00
Allan McRae 5951e9ce84 contrib: fix typo in PKGBUILD.vim
FS#30156

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:08:23 -05:00
Allan McRae e253968b4d repo-add: add checkdepends information
Similar to the case for makedepends, it is useful to be able to
access this information without parsing a PKGBUILD.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-06-25 23:08:15 -05:00
Allan McRae 81dd6ddf0c makepkg: install deps with --repackage
I have noticed that quite a number of packages fail with "makepkg -R"
when their (make)dependencies are not installed. Adjust makepkg to
check for dependencies when used with -R.  This can still be avoided
by using --nodeps/-d.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-06-25 23:08:08 -05:00
Jeremy Huntwork d310b6f85c Allow wildcards in PURGE_TARGETS to match any type of file except for directories.
Signed-off-by: Jeremy Huntwork <jhuntwork@lightcubesolutions.com>
2012-06-25 23:07:49 -05:00
Allan McRae 3a24e44206 makepkg: allow url to be overridden in split packages
This is already being used (despite not working...) in packages
in the Arch Linux repos.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:07:03 -05:00
Jeremy Huntwork 19c2347507 Portability fixes for makepkg
Allow makepkg to work correctly when used with find from busybox.
Fix handling of cross directory symlinks.

Signed-off-by: Jeremy Huntwork <jhuntwork@lightcubesolutions.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-06-25 23:06:43 -05:00
Dave Reisner da0dcc29cf query: avoid false ownership matches for files in root
Check for an exact match when querying ownership of files in the root.
Previously, our test was too simple and would match the the basename of
package files against the query parameter, e.g.

  $ pacman -Qo config
  /config is owned by cower-git 20120614-1

Adds a new test to verify this behavior, query007.py.

Fixes FS#30388.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:05:59 -05:00
Dave Reisner c6e47cb435 updpkgsums: avoid fancy quoting in error message
m4 has a field day parsing escapes and actually vandalizes this string,
causing the error to look like:

 ==> ERROR: \PKGBUILD\ not found or is not a file

Avoid all quoting and just match up with how makepkg reports errors (no
quoting at all).

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:05:26 -05:00
Dave Reisner 9f751bf492 contrib: sed out @SCRIPTNAME@ in edit command
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:05:14 -05:00
Dave Reisner f556fe8b4a add line length parameter to _alpm_strip_newline
If known, callers can pass the line size to this function in order to
avoid an strlen call. Otherwise, they simply pass 0 and
_alpm_strip_newline will do the call instead.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:04:31 -05:00
Dave Reisner 74274b5dc3 add real_line_size to alpm_read_buffer
We inevitably call strlen() or similar on the line returned from
_alpm_archive_fgets(), so include the line size of the interesting line
in the struct.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:04:24 -05:00
Dave Reisner 7245bc8e8e pkgdelta: add missing --version longopt
This was missed in the switch to parseopts, and was caught by distcheck.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:02:05 -05:00
Dave Reisner 6a5370b634 check proper variable for NULL
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:01:28 -05:00
Allan McRae 1d32934769 Create repo-remove symlink in scripts dir
Fix the creation of the repo-remove symlink in the scripts/ dir
on building.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-06-25 23:00:41 -05:00
Dave Reisner 9ce4f80db4 diskspace: canonicalize path to download dir
With lazy loading in place, it's now quite obvious that we aren't
necessarily checking the right mountpoint for necessary download space.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-25 23:00:12 -05:00
Andrew Gregory ac990b96e7 libalpm/remove.c - add doxygen
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-21 00:03:20 -05:00
Dave Reisner a64a8d6cea paccache: allow running as root
The main motivation for this change is to allow this to be run as a cron
job.

Satisfies FS#29897 and some other undocumented requests for this.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-20 19:32:58 -05:00
Allan McRae 9a76a458b8 makepkg: rework libdepends
Rewrite the handling of libdepends. The primary advantage are:
 - Moves functionality from write_pkginfo() to find_libdepends().
 - The order of the depends array in the PKGBUILD is kept in the package.
 - An unneeded libdepends is only a warning and not an error. This allows
   putting a libdepend on a library that is dlopened.
 - It is now modular so can be extended to library types other than
   ELF *.so.
 - Finding the list of libraries a package depends only occurs when a
   libdepend is specified in the depends array.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-05-20 19:04:38 -05:00
Allan McRae 81bc390dc1 repo-add: add makedepends information
This is useful for tools that automatically rebuild packages and
thus require to generate a build order. These entries are skipped
by pacman.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 19:03:43 -05:00
Allan McRae 18e0a97209 makepkg: write makedepends into .PKGINFO
Currently there is no way to access the makedepends for a package
apart from parsing its PKGBUILD. Put these into the .PKGINFO file
with the idea of making them available in the repo dbs so that
automated build tools can readily determine build order.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 19:00:42 -05:00
Allan McRae 7eb6dc2a9c Define _FORTIFY_SOURCE in CPPFLAGS
The -D_FORTIFY_SOURCE=2 define should be in CPPFLAGS and not CFLAGS

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 19:00:14 -05:00
Allan McRae 8abef73ba9 makepkg: Add CPPFLAGS support
Add CPPFLAGS support in addition to the current CFLAGS and CXXFLAGS.
This keeps compiler flags split up in the same logical way done
everywhere else.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 18:58:17 -05:00