summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2011-08-18Replacements refactor: extract check_literal()Dan McGee1-33/+46
This moves code that was inline in alpm_sync_sysupgrade() to its own method. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18Remove usages of alpm_list_next() in backendDan McGee4-13/+13
Another function call that can be replaced by a single pointer dereference. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18Remove use of no-op accessor functions in libraryDan McGee8-44/+36
The functions alpm_db_get_name(), alpm_pkg_get_name(), and alpm_pkg_get_version() are not necessary at all, so remove the calling and indirection when used in the backend, which makes things slightly more efficient and reduces code size. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18Enhance and utilize database status flagsDan McGee6-25/+76
* Move is_local standalone field to status enum * Create VALID/INVALID flag pair * Create EXISTS/MISSING flag pair With these additional fields, we can be more intelligent with database loading and messages to the user. We now only warn once if a sync database does not exist and do not continue to try to load it once we have marked it as missing. The reason for the flags existing in pairs is so the unknown case can be represented. There should never be a time when both flags in the same group are true, but if they are both false, it represents the unknown case. Care is taken to always manipulate both flags at the same time. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18Add makepkg -S which is an alias to makepkg --sourceSebastien Luttringer3-11/+11
makepkg --source is a often used go make source package like for AUR. Have a -S shortcut will save the world. Signed-off-by: Sebastien Luttringer <seblu@seblu.net> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18lib/libalpm/dload.c: Use STRDUP() instead of strdup()Lukas Fleischer1-3/+5
Use the STRDUP macro instead of strdup() for the sake of better error handling on memory allocation failures. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18lib/libalpm/dload.c: Add ASSERT() to alpm_fetch_pkgurl()Lukas Fleischer1-0/+1
Return with ALPM_ERR_WRONG_ARGS instead of causing a potential segfault if alpm_fetch_pkgurl() is invoked with a NULL URL. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17lib/dload: refactor deletion on failureDave Reisner1-6/+2
This moves all the delete-on-fail logic to under cleanup label. This also implies should_unlink when a payload is received that doesn't allow resuming. Fixes .db.sig.part files leftover in the sync dir. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17lib/dload: avoid renaming download to 0 length destfileDave Reisner1-1/+1
This leverages earlier work that avoids a rename when destfile is unset. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17Avoid stat() on NULL path in curl_download_internal()Lukas Fleischer1-1/+1
stat()'s behaviour is undefined if the first argument is NULL and might be prone to segfault. Add an additional check to skip the stat() invocation if no destfile is used. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17Skip rename() on NULL destfile in curl_download_internal()Lukas Fleischer1-5/+9
Avoid a potential segfault that may occur if we use a temporary file and fail to build the destination file name from the effective URL. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17Fix trailing whitespace in whole codebaseDan McGee14-28/+28
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17Update PKGBUILD manpage about startdir deprecationSebastien Luttringer1-0/+1
Signed-off-by: Sebastien Luttringer <seblu@seblu.net> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16Fix compilation using --without-gpgmeDan McGee1-22/+21
This function is used regardless of whether gpgme support is enabled, so make sure it is always accessible. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16configure.ac: add checks for more types, functions and headersAllan McRae1-7/+15
This covers most types, functions and headers that we use in the code base. Currently we do not use any of these checks, but it is useful to have the configure output when looking at build issues on other peoples systems. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16dload: zero out pm_errno in curl_download_internalDave Reisner2-10/+4
This reverts some hacky behavior from 5fc3ec and resets the handle's pm_errno where it should be reset -- prior to each download. This prevents a transaction with a download from being aborted when a package is successfully grabbed from a secondary server. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16doc/PKGBUILD: fix Asciidoc formatting issuesDan McGee1-6/+6
We had this gem: ⇐ (less than or equal to) Due to not ensuring we did literal printing of things like this. Fix it and a few other problems noticed scanning through both the HTML and manpage generated files. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16Update authors and contributorsDan McGee3-19/+8
* .mailmap: add mapping for Dave's two email addresses. * AUTHORS: clear out file, tell people to use `git shortlog -s` instead. * doc/footer.txt: "promote" Dave, put Xavier and Nagy in past contributors. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16repo-add: fix creation of signature symlinkAllan McRae1-1/+1
When creating a repo outside the current directory, the signature symlink was not created. Reported-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15Update message catalogsDan McGee3-19/+30
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15Update translations from TransifexDan McGee19-779/+947
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15repo-add: reorganize output messages for clarityDan McGee1-17/+17
The use of warning once we had already started adding a package was confusing as it broke the standard indent pattern. It was especially bad if adding multiple packages as it wasn't clear what sub-messages applied to which package being added. This should be an output change only from: ==> Adding package '/tmp/sync/netcfg-2.6.7-1-any.pkg.tar.xz' -> Computing checksums... -> Adding package signature... ==> WARNING: An entry for 'netcfg-2.6.7-1' already existed -> Removing existing entry 'netcfg-2.6.7-1'... -> Creating 'desc' db entry... -> Creating 'depends' db entry... to: ==> Adding package '/tmp/sync/netcfg-2.6.7-1-any.pkg.tar.xz' ==> WARNING: An entry for 'netcfg-2.6.7-1' already existed -> Computing checksums... -> Adding package signature... -> Removing existing entry 'netcfg-2.6.7-1'... -> Creating 'desc' db entry... -> Creating 'depends' db entry... Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15Only check necessary signatures and checksumsDan McGee6-28/+46
The precedence goes as follows: signature > sha256sum > md5sum Add some logic and helper methods to check what we have available when loading a package, and then only check what is necessary to verify the package. This should speed up sync database verifies as we no longer will be doing both a checksum and a signature validation. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15libalpm: fix a remaining old syntax of RET_ERR() macroRémy Oudompheng1-1/+1
It would prevent compilation of pacman on FreeBSD, and possibly other systems. Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15lib/sync: ignore download errors for as long as possibleDave Reisner1-11/+13
Previously, the behavior was such that if a sync operation required packages from multiple repos, a download error in the first repo would cause a hard repo, ignoring the remainder of the repositories. Change this behavior so that we do a better job of fetching as many packages as possible before aborting the transaction. There's a little bit of refactoring mixed in here to get rid of some useless variables. Since we now depend heavily on the value of handle->pm_errno being accurate the determine the function's return value, we clear it when the transaction state is set. Fixes FS#25532. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15Further fixes to replacement iterationDan McGee1-10/+4
A partial fix for this was in commit 7de92cb22, but this should fix the remaining cases. There are still several issues dealing with "provision as replacement" selection however. Addresses FS#25538 and FS#25527. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15Add short example signature config to pacman.confDan McGee1-0/+5
This is similar to what we do with every other option. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15build-sys: always use $(RM) instead of rm -fDave Reisner5-8/+8
These are equivalent. Use the autoconf macro for consistency. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15dist: preserve symlinks on installationDave Reisner2-4/+25
This applies to the repo-remove man page as well as the script itself. Yes Dan, I ran distcheck afterwards. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15Parse conflicts/provides/replaces at database load timeDan McGee11-87/+108
We did this with depends way back in commit c244cfecf654d3 in 2007. We can do it with these fields as well. Of note is the inclusion of provides even though only '=' is supported- we'll parse other things, but no guarantees are given as to behavior, which is more or less similar to before since we only looked for the equals sign. Also of note is the non-inclusion of optdepends; this will likely be resolved down the road. The biggest benefactors of this change will be the resolving code that formerly had to parse and reparse several of these fields; it only happens once now at load time. This does lead to the disadvantage that we will now always be parsing this information up front even if we never need it in the split form, but as these are uncommon fields and our parser is quite efficient it shouldn't be a big concern. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15Validate the sha256sum if availableDan McGee6-28/+53
Adjust load_internal() to check the sha256sum value if we have it. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15Show 'None' in Signatures -Qip/-Si output if none foundDan McGee1-2/+5
This is to be as consistent as possible across both types of display. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15decode_signature: guess signature data length for efficiencyDan McGee1-15/+5
We may end up allocating 1 or 2 extra bytes this way, but it is worth it to simplify the method and not have to call base64_decode() a second time. Use the hueristic that base64 encoding produces 3 bytes of decoded data for every 4 bytes of encoded data. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15Remove checksum access indirectionDan McGee3-22/+2
These items are never present in anything but sync databases, nor do we even try to load them from the local database. Remvoe the indirection meant to allow the caching layer to work since it will never do anything anyway. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15lib/sync: reset flag after rejecting a replaceDave Reisner1-0/+3
This prevents iteration through the remainder of the current tree, with pacman claiming that they're all replacements to the original replacement candidate. :: Synchronizing package databases... allanbrokeit is up to date testing is up to date core is up to date extra is up to date community-testing is up to date community is up to date :: Starting full system upgrade... :: Replace util-linux-git with core/util-linux? [Y/n] n :: Replace util-linux-git with core/vi? [Y/n] n :: Replace util-linux-git with core/vpnc? [Y/n] n :: Replace util-linux-git with core/wget? [Y/n] n :: Replace util-linux-git with core/which? [Y/n] n :: Replace util-linux-git with core/wireless-regdb? [Y/n] n :: Replace util-linux-git with core/wireless_tools? [Y/n] n :: Replace util-linux-git with core/wpa_actiond? [Y/n] n :: Replace util-linux-git with core/wpa_supplicant? [Y/n] n :: Replace util-linux-git with core/xfsprogs? [Y/n] n :: Replace util-linux-git with core/xinetd? [Y/n] n :: Replace util-linux-git with core/xz? [Y/n] n :: Replace util-linux-git with core/zd1211-firmware? [Y/n] n :: Replace util-linux-git with core/zlib? [Y/n] n there is nothing to do Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15Load and allow access to sha256sumDan McGee7-4/+31
This adds a field in the package struct for this checksum type as well as allowing access via the API to it. The frontend is now able to display any read value. Note that this does not implement any use or verification of the value internally. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15Add ALPM sha256sum routinesDan McGee2-0/+81
These mirror ones we already have for md5sums. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15Add sha2 (sha256) routines from PolarSSLDan McGee3-1/+436
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15repo-add: indicate whether package signature is foundAllan McRae1-0/+1
When adding a package to a repo, it is useful to be able to see that repo-add has indeed found the signature file. [Dan: update text to be more in line with other messages] Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15pacman/package: show presence of signature in in -SiDave Reisner4-1/+16
adds a new API method: alpm_pkg_get_base64_sig [Dan: don't use a new header string in frontend] Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15README: update with 3.5.0 -> 4.0.0 API changesDave Reisner1-0/+74
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15makepkg: don't hardcode path to stripDave Reisner1-3/+3
Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15alpm.h: fix inconsistency in function prototypeDave Reisner1-2/+2
Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15add pactest for replacing a shared providerDave Reisner1-0/+21
This is currently expected to fail. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15pactest/sync200: check for curl instead of fetchDave Reisner2-2/+2
We can't just check for LIBS as curl won't be listed. Instead, look at the length of the LIBCURL var from the Makefile. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15lib/dload: avoid deleting .part file on too-slow xferDave Reisner1-13/+21
Take this opportunity to refactor the if/then/else logic into a switch/case which is likely going to be needed to fine tune more exceptions in the future. Fixes FS#25531 Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15Update base64 PolarSSL codeDan McGee3-17/+20
Also adjust our code using it for the size_t adjustments made by upstream. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-11Update MD5 routines with changes from PolarSSLDan McGee2-39/+34
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-11pacman/query.c: avoid variable redeclarationDan McGee1-3/+3
We were using i as the loop variable in both the inner and outer loop. Use j in the inner loop instead for clarity. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-11pactest: -U --recursivePang Yan Han1-0/+56
Signed-off-by: Dan McGee <dan@archlinux.org>