Commit Graph

5820 Commits

Author SHA1 Message Date
Andrew Gregory b9601b1e59 alpm: export *_free functions
Front-ends should be able to free memory that alpm hands them.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-04 13:48:37 +10:00
Andrew Gregory 953808a9ee pmtest: add memory check to tests with valgrind
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-04 13:45:11 +10:00
Andrew Gregory 4763341ea1 pmrule: add FILE_EMPTY rule
Succeeds if the specified path is a file and is empty.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-04 13:44:38 +10:00
Allan McRae 1601532a53 Give groups display text singular and plural forms
Reported on transifex

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-04 09:01:38 +10:00
Allan McRae 8014dc648f makepkg: remove unneeded "|| true"
makepkg only aborts on errors during PKGBUILD functions so the remaining
"|| true" statements are unneeded.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 17:37:58 +10:00
Allan McRae b449878fea makepkg: Fix typo in variable name
It turns out that you should refer to variables by their actual name...
Introduced in commit a521cea9.

FS#38414.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 17:31:51 +10:00
Rafael Ferreira 236f1795e9 Do not remove source code references in PO/POT files
FS#34240.  This is useful for translators and has little cost to us since
we moved to transifex for translations.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:32:55 +10:00
Lars Gustäbel 47a4741a3c Prevent makepkg creating armored signatures
If the user has "armor" in thier gpg.conf, makepkg will create an
ascii-armored signature. Use --no-armor in the gpg call to avoid.

FS#38503.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:30:59 +10:00
Pierre Neidhardt e4f6edf237 pacsearch: CLI option to turn off colors
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:12:29 +10:00
Pierre Neidhardt 1e07af1b0a pacsearch: using pacman color theme
No more per-repo coloring: this was not Arch-agnostic, and there is no
reasonable, simple way to color repos in a consistant manner with only 6 colors.

'local' is in red: this way we benefit from the pacman -Ss && pacman -Qs combo.

to_color subroutine: it takes an array instead of a string, this is faster and
simpler.

Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:12:29 +10:00
Pierre Neidhardt fe19a0c58d pacsearch: colors are portable (ANSI) and have natural variable names
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:12:29 +10:00
Pierre Neidhardt 15f4144e12 pacsearch: Explicitly extract group information
Also store pkgname and pkgver separately.

Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:12:29 +10:00
Pierre Neidhardt 135d862eb6 pacsearch: localized output
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:12:29 +10:00
Pierre Neidhardt 6fb2035dd0 pacsearch: more accurate help message
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:12:29 +10:00
Pierre Neidhardt c71efe6d62 pacsearch: Copyright year bump
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:12:29 +10:00
Jason St. John f5299d1752 makepkg.conf(5): Fix and improve grammar and spelling issues
Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:12:29 +10:00
Jason St. John 6268e66efa Remove ChangeLog.proto and move important info to PKGBUILD(5)
The change log prototype should be distribution determined.

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:12:27 +10:00
Jason St. John ccabeafb3d makepkg.conf(5): Add missing backticks around vars, and use single quotes around "gpg" command
Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:11:47 +10:00
Jason St. John 3dc87ec59a proto: Remove recommendation of "makepkg -g" in comments
This recommendation encouraged the practice of not checking the checksums
provided upstream.

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:11:47 +10:00
Maxime Gauduin edce7555a6 Add PKGBUILD-vcs.proto
This PKGBUILD proto covers the newly introduced VCS capabilities of
pacman. It serves as a replacement for the current bzr, git, hg and svn
protos found in ABS.

Signed-off-by: Maxime Gauduin <alucryd@gmail.com>

