summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2011-06-20lib/handle: use CALLOC macro instead of bare callocDave Reisner1-3/+3
Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-20Don't call public API in _alpm_log()Dan McGee1-3/+2
Calling get_logcb() here would reset any previous setting of handle->pm_errno due to the CHECK_HANDLE() macro contained within. This would make error setting a bit funny if one set pm_errno before calling _alpm_log(), such as in the RET_ERR() macro. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15API: change 'signaturedir' to 'gpgdir'Dan McGee6-17/+17
This is more in line with reality and what we have our makepkg, etc. options named anyway. Original-patch-by: Kerrick Staley <mail@kerrickstaley.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15makepkg: create source package inside fakerootAllan McRae1-25/+40
Create source package files inside the fakeroot environment to ensure reasonable ownership of files within the archive. Fixes FS#24330. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15Clean up makefile for script generationAllan McRae1-8/+5
We no longer have any python scripts in our scripts/ directory so we can simplify the makefile a bit. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15parse_options: adjust error messagesAllan McRae1-3/+3
Provide consistent error messages for unknown long and short options. Also get full string translation for the messages. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15scripts/library: add README fileAllan McRae1-0/+15
Add a README file to briefly document the code snippets in the scripts library folder. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15scripts: refactor output formatting functionsAllan McRae6-69/+48
Move the common output formatting functions into a separate library file and import that into each script. makepkg is excluded due to its additional color formatting. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15makepkg: move option parsing code to separate fileAllan McRae3-91/+97
This move the getopt replacement function parse_options out of makepkg.sh.in and into a separate file. The code is inserted into the relevant place in makepkg using m4. This will allow the reuse of the option parsing code in other scripts (i.e. pacman-key) while avoiding code duplication. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15Merge branch 'maint'Dan McGee2-4/+5
2011-06-15Ensure humanize_size works for negative valuesJakob Gruber1-1/+1
Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15Use pm_fprintpf in table_create_formatJakob Gruber1-1/+1
Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15makepkg: reword purge messageAllan McRae1-1/+1
Clarfiy that it is unwanted files are being removed rather than "other" files (whatever they are...). Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15list_display: fix incorrect assignmentDan McGee1-1/+1
Commit 895a88886525d erroneously left this around. Noticed-by: Jakob Gruber <jakob.gruber@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15Fix man page generation for out of tree buildAllan McRae1-3/+4
Fix failure at man page generation when building outside the source tree. There may still be issues with other documentation types... Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14valgrind.supp: add known leak exposed by cURLDan McGee1-0/+10
This one comes courtesy of OpenSSL and some static initialization. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14doc/PKGBUILD: misc changesFlorian Pritz1-13/+13
Acked-by: matt mooney <mfm@muteddisk.com> Signed-off-by: Florian Pritz <bluewind@xinu.at>
2011-06-14Rename and rework signing helper methodsDan McGee1-38/+36
* Don't name static methods with a gpgme_ prefix to avoid confusion with methods provided by the library. These are static and local to our file so just give them sane non-prefixed names. * Rework sigsum_test_bit() to not require assignment. * Don't balk if there is more than one signature available (for now, only check the first). * Fix error codes in publicly visible methods to return -1, not 0, if pkg or db are not provided. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Alpm pkg accessors: ensure pkg argument is non-NULLDan McGee1-0/+28
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Ensure handle is valid and pm_errno is reset when calling into APIDan McGee15-69/+128
We didn't do due diligence before and ensure prior pm_errno values weren't influencing what happened in further ALPM calls. I observed one case of early setup code setting pm_errno to PM_ERR_WRONG_ARGS and that flag persisting the entire time we were calling library code. Add a new CHECK_HANDLE() macro that does two things: 1) ensures the handle variable passed to it is non-NULL and 2) clears any existing pm_errno flag set on the handle. This macro can replace many places we used the ASSERT(handle != NULL, ...) pattern before. Several other other places only need a simple 'set to zero' of the pm_errno field. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Avoid setting sigverify option twiceDan McGee1-1/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Conflict check and skip_remove code cleanupsDan McGee2-39/+55
* Move several variables into better scope * const-ify a few variables * Avoid duplicating filelists if it is unnecessary * Better handling out out of memory condition when adding file conflicts to our list Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Small handle related cleanupsDan McGee3-5/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Add handle argument to _alpm_pkg_should_ignore()Dan McGee4-13/+14
This allows callers to retrieve it from wherever is convenient, which may or may not be on the package object itself. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Merge remote-tracking branch 'florian/sodeps'Dan McGee2-2/+94
2011-06-14doc/PKGBUILD: misc changesFlorian Pritz1-41/+40
Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Merge branch 'maint'Dan McGee3-9/+15
Conflicts: doc/makepkg.conf.5.txt
2011-06-14Remove alpm_db_get_url()Dan McGee3-30/+7
This method is old, it doesn't adequately check for a NULL server list, and can easily be done using better API method we provide these days. All former users of this method can get similar results by calling alpm_db_get_servers() and using the data from the returned server list. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Added check option to BUILDENV array in makepkg.conf man pageEric Bélanger1-1/+1
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Add a helper method for retrieving the DB signature pathDan McGee2-0/+15
Note that is a bit different than the normal _alpm_db_path() method; the caller is expected to free the result. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14alpm_db_update(): refactor out sync dir create/checkDan McGee1-22/+31
This was a lot of stuff that can stand by itself for the most part. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14conf: do batch processing of repo sectionsDan McGee1-49/+100
We now parse an entire repo section and store all information about it. When the next section is encountered or the end of the root config file is reached, we will then process the stored information. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14conf: _parseconfig() cleanups and documentationDan McGee1-19/+38
* Function doxygen documentation * Reuse a single strlen() call * Prevent infinite recursion (limit to 10 levels) * Other small cleanups Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Always pass data to trans_commit()Dan McGee1-2/+4
Even though we currently don't use it here in the backend, we might as well pass it in since we used it earlier. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Remove global handle variableDan McGee3-15/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Switch all logging to use handle directlyDan McGee22-368/+360
This is the last user of our global handle object. Once again the diff is large but the functional changes are not. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Move pm_errno onto the handleDan McGee39-442/+422
This involves some serious changes and a very messy diff, unfortunately. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Add handle argument to two more alpm methodsDan McGee7-33/+41
This takes care of alpm_checkdeps() and alpm_find_dbs_satisfier(). Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Require handle for alpm_checkconflicts()Dan McGee5-12/+16
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Require handle for alpm_pkg_load()Dan McGee8-17/+20
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Add handle argument to alpm_(add|remove)_pkg()Dan McGee6-14/+19
This makes these functions consistent with the rest of the transaction related API calls. We do an additional assert to ensure the handle attached to the package is the same as the handle passed in. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Added initialization code for database siglevelKerrick Staley1-0/+1
The siglevel field of a newly created pmdb_t struct is now initialized when it is created in _alpm_db_new(). Signed-off-by: Kerrick Staley <mail@kerrickstaley.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Fix memory leak if package sig was invalidDan McGee1-0/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Fix all current return(x) usagesDan McGee3-12/+12
A few of these snuck in as of late, some from the table display patches that were using the previous format before we changed it after the 3.5.X major release. Noticed-by: Kerrick Staley <mail@kerrickstaley.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-14Fix list_display on non-ttys and other output fixesDan McGee1-7/+12
commit c1f742d7750a14 broke what was one of the tenants of out output- if piping pacman output somewhere else, we shouldn't ever try to line-wrap and indent print our output. This makes it easier for tools to use output from pacman -Ss, -Qs, -Qi, etc. list_display() unfortunately was given a default value of 80 rather than 0, so fix this. Next, make some additional changes that ensure we don't insert an unnecessary blank line if for some crazy reason the indent level (such as on -Qi output) is greater than the number of columns. Accomplish this by printing the first item unconditionally as we do in list_display_linebreak(). Finally, teach indentprint to not wrap if the number of columns is less than the indent level, this prevents some forms of ridiculous output such as the following: Install Date : Wed 08 Jun 2011 04:39:19 AM CDT Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-09doc/PKGBUILD: document libdepsFlorian Pritz1-0/+9
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2011-06-09commit_single_pkg(): Use handle object directlyDan McGee1-6/+6
Commit e68f5d9a3067141 did something a bit silly and changed the scriptlet calls to use 'newpkg->handle' rather than the 'handle' argument passed in. Use the handle directly. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-09Require handle for alpm_sync_sysupgrade()Dan McGee3-6/+4
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-09Require handle for alpm_db_register_sync()Dan McGee5-8/+7
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-09Require handle argument to all alpm_trans_*() methodsDan McGee8-45/+50
Begin enforcing the need to pass a handle. This allows us to remove one more extern handle declaration from the backend. Signed-off-by: Dan McGee <dan@archlinux.org>