Commit Graph

5106 Commits

Author SHA1 Message Date
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
Dave Reisner c4ea4e017f updpkgsums: add new contrib script
This updates checksums in a PKGBUILD in-place. If no sums are found,
they are appended to the end.
2012-05-20 17:55:32 -05:00
Dave Reisner e533478e02 fix -Wshadow warnings as reported by gcc 4.4.3
Apparently gcc 4.7 has decided that -Wshadow warnings aren't worth
reporting anymore even with the flag enabled. These were found on
an Ubuntu 10.04 install.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 17:54:42 -05:00
Dave Reisner 363894e27b contrib/pacsysclean: use a standard vim modeline
Fix indenting to something more familiar with the rest of the codebase.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 17:41:32 -05:00
Dan McGee 9f6a67fee7 Merge branch 'maint'
Conflicts:
	scripts/pacman-key.sh.in
2012-05-20 17:41:21 -05:00
Dave Reisner fc9002188b pacman-key: use mapfile over read
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-20 17:39:21 -05:00
Dave Reisner 9d3e59e311 makepkg: use mapfile where plausible
With bash4 as a requirement, we can use mapfile when reading command
output into an array. mapfile has the advantage of using block buffered
I/O rather than line buffered I/O, making it slightly faster for most
jobs.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-20 17:39:21 -05:00
Dave Reisner c2fdc38b78 pacman: support group selection delimited by commas
We support multiple arguments being comma separated elsewhere, so this
seems like a natural extension to support in our multiparse selection
code.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 17:38:33 -05:00
Dave Reisner ceb2362209 pkgdelta: adopt parseopts for option parsing
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 17:38:33 -05:00
Dave Reisner 5de465d63e pacman-key: test for content in keyring files
Test for file content (-s) rather than just existance (-f). This fixes a
bug that manifests itself in the case of an empty -revoked file. A zero
element 'keys' array would be passed to gpg, forcing it to list and,
subsequently, revoke all known keys.

Bug introduced in d1240f67ea.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 17:35:31 -05:00
Dave Reisner 233e5f610c contrib/pacsysclean: avoid setting bogus PACMAN_OPTS
PACMAN_OPTS would be erroneously set when it was undefined, causing
pacsysclean to error out.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 17:30:41 -05:00
Dan McGee 26abe8f600 Fix gettext usage in pkgdelta help instructions
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 11:27:36 -05:00
Dan McGee 2671581123 Update pacman-scripts message catalog
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-20 11:22:51 -05:00
Dan McGee 951d23e3ec docs: remove 'in the wild' section
We haven't updated this info in years and it is out of date.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18 10:04:27 -05:00
Dan McGee 9e2078b179 pacman-key: clarify messages, s/keychain/keyring/
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-04 15:01:53 -05:00
Dan McGee 3f202c7808 doc: remove --recursive documentation for non-remove operations
This documentation was added in commit 857357f9 so was not caught in the
removal of this option in commit 85712814.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-04 14:37:48 -05:00
Dan McGee 1bf05e706b Ensure pre_upgrade scriptlet gets old package version
This was accidentally broken in the refactor done in commit 73139ccb.

Fixes FS#29371.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-04 11:41:40 -05:00