summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* pactree: add -s option to walk sync DBsDave Reisner2011-06-24
| | | | | | | | | | | | | Add a whole lot of bloat to parse pacman.conf and only a few lines to use the list of sync DBs instead of the local DB. Dan: I fully plan on this being temporary and us finding a better way in the future to parse pacman.conf from multiple binaries. Adding a standalone config parser is probably not the right way of going about things, but for now it is by far the easiest. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Make sync DB reading a bit more flexibleDan McGee2011-06-24
| | | | | | | | | | | We can reorganize things a bit to not require reading a directory-only entry first (or at all). This was noticed while working on some pactest improvements, but should be a good step forward anyway. Also make _alpm_splitname() a bit more generic in where it stores the data it parses. Signed-off-by: Dan McGee <dan@archlinux.org>
* archive_fgets(): ensure we return any trailing text with no newlineDan McGee2011-06-24
| | | | | | | | | | Discovered this when doing some pactest rewrite work to generate archives in memory only. If a sync database file or PKGINFO file is missing a newline on the final line, the text from that line gets tossed aside and never read into the package struct. This is pretty critical when that last line is a depend or something. Signed-off-by: Dan McGee <dan@archlinux.org>
* valgrind.supp: add known leaks from GPGMEDan McGee2011-06-24
| | | | | | | Thank you too, GPGME, for these. Why don't you provide a way to clean up your static variable mess? Signed-off-by: Dan McGee <dan@archlinux.org>
* pactree: carry a list of databases for dep resolutionDave Reisner2011-06-24
| | | | | | | | | | | | Declare an alpm_list which, for now, only holds our local database. walk_deps and walk_reverse_deps are refactored to account for this, and a helper function is added to wrap alpm_db_get_pkg for traversing a list. This is groundwork for letting pactree walk the sync DBs. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: Remove a lone quotation markWieland Hoffmann2011-06-24
| | | | | | | Allan broke it in 4bdb868. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: remove the cleancache optionAllan McRae2011-06-24
| | | | | | | | | This is a fairly useless feature given all it does is an "rm" on a directory. It is also unlikely that you would want to remove the entire SRCDEST anyway, but rather just the old files. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Don't require a transaction for sync DB updatesDan McGee2011-06-24
| | | | | | | Instead, just do the required locking directly in the backend in calls to alpm_db_update(). Signed-off-by: Dan McGee <dan@archlinux.org>
* Move locking functions to handleDan McGee2011-06-24
| | | | | | | | | These operate on the handle, and the state is stored on the handle, so move them where they belong. Up until now only the transaction stuff calls them, but this will soon change and alpm_db_update() will handle locking all on its own. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add a 'valid' flag to the database objectDan McGee2011-06-24
| | | | | | | | | | | | | | Start by converting all of our flags to a 'status' bitmask (pkgcache status, grpcache status). Add a new 'valid' flag as well. This will let us keep track if the database itself has been marked valid in whatever fashion. For local databases at the moment we ensure there are no depends files; for sync databases we ensure the PGP signature is valid if required/requested. The loading of the pkgcache is prohibited if the database is invalid. Signed-off-by: Dan McGee <dan@archlinux.org>
* Move database 'version' check to registration timeDan McGee2011-06-24
| | | | | | | | This is another step toward doing both local database validation (ensuring we don't have depends files) and sync database validation (via signatures if present) when the database is registered. Signed-off-by: Dan McGee <dan@archlinux.org>
* Do database signature checking at load timeDan McGee2011-06-24
| | | | | | | | | | | | | | | | | | This is the ideal place to do it as all clients should be checking the return value and ensuring there are no errors. This is similar to pkg_load(). We also add an additional step of validation after we download a new database; a subsequent '-y' operation can potentially invalidate the original check at registration time. Note that this implementation is still a bit naive; if a signature is invalid it is currently impossible to refresh and re-download the file without manually deleting it first. Similarly, if one downloads a database and the check fails, the database object is still there and can be used. These shortcomings will be addressed in a future commit. Signed-off-by: Dan McGee <dan@archlinux.org>
* Document group and providers selectionAllan McRae2011-06-24
| | | | | | | | | The format required for selection of packages within the group selection dialog is not entirely obvious, so provide some documentation. Fixes FS#24134. Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: clean-up of output messagesAllan McRae2011-06-24
| | | | | | | | | | | | | | | | There was a lot of inconsistency in how strings that should not be translated (program names, option flags, PKGBUILD directives, etc) were handled. This patch moves them all outside the gettext invocation for consistency and to prevent accidental translation. Note that some of these may need reverted if they cause difficulties in translation due to gettext usage in bash not taking positional parameters for arguments. A quick survey of current translations indicates that this issue will be rare. Also, we should be able to catch these before a full string freeze given we are going to probably need a "developer preview" release before the next release series. Signed-off-by: Allan McRae <allan@archlinux.org>
* pactest: generate sync DB's in memoryDan McGee2011-06-24
| | | | | | | | | | | | | | | | | | Sync database are no longer exploded on the filesystem. Rework the logic used to generate our test databases so we can create them completely in memory without having to write the individual files to disk at all. The local database is unaffected. Note that several shortcomings in libalpm parsing were discovered by this change, which have since been temporarily patched around in this test suite: * archive_fgets() did not properly handle a file that ended in a non-newline, and would silently drop the data in this line. * sync database with only the file entries and not the directories would fail to parse properly, and even cause segfaults in some cases. Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: refactor install file creationDan McGee2011-06-24
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: move filelist/backup generation into package objectDan McGee2011-06-24
| | | | | | | These are definite methods that operate on a package, so move them there which cleans up util a bit more. Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: make pmfile a bit more pythonicDan McGee2011-06-24
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: small cleanups and chmod -x most filesDan McGee2011-06-24
| | | | | | Remove empty docstrings, small and easy pylint fixes, etc. Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: clean up database section writingDan McGee2011-06-24
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: add isize attribute, fix url attributeDan McGee2011-06-24
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove three unnecessary usages of alpm_list_count()Dan McGee2011-06-24
| | | | | | | | For the files count when loading from a package, we can keep a counter. The two in the frontend were completely useless due to the fact that if sync_dbs is non-NULL, alpm_list_count() will always be greater than 0. Signed-off-by: Dan McGee <dan@archlinux.org>
* Prevent segfault when parsing unexpected sync database fileDan McGee2011-06-24
| | | | | | | | | This doesn't fix the real (bigger) problem of failing to parse sync databases without directory entries, but it does prevent the parser from segfaulting when the first desc file encountered did not have a directory entry, among other conditions. Signed-off-by: Dan McGee <dan@archlinux.org>
* parse-options: simplify unused-arg & parameter printingDave Reisner2011-06-24
| | | | Signed-off-by: Dave Reisner <d@falconindy.com>
* Merge branch 'po-split'Dan McGee2011-06-23
|\
| * scripts/po/: add pacman-keyDan McGee2011-06-23
| | | | | | | | | | | | | | This has gettext strings, but wasn't added to the list of files in POTFILES.in just yet. Add it and update the catalogs. Signed-off-by: Dan McGee <dan@archlinux.org>
| * src/pacman/po/: prune message catalog and translationsDan McGee2011-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have performed the split, prune the catalogs of all scripts-only messages. All old messages were pruned from the files using the following command: sed -i -e '/^#\~/,$d' *.po Note: the diff on this commit looks much less insane if the --patience option is used. Signed-off-by: Dan McGee <dan@archlinux.org>
| * scripts/po/: prune message catalog and translationsDan McGee2011-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have performed the split, prune the catalogs of all pacman-only messages. All old messages were pruned from the files using the following command: sed -i -e '/^#\~/,' *.po Note: the diff on this commit looks much less insane if the --patience option is used. Signed-off-by: Dan McGee <dan@archlinux.org>
| * po/: split into scripts/po/ and src/pacman/po/Dan McGee2011-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | This is the first step at separating the pacman message catalog and the scripts message catalog. Makefiles, configure.ac, and other such files are adjusted accordingly, as well as renaming files. The TEXTDOMAIN of scripts is also adjusted. Note that no actual pot or po files get changed here; these will get pruned in a future commit so each catalog contains only the necessary messages. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update all translation filesDan McGee2011-06-23
| | | | | | | | | | | | | | | | This is for the eventual 4.0.0 release, but more importantly to logically separate new translations and strings from the PO split about to happen between pacman and scripts. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Let configure gettext setup know we use ngettext()Dan McGee2011-06-23
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: fix path designation regressionDave Reisner2011-06-23
| | | | | | | | | | | | | | | | | | | | b899099 made path checking a bit more strict than I had intended, and would actually forbid creation of a repo in $PWD if only the filename was specified. readlink would be the fun and easy solution here, but it's avoided due to portability issues, making the validation process a bit more verbose. Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: Added checks in check_software for distcc, ccache, strip and gzipEric Bélanger2011-06-23
| | | | | | | | | | | | | | Dan: slightly shorten some of the messages. Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: remove distcc/makeflags option interactionDan McGee2011-06-23
| | | | | | | | | | | | | | | | | | | | | | Way back in c94bfbaba when refactoring makepkg options handling, I added these lines to unset MAKEFLAGS if '!distcc' was set in a PKGBUILD (not taking into account makepkg.conf settings). This was an attempt to say "if it is broken in distcc, it is probably broken even more". However, this is silly as one should be using '!makeflags' as well. Remove the linkage. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Convert backup list to new pmbackup_t typeDan McGee2011-06-22
|/ | | | | | | | This allows us to separate the name and hash elements in one place and not scatter different parsing code all over the place, including both the frontend and backend. Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: fix 'check_sofware' typoDan McGee2011-06-22
| | | | | | Allan broke it! Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: style cleanupDave Reisner2011-06-22
| | | | | | | Unify function braces to be top right opening, bottom left closing. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fixed outdated documentation in test/pacman/READMEKerrick Staley2011-06-22
| | | | | | | test/pacman/README mentioned the -A flag, which no longer exists. Signed-off-by: Kerrick Staley <mail@kerrickstaley.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: add software check functionAllan McRae2011-06-22
| | | | | | | | | | | Add a function that checks for the software needed by makepkg to process a PKGBUILD with the requested options. This allows makepkg to bail early in the packaging process. Many other checks can be added to this function... Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove old TODO listsAllan McRae2011-06-22
| | | | | | | | | These had not been touched since 2007 and had lost most of their relevance. The bug tracker is a better place for the filing of ideas. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: move comment into correct placeAllan McRae2011-06-22
| | | | | | | Oops... Introduced by commit d21f6ca4. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: adjust libprovides/depends messagesAllan McRae2011-06-22
| | | | | | | | | Contractions are less clear for non-native speakers so should be avoided (and cause syntax highlighting issues). Also, the 'provides' and 'depends' strings are not to be translated. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: allow specifying alternative build directoryAllan McRae2011-06-22
| | | | | | | | | | Add a BUILDDIR variable (which can be overridden in the environment) to specify an alternative location for building the package. This is useful for people who want to build on a different filesystem for improved performance (e.g. tmpfs). Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: Add UPX compression supportAllan McRae2011-06-22
| | | | | | | | | | | This patch enables the automatic compression of executable binaries using UPX when the 'upx' options is specified in makepkg.conf or the PKGBUILD. Additional arguments can be passed to UPX by specifying the UPXFLAGS variable. Original-patch-by: Bryce Gibson <bryce@gibson-consulting.com.au> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: show better error when path to repo does not existDave Reisner2011-06-20
| | | | | | | | | | | | | | | | Previously, the error message when trying to add to a repo where a parent directory didn't exist was: ==> ERROR: Failed to acquire lockfile: /path/to/noexist/repo.tar.gz.lck This sucks. Make an explicit check to ensure that the path to the repo really does exist, and throw a meaningful error message when it can't be found. Dan: reuse an existing (translated) error message. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: allow creating a database with no compressionDan McGee2011-06-20
| | | | | | | | A plain '.tar' ending should be allowed. This corresponds to how we handle this extension in makepkg. Also fix up the other extension checks, which were missing a leading '.' character. Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: use bash equivalents of basename/dirnameDave Reisner2011-06-20
| | | | Signed-off-by: Dave Reisner <d@falconindy.com>
* lib/util: call _alpm_log before setting handle->pm_errnoDave Reisner2011-06-20
| | | | | | | | | This is an unfortunate chain of events. RET_ERR and RET_ERR_VOID will eventually call CHECK_HANDLE, which resets the handle's pm_errno member. Dan probably had a reason for doing this, so we merely switch the order of operations in the RET_ERR macros to avoid stomping on our pm_errno. Signed-off-by: Dave Reisner <d@falconindy.com>
* pactest: add retcode=0 to several testsDan McGee2011-06-20
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: fix broken syntax (double $)Florian Pritz2011-06-20
| | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>