summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2011-05-05Improve database server APIDan McGee3-24/+89
Currently we have one call that has all sorts of crazy behavior and doesn't make a whole lot of sense. Go from one method to the normal four methods we have for all of our other lists we use in the library to make it a lot easier for a frontend to manipulate server lists. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-05Logging changes during DB loadDan McGee2-1/+6
The switch from FUNCTION to DEBUG was ill-advised inside the local database load. Instead, add a DEBUG level logger to both local and sync database loads that shows the number of packages processed. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-05Make config parsing a two-part affairDan McGee3-74/+92
This ensures we call any alpm_option type functions before registering databases, making sure all paths and other defaults (e.g. sig verification levels) have been set first. This will ensure we can continue to allow crazy config files where [options] doesn't come first. The diffstat on this commit is misleading; view with -w/--ignore-all-space to get a better idea of what needed to be touched. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-05Move parseconfig to conf.cDan McGee4-593/+611
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-05pactest: run with root in /tmp and clean up automaticallyDan McGee2-11/+24
This moves the generated root/ directory into /tmp, or at least a path returned by tempfile.mkdtemp(), by default. This can make test runs significantly faster if done when /tmp is a tmpfs. If you are debugging a failed test, use the new --keep-root option to not clean up and pactest will print the location of the generated root/ test directory. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-05dload: ensure we return success if we found files on any mirrorDan McGee1-1/+3
We were erroring out in the case where a first (possibly bogus) mirror would cause the download process to return a failure code, even though subsequent servers had the file. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-05Dan broke my patchAllan McRae1-1/+1
Add a missing space. Signed-off-by: Allan McRae <allan@archlinux.org>
2011-05-04Fix incorrect memory allocation assignmentDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-04dload: make sure we never print a bogus error bufferDan McGee1-0/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-04Merge branch 'maint'Dan McGee2-3/+7
2011-05-04Deal with unused function parameters correctlyAllan McRae7-18/+28
This started off removing the "(void)foo" hacks to work around unused function parameters and ended up fixing every warning generated by -Wunused-parameter. Dan: rename to UNUSED. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-04pactree: make -Wwrite-strings friendlyDan McGee1-50/+62
Use a few structs to hold configuration values we change given certain options so we can be const-correct with string assignment across the board. Behavior should be completely unchanged. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-04Fix warnings reported by -Wwrite-stringsDan McGee5-11/+10
These are places where we stuck a string constant in a variable not marked as const. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-04Reduce duplicate signing debug code and fix logic conditionDan McGee1-35/+23
We had a lot of similar looking code that we can collapse down into a function. This also fixes errors seen when turning on some gcc warnings and implicitly casting away the const-ness of the string. Free the list when we are done with it as well. Also, fix a logic error where we should be checking with &&, not ||. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-02makepkg: quote variable that may contain spacesAllan McRae1-1/+1
Prevents failures when $PKGDEST contains spaces (FS#24002) Patch-by: Sebastien Duthil Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-02Update PKGBUILD exampleAllan McRae1-2/+6
Add quotes around $srcdir/$pkgdir (FS#23960) and use a package() function. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-29Merge branch 'maint'Dan McGee2-19/+18
2011-04-29Transifex updatesDan McGee1-13/+12
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-29pacman(8): grammar correction for relative clausesMatt Mooney1-5/+5
Change "which" to "that" when used in a restrictive clause. Replace usage of the relative prounoun "those" with a common noun for added clarity. Signed-off-by: Matt Mooney <mfm@muteddisk.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-29pacman(8): change "options" to "operation" when referring to -DMatt Mooney1-1/+1
-D is an operation not an option. Signed-off-by: Matt Mooney <mfm@muteddisk.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2011-04-27configure: add output showing what libraries will be usedDan McGee1-3/+7
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-27Allow conditional compilation with GPGMEDan McGee3-4/+32
This makes it possible to omit usage of -lgpgme, just as we can do for -lcurl and -lcrypto. Thanks to Rémy Oudompheng for an initial stab at this. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24signing: add more detail to unexpected signature count errorDan McGee1-1/+7
Do a quick loop and count of the returned data so we can show how many signatures were parsed and read. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24Enhance GPGME debug outputDan McGee1-11/+97
Add some lookup functions for nice names for the various types used by the library, and remove some fields that are of little use to us in the debug output. This should make looking at key loading and verification a bit easier, especially in determining what makes up our good and bad criteria. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24Perform package verification at package load timeDan McGee8-42/+54
Both md5sum verification and PGP verification can and should be done at package load time. This allows verification to happen as early as possible for packages provided by filename and loaded in the frontend, and moves more stuff out of sync_commit that doesn't really belong there. This should also set the stage for simplified parallel loading of packages later down the road. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24sync_commit: refactor out validate_deltasDan McGee1-50/+53
More stuff going on in the pre-committing stage that can be in a static method to make things a bit more clear. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24sync_commit: refactor out file downloadsDan McGee1-32/+37
This part is almost completely self-contained, except building the list of delta filenames that we use later to check their md5sums. Refactor it into a static method so we can bring most of the code in sync_commit closer to the method name. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24Rein in the complexity of the signature typeDan McGee7-69/+58
Given that we offer no transparency into the pmpgpsig_t type, we don't really need to expose it outside of the library, and at this point, we don't need it at all. Don't decode anything except when checking signatures. For packages/files not from a sync database, we now just read the signature file directly anyway. Also push the decoding logic down further into the check method so we don't need this hanging out in a less than ideal place. This will make it easier to conditionally compile things down the road. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24signing: let GPGME handle loading signatures from filesDan McGee5-92/+35
Rather than go through all the hassle of doing this ourselves, just let GPGME handle the work by passing it a file handle. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24repo-add: update copyright messageAllan McRae1-4/+2
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24repo-add: document -k optionAllan McRae1-2/+7
Also unify the usage output with that given by repo-add itself. Dan: use 'options', not 'option(s)'. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24repo-add: check for gpg earlyAllan McRae1-9/+14
Check for the presence of gpg as soon as we know we need it. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24repo-add: check for valid key when signing is requestedAllan McRae1-1/+11
Follow the example of makepkg Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24repo-add: add option to specify a different key to sign withDenis A. Altoé Falqueto1-11/+27
Add -k/--key option to specify a non-default key for signing a package database. Original-patch-by: Denis A. Altoé Falqueto <denisfalqueto@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-24repo-add: simplify usage messageAllan McRae1-3/+3
Listing every option on the usage line becomes unweildly as more options get added so simplify it. Also, provide a standard package name in the repo-add example. Dan: just use 'options' as we use elsewhere, not 'option(s)'. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-23Make dump_pkg_full a little less insaneDan McGee5-40/+36
The various "level" values were a bit crazy to decipher, and we were doing some very interesting comparisons in certain places. Break it out into two parameters instead so we can seperate the type from the extra information display, and do things accordingly. Nothing changes with the display of any of the five types we currently show: -Si, -Sii, -Qi, -Qii, -Qip. Something to note- we should expose the PKG_FROM enum type somehow, this patch leaves the door open to do that quite easily. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-23libalpm/dload: major refactor of signature downloadingDan McGee4-127/+95
There's a lot of related moving parts here: * Iteration through mirrors is moved back to the calling functions. This allows removal of _alpm_download_single_file and _alpm_download_files. * The download function gets a few more arguments to influence behavior. This allows several different scenarios to customize behavior: - database - database signature (req'd and optional) - package - package via direct URL - package signature via direct URL (req'd and optional) * For databases, we need signatures from the same mirror, so structure the code accordingly. Some-inspiration-from: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-23libalpm/dload: add allow_resume and reorder error checksDan McGee1-19/+21
The allow_resume is the start of the fix to the "don't ever resume database downloads" problem, as well as being useful for '.sig' downloads as well. For now, we say "always allow resume", but this will eventually get pushed down as necessary. Error checks are reworked in order to correctly error out when a file is not found on the remote end and reports 0 bytes downloaded. In addition, the two error messages printed are now different as one reports a more specific error message provided via the cURL error buffer. Some example output from an -Sy run with [testing], [community], [community2], [eee], and [nonexistant] defined as repos. [community2] and [nonexistant] are both invalid, one using FTP and one using HTTP. :: Synchronizing package databases... testing is up to date community is up to date error: failed retrieving file 'community2.db' from ftp.archlinux.org : Given file does not exist error: failed to update community2 (FTP: couldn't retrieve (RETR failed) the specified file) eee is up to date error: failed retrieving file 'nonexistant.db' from code.toofishes.net : The requested URL returned error: 404 error: failed to update nonexistant (HTTP response code said error) Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-23Merge branch 'maint'Dan McGee2-8/+10
2011-04-23Small translation update from TransifexDan McGee1-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-22cleanup: add_pkg() and remove_pkg()Dan McGee2-6/+6
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-22libalpm/dload: const and static correctnessDan McGee2-6/+7
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-22be_sync: use _alpm_db_get_sigverify_level()Dan McGee1-4/+7
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-21sync.c: remove unnecessary check for PM_PGP_VERIFY_UNKNOWNRémy Oudompheng1-7/+0
The value PM_PGP_VERIFY_UNKNOWN is reserved to error cases, now that the signature verification level defaults to the globally set level. The only error case is when handle == NULL, which is false in the context of _alpm_sync_commit(). Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-21handle.c: force sigverify level not to be PM_PGP_VERIFY_UNKNOWNRémy Oudompheng1-0/+1
Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-21Merge remote-tracking branch 'remy/doxygen'Dan McGee3-29/+89
2011-04-21pacman-key: improved reading of the configuration fileIvan Kanakarakis1-9/+13
This commit replaces the find_config() function with the get_from() function. get_from expects two arguments, the first is the file to read and the second is the key to look for in the given file. get_from returns the first matching value for the given key. The file is expected to be in the format: key = value Each of 'key' 'equal sign' 'value' can be surrounded be random whitespace. Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-21pacman-key: display the unsupported command to the userIvan Kanakarakis1-0/+1
If the user provides an unsupported command, inform the user that this switch is unknown, display usage and exit. Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-21makepkg, pacman-key: unify help message with other scriptsIvan Kanakarakis2-2/+2
The help message changed to match the one rankmirrors script has. It's clearer as to what the --help switch does. Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-21alpm.h: add several missing documentation stringsRémy Oudompheng1-0/+13
Signed-off-by: Rémy Oudompheng <remy@archlinux.org>