1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00
Commit Graph

3741 Commits

Author SHA1 Message Date
Allan McRae
5a89a12aa0 pacman-key: improve usage output
Make the usage output display nicely on 80 character width terminals.

Also fix parsing of "-h" and "-v" options and avoid root check when
run with no commands.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-03-23 01:59:42 -05:00
Denis A. Altoé Falqueto
422925a65e pacman-key: remake of --reload command
The --reload command was refactored to allow a more flexible management.
There are two sets of keys that will be added, one that will be
removed and one that will be kept.

The set of keys to be kept are configured in pacman.conf, with the
option HoldKeys, with the same meaning of HoldPkgs. It can be repeated
and several values can be put in the same entry.

The new behavior allows a key to be marked for removal, but the user
can decide if that key must be kept. For example, if a developer has
a public repository, signed with his own key, that key must be added
to the HoldKeys option. If the key is marked for removal from pacman's
keyring, it will not be removed for the users that have configured
HoldKeys correctly.

There are other minor fixes, mainly in the handling of --add command
when there is no aditional parameter. In that case, pacman-key will
behave just like gpg, adding the contents of stdin into pacman's keyring.

Signed-off-by: Denis A. Altoé Falqueto <denisfalqueto@gmail.com>
2011-03-23 01:59:42 -05:00
Denis A. Altoé Falqueto
ae20f88202 pacman-key: keyring management tool
The script pacman-key will manage pacman's keyring. It imports, exports,
fetches from keyservers, helps in the process of trusting and updates
the trust database.

Signed-off-by: Denis A. Altoé Falqueto <denisfalqueto@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-03-23 01:59:42 -05:00
Allan McRae
93591d428f repo-add: add symlink to signature file
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-03-23 00:26:54 -05:00
Dan McGee
f0f8319769 repo-add: Fix up usage with GPG options
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 00:26:54 -05:00
Dan McGee
38f94da47d repo-add: add -v/--verify option
This is intended to verify an existing signature on a database before
making further changes to it and performing updates. Rarely would you
use this without immediately resigning it via the -s/--sign option.
Instead, it is intended as a "chain of trust" operation where the
previous signature is verified to give you some sense that what you sign
off on is also safe.

Still todo: don't make changes unless the signature is not only good,
but also in the accepted list of keys.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 00:26:54 -05:00
Dan McGee
a4120f2015 repo-add: allow signing of the package database
In order to be fully secure, we can't only sign packages. We also need
to sign our repository metadata to prevent database falsification,
dependency injection, etc. Add an '-s/--sign' option that allows this
functionality, and will generate a .sig file side-by-side with the
package database.

While at it, fix the issue where a signature file would never be found
because of 'cd' madness (this needs fixing in another commit).

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 00:26:54 -05:00
Geoffroy Carrier
8fde399fe6 Add PGPSIG field in repo-add
Use base64 encoding to store the value in the database if a .sig file exists
for the package being added.

Signed-off-by: Geoffroy Carrier <geoffroy.carrier@koon.fr>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 00:26:54 -05:00
Allan McRae
2f2f53ddc9 makepkg: place signature symlink in build dir
Be consistent in package and signature placements when using
PKGDEST.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-03-22 23:52:00 -05:00
Dan McGee
82e22596d8 makepkg: allow signatures to work with split packages
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-22 23:52:00 -05:00
Geoffroy Carrier
ee34869e89 Add GPG signature support to makepkg
This is a rather simple patch to add signing support to makepkg. Add a
create_signature() to makepkg, add a 'sign' BUILDENV option in makepkg.conf,
and document the changes in the makepkg.conf manpage.

