summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* pacman-key: move verifying keyring files to own functionAllan McRae2011-07-19
| | | | | | Also check all files before bailing on errors. Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman-key: move --edit-key and --receive processing to functionsAllan McRae2011-07-19
| | | | | | | | | | | This moves the processing of the --edit-key and --receive options to functions, keeping the final option processing to be all single line statements. Also rework the --edit-key option to validate all input before processing. Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman-key: update man pageAllan McRae2011-07-19
| | | | | | | Update man page to reflect current options. Also add a description on how to manually interact with the pacman keyring with gpg. Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman-key: hide output of executed commands on logic checksIvan Kanakarakis2011-07-19
| | | | | | | | | This commit correctly redirects to /dev/null the output of several commands that get executed on logic checks. Original-patch-by: Denis A. Altoé Falqueto <denisfalqueto@gmail.com> Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman-key: rename --trust to --edit-keyAllan McRae2011-07-19
| | | | | | | | This keeps the naming of the option more consistent with what is actually being called by gpg. Original-patch-by: Denis A. Altoé Falqueto <denisfalqueto@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman-key: fix quotation on several variable assignmentsIvan Kanakarakis2011-07-19
| | | | | | | | This commit adds quotes to several variable assignments. Unquoted values can cause problems on several occasions if the value is empty. It is safer to have every assignment quoted. Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
* pacman-key: allow the export of all key idsAllan McRae2011-07-19
| | | | | | | The gpg --export will exprt all keys if none are specified. Replicate this behavior in pacman-key. Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman-key: rename --del to --deleteAllan McRae2011-07-19
| | | | | | | There is already the short -d alias provided, so stay verbose with the longer option name. Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman-key: remove the --adv optionAllan McRae2011-07-19
| | | | | | | | | | | | | The conversion to using parse_options causes this option to break. It is preferable to remove the option rather than fix it as it is simply a wrapper for "gpg --homedir @sysconfdir@/pacman.d/gnupg". Any user using more advanced keyring management than provided by pacman-key can manage to point gpg at the right place themselves... How to manually edit the keyring with gpg will instead be documented in the man page in a later commit. Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman-key: use our option parserAllan McRae2011-07-19
| | | | | | | | | | | | | | | | The pacman-key script is complicated enough to warrent usage of the parse_options script. This is especially helpful in dealing with all the configuration file override flags as the no longer need to be specified first. It also allows us to do the right thing early with --help/--version and no option cases cleanly. This change also makde the check for root privileges only occur on operations where they are needed. This patch is inspired by and supercedes some patches submitted by Denis A. Altoé Falqueto and Ivan Kanakarakis who were altering the previous option handling in an attempt to deal with the above issues. Signed-off-by: Allan McRae <allan@archlinux.org>
* replace access() calls for debug info where applicableFlorian Pritz2011-07-18
| | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
* signing.c: check if needed files are readableFlorian Pritz2011-07-18
| | | | | | | | | If we can't read the keyring, gpgme will output confusing debug information and fail to verify the signature, so we should log some debug information. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
* add _alpm_access() wrapperFlorian Pritz2011-07-18
| | | | | | | | This is a wrapper function for access() which logs some debug information and eases handling in case of split directory and filename. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2011-07-18
|\
| * makepkg: fix issue with filenames with spaces and noextractAllan McRae2011-07-18
| | | | | | | | | | | | | | | | | | | | | | Specifying a filename with spaces in a PKGBUILDs noextract array fails due to a lack of quoting. Fixes FS#25100. Reported-by: Thomas Weißschuh <thomas_weissschuh@lavabit.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Fix compilation without gpgmeAllan McRae2011-07-18
| | | | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | configure: output more compile settingsAllan McRae2011-07-18
| | | | | | | | | | | | | | | | | | | | | | Add information on CPPFLAGS, LDFLAGS and LIBS to the end of the configure output. This is very helpful in tracing issues when adjusting the configure file and also will allow us to more easily replicate any issues discovered due to a users build environment. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg.conf: remove curl from other common toolsAllan McRae2011-07-18
| | | | | | | | | | | | | | It is now set as the main tool, so make wget another common one. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: do not print full path of signature fileAllan McRae2011-07-18
| | | | | | | | | | | | | | | | The full path to the signature file when it is created is in a temporary directory so only print the filename. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: always remove repo signature symlinkAllan McRae2011-07-18
| | | | | | | | | | | | | | | | This prevents a dangling symlink being left behind if the repo goes from being signed to unsigned. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | contrib/paclog-pkglist: whitespace cleanupDave Reisner2011-07-18
| | | | | | | | | | | | | | add a modeline and change 2 space indent to a tab. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | contrib/paclog-pkglist: rework as bash wrapping awkDave Reisner2011-07-18
| | | | | | | | | | | | | | | | | | | | Avoid some pain in awk's limited handling of command line arguments by wrapping this in a Bash script. We also default to @localstatedir@/log/pacman.log when no args are specified, meaning that -h or --help is required to get the help message. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add a new epoch pactestDan McGee2011-07-18
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Handle removal of empty directories properlyDan McGee2011-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses FS#25141. We shouldn't remove every empty directory we come across during the removal process unless it is truly not known to any other package. This will prevent removal of essential directories such as '/var/lock/'. This is accomplished by first checking the empty/non-empty status of a directory, which was previously done implicitly by calling rmdir() and ignoring errors. We do this to avoid the next (new) check in most cases, which is to look at all local packages to see if the to-be-removed directory is present in another packages' filelist. If we do not find it anywhere, then we remove it, else we keep the file around. The pactest has been updated to test more cases, as well as finding a flaw in the original expected to fail case- we need separate DIR and FILE based EXIST rules. Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: only test for writable PKGDEST when needed.Rogutės Sparnuotos2011-07-18
| | | | | | | | | | | | | | | | | | There is no need for a writable PKGDEST when using the --nobuild or --geninteg flags. Allan: added --geninteg Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Move some .gitignore entriesAllan McRae2011-07-18
| | | | | | | | | | | | | | | | Put a .gitignore entry at the right level and sort that file alphabetically. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | doc/PKGBUILD: clarify scriptlet version argumentsDan McGee2011-07-14
| | | | | | | | | | | | | | | | | | | | | | It was a bit unclear that both pkgver and pkgrel were included in the passed version strings; clarify this fact in the manpage. Also include epoch in the mix now that it exists. Also make two other minor consistency touchups to code-print variables in text. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Make alpm_db_set_pkgreason() arguments more saneDan McGee2011-07-14
| | | | | | | | | | | | | | | | | | This can only ever operate on the local database, and a local package at that. Change the function signature to take a handle and package object, add the relevant asserts, and ensure the frontend can detect the package not found condition when finding packages to pass to this method. Signed-off-by: Dan McGee <dan@archlinux.org>
* | contrib/paclog-pkglist: new contributionDave Reisner2011-07-14
| | | | | | | | | | | | | | | | converts a pacman log file to a list of installed packages, which should match the output of `pacman -Q'. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | contrib/bash_completion: update with new makepkg optsDave Reisner2011-07-14
| | | | | | | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: remove unused -C option from option listDave Reisner2011-07-14
| | | | | | | | | | | | | | We nuke it from the completion file as well along with its longopt. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: skip devel_check when reading from a pipeDave Reisner2011-07-14
| | | | | | | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: Remove pre-optimization from in_array()DJ Mills2011-07-14
| | | | | | | | | | | | | | The '[[ -z' test in in_array() is redundant, so remove it. Signed-off-by: DJ Mills <danielmills1@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* | makepkg: Remove OPT_TEMP hack in parse_options callDJ Mills2011-07-14
| | | | | | | | | | | | | | | | Instead of hacking around the error trap, simply do an explicit test for failure. Signed-off-by: DJ Mills <danielmills1@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* | Allow fileconflict if unowned file moving into backup arrayDan McGee2011-07-14
| | | | | | | | | | | | | | | | | | | | | | The bulk of this commit is adding new tests to ensure the new behavior works without disrupting old behavior. This is a relatively sane maneuver when a package adds a conf file (e.g. '/etc/mercurial/hgrc') that was not previously in the package, but it is placed in the backup array. In essence, we can treat the existing file as having always been a part of the package and do our normal compare/install as pacnew logic checks. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add 'compress' compression format as an available optionDan McGee2011-07-14
| | | | | | | | | | | | | | | | This adds the '.tar.Z' option to both repo-add and makepkg for no other reason than "why not", and because bsdtar supports it natively with the '-Z' flag. Also update the documentation accordingly. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Unify package removal codeDan McGee2011-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This code duplication has always been a rather clumsy casuality of fixing some past upgrade issues. Unify the removal code across upgrade and remove operations into a new _alpm_remove_single_package() method wihch makes it very clear how we handle upgrade and remove differently, via several conditionals on newpkg. This commit highlights interesting behavior such as the fact that the implicit removal in every package upgrade never gets transaction events or progress callbacks. Signed-off-by: Dan McGee <dan@archlinux.org>
* | include util.h in rawstr.cDan McGee2011-07-05
| | | | | | | | | | | | | | | | Fixes "error: no previous prototype for '_alpm_raw_cmp' [-Werror=missing-prototypes]" warnings, and also prevents someone from getting the prototypes and functions out of sync. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge remote-tracking branch 'dave/download'Dan McGee2011-07-05
|\ \
| * | absorb fileinfo struct into dload_payloadDave Reisner2011-07-05
| | | | | | | | | | | | | | | | | | This transitional struct becomes delicious noms for dload_payload. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
| * | absorb some _alpm_download params into payload structDave Reisner2011-07-05
| | | | | | | | | | | | | | | | | | | | | Restore some sanity to the number of arguments passed to _alpm_download and curl_download_internal. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
| * | lib/dload: prevent large file attacksDave Reisner2011-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This means creating a new struct which can pass more descriptive data from the back end sync functions to the downloader. In particular, we're interested in the download size read from the sync DB. When the remote server reports a size larger than this (via a content-length header), abort the transfer. In cases where the size is unknown, we set a hard upper limit of: * 25MiB for a sync DB * 16KiB for a signature For reference, 25MiB is more than twice the size of all of the current binary repos (with files) combined, and 16KiB is a truly gargantuan signature. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
| * | dload: handle irregular URLsDave Reisner2011-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | URLs might end with a slash and follow redirects, or could be a generated by a script such as /getpkg.php?id=12345. In both cases, we may have a better filename that we can write to, taken from either content-disposition header, or the effective URL. Specific to the first case, we write to a temporary file of the format 'alpmtmp.XXXXXX', where XXXXXX is randomized by mkstemp(3). Since this is a randomly generated file, we cannot support resuming and the file is unlinked in the event of an interrupt. We also run into the possibility of changing out the filename from under alpm on a -U operation, so callers of _alpm_download can optionally pass a pointer to a *char to be filled in by curl_download_internal with the actual filename we wrote to. Any sync operation will pass a NULL pointer here, as we rely on specific names for packages from a mirror. Fixes FS#22645. Signed-off-by: Dave Reisner <d@falconindy.com>
| * | dload: rearrange code to avoid extra cpp blockDave Reisner2011-07-05
| | | | | | | | | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org>
| * | lib/rawstr: borrow raw string functions from curlDave Reisner2011-07-05
| | | | | | | | | | | | | | | | | | | | | We'll need these functions to do locale agnostic and case insensitive string comparisons. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* | | repo-add: backup old database signature tooAllan McRae2011-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | If you are keeping a copy of the old database, you probably want to keep a copy of its signature too. Also, delete the previously backed-up database signature if no new one is being copied. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | | Rework -Si display logicDan McGee2011-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We did some funny stuff here before to allow specifying fully-qualified package names, such as 'testing/gcc' or 'core/gcc'. However, it was done by duplicating code, not to mention an early escape if a repository could not be found for an early target. Something like `pacman -Si foo/bar core/gcc' would not give expected results, although `pacman -Si bar gcc' would. Clean up the code, remove strncpy() usage, and clarify the error messages a bit. Signed-off-by: Dan McGee <dan@archlinux.org>
* | | pacman-key: fix syntax highlightingAllan McRae2011-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | The lone quotation mark in "pacman's" causes issues for some syntax highlighting. Change the printing of the nessage from echo to printf so we can invisibly escape it. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | | contrib/paclist: rewrite in bashDave Reisner2011-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original concept for this script was a bash implementation, but turned out to be unreasonable at the time due to the efficiencies of the database format. Since those have been resolved, we can rewrite this in bash as a much simpler script. All the action happens in a single line, but we add extend this a little, binding to gettext to keep our pacman translations intact. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | | fix segfault if pacman.conf can't be readFlorian Pritz2011-07-05
| | | | | | | | | | | | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>