[Allan: add to Makefile.am]
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02 16:11:32 +10:00
Andrew Gregory aa4d3298fb table_display: free memory on errors
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30 14:22:27 +10:00
Andrew Gregory c2edd31eae _alpm_resolvedeps: free targ inside loop
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30 14:12:06 +10:00
Andrew Gregory fac9ac6c40 sync_prepare: manually set pm_errno
_alpm_resolvedeps resets pm_errno to 0 by calling alpm_checkdeps.
Whenever the last call succeeded, pm_errno was not properly set,
preventing pacman from properly handling the error and leaking
additional memory.  We know pm_errno should be ALPM_ERR_UNSATISFIED_DEPS
if resolvedeps has failed, so just set it manually.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30 14:02:31 +10:00
Andrew Gregory 4d68092e2f dump_pkg_full: fix optionalfor memory leak
alpm_pkg_compute_optional returns a generated list that needs to be
free'd.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30 13:46:58 +10:00
Andrew Gregory 6be08f76f6 local_db_populate: initialize empty pkgcache
If the db directory did not exist when local_db_populate was called, the
pkgcache wouldn't be initialized, causing pkghash_add_pkg to fail.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30 13:45:53 +10:00
Silvan Jegen 819b4cd54e Move NULL check before dereference
Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30 13:40:25 +10:00
Silvan Jegen 77da9dc974 Another NULL check removed
Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30 13:40:25 +10:00
Silvan Jegen cb8eae24c9 Another unneeded NULL check removed
Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30 13:40:25 +10:00
Silvan Jegen d895cae16c Remove unneeded NULL check
Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30 13:40:24 +10:00
Andrew Gregory aabb7c3cdd pacman: use exit status 0 for --help and --version
The user requesting usage or version information is not an error.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30 13:12:00 +10:00
Allan McRae 7ae25ac67f Consistently use 'directory' instead of 'folder'
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 21:37:00 +10:00
Andrew Gregory 333373f90e enable_colors: always set color strings
Only setting color strings when colors is true allowed subsequent
calls to enable colors but not disable them.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:52:46 +10:00
Andrew Gregory 5be7b6a1b2 pmtest: use valgrind --child-silent-after-fork
Silences false warnings after alpm forks to run install scripts.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:34:43 +10:00
Andrew Gregory d4def1c193 pmtest: use --gen-suppression=all with valgrind
Let valgrind do the work of writing any suppression rules needed by the
test suite.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:34:25 +10:00
Andrew Gregory 19b3ee6d39 pmtest: send valgrind output to var/log/valgrind
This will allow us to detect whether valgrind found any errors while
still preserving pacman's return code for tests.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:33:57 +10:00
Andrew Gregory deaed047fd valgrind.supp: add fakeroot/fakechroot errors
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:33:53 +10:00
Allan McRae 6fa7e8aff5 HACKING: mention tab size and line width
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:30:51 +10:00
Florian Pritz cd2370754a Remove ts and sw from vim modeline when noet is set
Forcing vim users to view files with a tabstop of 2 seems really
unnecessary when noet is set. I find it much easier to read code with
ts=4 and I dislike having to override the modeline by hand.

Command run:
find . -type f -exec sed -i '/vim.* noet/s# ts=2 sw=2##' {} +

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:19:25 +10:00
Jason St. John 83e14aeebd Add missing optdepends to the main list of variables in the split PKGBUILD prototype
Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:10:49 +10:00
Andrew Gregory e6464f0cb6 pacman.c: free string commandline options
Plugs a memory leak when values were passed twice.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:10:49 +10:00
Olivier Brunel 4e9d88aa05 Rename ALPM_EVENT_OPTDEP_REQUIRED to _OPTDEP_REMOVAL
Because this event is triggered when an optdepend for another package is
being removed.

Signed-off-by: Olivier Brunel <jjk@jjacky.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:10:49 +10:00
Olivier Brunel e65a752475 pacman: Fix delayed warnings/errors sent to stdout not stderr
Signed-off-by: Olivier Brunel <jjk@jjacky.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:10:48 +10:00
Andrew Gregory ffe7f6d161 pacman.c: remove unnecessary optarg checks
getopt takes care of making sure that options that require a value have
one.  These checks were only added to silence clang, which no longer
complains about optarg being unchecked, and newer options already use
optarg unchecked.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:10:48 +10:00
Andrew Gregory 8a434aeb46 sync_prepare: treat from_sync as a boolean
We only care that packages are being installed from a repo, not how
many.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-15 16:05:31 +10:00
Andrew Gregory 62c76cf825 base64.c: comment out unused variable
Commit e47eb9a7 commented out base64_encode, which left base64_enc_map
unused, causing warnings under clang.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-15 15:54:56 +10:00
Andrew Gregory b01c2aefd9 package.h: convert scriptlet field to int
It's a boolean, so signedness doesn't matter, and the public API already
exposes it as an int through alpm_pkg_has_scriptlet().

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-15 15:52:51 +10:00
Allan McRae bce495e56f Consistently use #ifdef
Fix the occurances of #if to be #ifdef for consistency.
2014-01-10 14:32:38 +10:00
Allan McRae 1d3b17e251 Fix build with --disable-gpgme
The alpm_decode_signature function was made available for frontends to
display signature information, but this required libalpm to be build with
gpgme support.  As that function did not require anything from gpgme,
have it build unconditionally.

Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-10 14:30:05 +10:00
Dan McGee 5097b162fc Fix compile warnings on systems without getmntent
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-10 14:30:05 +10:00
Andrew Gregory 00b6694068 Makefile.am: move test-suite.log into test/
Pushing down the testing .gitignore entries in commit e25afaf6 exposed
test-suite.log in the root.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-10 14:30:05 +10:00