Signed-off-by: Geoffroy Carrier <geoffroy.carrier@koon.fr>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-22 23:52:00 -05:00
Dan McGee
7b60a639d1 Minor code cleanups
Wrap lines of long length, noticed while creating and messing around
with some of the other maint branch patches.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21 09:02:03 -05:00
Dan McGee
110eb314f0 Ensure package removal list does not contain duplicates
Noticed with the openoffice/libreoffice replacement scheme where many
packages are listed as replacements to one package, thus electing it for
removal multiple times. Ensure a given package is not already present
before placing it in the removal list.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21 08:59:59 -05:00
Dan McGee
834ba4da93 Fix line_offset not being reset in _alpm_archive_fgets()
This is a rather serious data corruption issue that luckily manifested
itself today in a noticable way. A package in testing had replaces
entries read in as ["%RE pkgname", "%RE"] which was clearly wrong. This
happens when we hit the end of an archive block, do not have a newline,
and have to continue reading from the next block to complete the line.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21 08:52:24 -05:00
Dan McGee
0ff52b6845 Merge branch 'maint'
Conflicts due to change in return calling style.

Conflicts:
	src/pacman/pacman.c
	src/pacman/sync.c
2011-03-21 07:53:13 -05:00
Lukas Fleischer
c67c864ffd Don't initialize progress to zero before calling curl_easy_perform().
Drawing progress bars before calling curl_easy_perform() is needless as
the curl progress callback is called with zero progress before actually
downloading the file anyways. Fixes display of "0%" progress bars when
sync'ing package databases that are already up to date.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21 07:51:27 -05:00
Dan McGee
488f341f57 Ensure dlcb is defined before calling it
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21 07:50:31 -05:00
Allan McRae
b0bb4f9024 Do not query group selection when using -Sp
Remove unnecessary output when using -Sp.  Fixes FS#23340.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21 07:43:55 -05:00
Allan McRae
9cab9807e0 Some more zsh completion tidy up
Changes for consistency across functions

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21 07:40:49 -05:00
Allan McRae
c3e72e11b6 Fix zsh completion
Fixes completion for "pacman -S <tab>" and "pacman -S repo/<tab>"

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21 07:40:27 -05:00
Dan McGee
fd3acff5e6 Restore --debug/--verbose output without a primary operation
This is by no means a guarantee of this behavior remaining the same in
the future, but it is easy enough to do what we used to in this case by
delaying any sort of error condition until after we are completely done
parsing options. Addresses FS#23370.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21 07:40:13 -05:00
Dan McGee
d3b32a68fe Add a few more notes about translating using Transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 23:46:44 -05:00
Dan McGee
451f9493f5 Update source translation files in prep for 3.5.1
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 23:08:22 -05:00
Dan McGee
78e55be0e6 Remove unnecessary NULL check
fp can never be NULL at this point in the code, proven by Coccinelle.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 20:11:11 -05:00
Dan McGee
32e35d4028 Fix comparison to 0 rather than NULL
Another fix found by Coccinelle example semantic patches.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 20:10:19 -05:00
Dan McGee
bdc1508a06 Fix assignment before NULL check
Easy fix, found using null_ref.cocci example Coccinelle script.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 19:56:55 -05:00
Dan McGee
0303b26b1e Style change: return(x) --> return x
This was discussed and more or less agreed upon on the mailing list. A
huge checkin, but if we just do it and let people adjust the pain will
end soon enough. Rebasing should be relatively straighforward for anyone
that sees conflicts; just be sure you use the new return style if
possible.

The following semantic patch was used to do the change, along with some
hand-massaging in order to preserve parenthesis where appropriate:

The semantic match that finds this problem is as follows, although some
hand-massaging was done in order to keep parenthesis where appropriate:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression a;
@@
- return(a);
+ return a;

// </smpl>

A macros_file was also provided with the following content:

Additional steps taken, mainly for ASSERT() macros:
$ sed -i -e 's#return(NULL)#return NULL#' lib/libalpm/*.c
$ sed -i -e 's#return(-1)#return -1#' lib/libalpm/*.c

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 19:49:45 -05:00
Dave Reisner
0cf05c77ad lib/dload.c: fix opening braces to conform with coding style
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 18:49:01 -05:00
Dan McGee
b2fde01c54 Merge branch 'maint' 2011-03-20 11:49:42 -05:00
Dan McGee
67c0e9cab3 Add missing include for size_t
Needed for things like our strndup() substitute function.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 11:45:17 -05:00
Dave Reisner
524b338974 INSTALL: replace libfetch with libcurl
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 11:32:08 -05:00
Dave Reisner
352b799efc lib/dload.c: remove lingering libfetch specific headers
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 11:32:02 -05:00
Lukas Fleischer
b0f9477f01 Fix libtool and LDFLAGS reordering issues
This is a Debian patch (from #347650) that makes libtool play nicely
with "-Wl,--as-needed".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 11:22:41 -05:00
Pang Yan Han
58df372be6 Fix handling of ignored packages
Noted in FS#23342. When the user attempts to install an ignored package
and answers no when asked whether to install it, pacman bails out with:

"error: target not found: packagename"

This is because satisfiers are not found for the package and execution
continues to process_group(), where the package is treated as a group
(which does not exist).

In addition, test ignore006.py is updated with PACMAN_RETCODE=0 since
saying no to installing an ignored package should not be considered an
error.

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 11:17:41 -05:00
Allan McRae
f6716ae94a Use sane umask for repo db downloads
Fixes FS#23343.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 11:17:00 -05:00
Allan McRae
b6cada3eed makepkg: Improve optdepends extraction
Prevents issues where optdepends descriptions contain a bracket.
Also, strip all comments from arrays before joining them.

Fixes FS#23307.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20 11:15:34 -05:00
tuxce
b48f718417 Correctly parse %DELTAS% entries in sync DB
We erroniously dropped the call to _alpm_delta_parse() when macro-izing,
causing segfaults for repos that provide deltas. Addresses FS#23314.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-17 10:51:44 -05:00
Dave Reisner
ff713a51bd remove antiquated contrib/wget-xdelta.sh
Support for this script was removed in makepkg by commit b4e1365. Delta
creation support has been provided by scripts/pkgdelta.

Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-17 10:05:33 -05:00
Dave Reisner
0da6c591c0 Fix triple progress bars on download
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-17 10:05:26 -05:00
Dan McGee
e47fc2d7c6 Ensure we have a root partition when checking space
Partially addresses the "why doesn't CheckSpace work in a chroot" issue.
We can't make it work, but we can at least detect when it won't work by
checking for a partition for our given installation root. If we can't
determine the mountpoint for this, bail out with an error.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-17 09:33:04 -05:00
Dan McGee
e6c9076a74 Merge branch 'maint' 2011-03-16 19:55:28 -05:00
Dave Reisner
308aa38a40 pacman.8: (re)document behavior of reading from stdin
Change the term 'packages' to 'targets' in the synopsis as well, since
command line parameters could just as well be groups, repos, or URLs.

Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16 19:54:32 -05:00
Dan McGee
3707d5bc46 Warn but don't error for unknown pacman.conf directives
This makes all the pacman developers' jobs harder as we have to switch
files whenever running multiple pacman versions and are using newly
introduced options. Instead of erroring out, print warnings and continue
on.

This patch also fixes a const-correctness issue. We immediately cast a
'const char *' to a 'char *' in setrepeatingoption(), which is just
plain wrong as we manipulate the underlying string. Fix the types and
remove the now unnecessary variable.

Finally, a few messages change here for consistency and clarity and
because we continue parsing rather than bailing out on a problem.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16 19:52:54 -05:00
Dave Reisner
40a6c5c5ec Only read from stdin if '-' is provided as a target
This prevents a regression for people who enjoy piping yes to pacman to
avoid prompts.

Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16 19:52:54 -05:00
Dave Reisner
deed0286ef alpm_list: fix typo in doxygen comment
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16 19:52:54 -05:00
Dan McGee
e28c47ade3 Update translations for message with added newline
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16 19:52:54 -05:00
Allan McRae
771c002c98 Add missing newline to warning message
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16 19:52:54 -05:00
Dan McGee
f1ea4c8d24 Update index.txt with 3.5.0 release
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16 19:52:54 -05:00
Dan McGee
cff36093f3 Merge branch 'download' 2011-03-16 19:25:35 -05:00
Dan McGee
92630c6607 Bump pacman versions
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16 10:40:05 -05:00