summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Move changelog functions to callback structDan McGee2010-10-13
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Complete rework of package accessor logicDan McGee2010-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hopefully we've finally arrived at package handling nirvana, or at least this commit will get us a heck of a lot closer. The former method of getting the depends list for a package was the following: 1. call alpm_pkg_get_depends() 2. this method would check if the package came from the cache 3. if so, ensure our cache level is correct, otherwise call db_load 4. finally return the depends list Why did this suck? Because getting the depends list from the package shouldn't care about whether the package was loaded from a file, from the 'package cache', or some other system which we can't even use because the damn thing is so complicated. It should just return the depends list. So what does this commit change? It adds a pointer to a struct of function pointers to every package for all of these 'package operations' as I've decided to call them (I know, sounds completely straightforward, right?). So now when we call an alpm_pkg_get-* function, we don't do any of the cache logic or anything else there- we let the actual backend handle it by delegating all work to the method at pkg->ops->get_depends. Now that be_package has achieved equal status with be_files, we can treat packages from these completely different load points differently. We know a package loaded from a zip file will have all of its fields populated, so we can set up all its accessor functions to be direct accessors. On the other hand, the packages loaded from the local and sync DBs are not always fully-loaded, so their accessor functions are routed through the same logic as before. Net result? More code. However, this code now make it roughly 52 times easier to open the door to something like a read-only tar.gz database backend. Are you still reading? I'm impressed. Looking at the patch will probably be clearer than this long-winded explanation. Signed-off-by: Dan McGee <dan@archlinux.org> [Allan: rebase and adjust] Signed-off-by: Allan McRae <allan@archlinux.org>
* Allow local and sync db to be treated separatelyDan McGee2010-10-13
| | | | | | | | | | | | | | | | | | | | | | | Implement this seemingly simple change in package.h: typedef enum _pmpkgfrom_t { - PKG_FROM_CACHE = 1, - PKG_FROM_FILE + PKG_FROM_FILE = 1, + PKG_FROM_LOCALDB, + PKG_FROM_SYNCDB } pmpkgfrom_t; which requires flushing out several assumptions from around the codebase with regards to usage of the PKG_FROM_CACHE value. Make some changes where required to allow the switch, and now the correct value should be set (via a crude hack) depending on whether a package was loaded as an entry in a local db or a sync db. This patch underwent some big rebasing from Allan and Dan. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* Unify caching concerns in package accessorsDan McGee2010-10-13
| | | | | | | | | | Move almost all of the caching related stuff into a single #define (which should maybe even just be a static function) so we don't duplicate logic all over the place. This also makes the code a heck of a lot shorter and means further changes to this stuff don't have to touch each and every getter function. Signed-off-by: Dan McGee <dan@archlinux.org>
* CLI args: stricter/better parsingJakob Gruber2010-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | In the following, the letters SRUDQ refer to the corresponding pacman operations. Most of the work in this commit is about removing as many options as possible from the global section and moving them to where they actually belong. Additionally, --ignore{,group} are added to U and --dbonly is added to S. --dbonly added to S --asdeps moved to S/U/D --asexplicit moved to S/U/D --print-format moved to S/U/R --noprogressbar moved to S/U/R --noscriptlet moved to S/U/R --ignorepkg added to U --ignoregrp added to U -d moved to S/U/R (--nodeps) and Q (--deps) -p moved to S/U/R (--print) and Q (--file) -f moved to S/U Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* CLI args: reorganize parsingJakob Gruber2010-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split parsing of CLI arguments into separate functions: parsearg_op (operations) parsearg_global (global options) parsearg_{database,query,remove,sync,deptest,upgrade} Organization strictly follows the manpage (even where the manpage is incorrect) - these cases will be fixed in the following commits. Switch cases are copy/pasted and statements unrelated to chosen operation are deleted. Parsing logic adjusted as follows: 1) Parse operation 2) If we can bail out early (duplicate op, help/version requested) do so 3) Parse arguments again: foreach arg: if arg is operation: continue tryparse_args_specific_to_op if unsuccessful tryparse_args_global if unsuccessful print error message and exit Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* util: fall cleaning on single file programsDan McGee2010-10-11
| | | | | | | | | | | * Add a bunch of static declarations where possible * Fix void functions to be proper syntax, e.g. void func(void) * Consistency fixes (such as argv references) * Remove dead str_cmp() function from testdb * Remove unneeded config.h header includes * vercmp: remove completely unnecessary string copying Signed-off-by: Dan McGee <dan@archlinux.org>
* Use sysconfdir, localstatedir, BASH instead of hardcoded valuesNezmer2010-10-11
| | | | | | | | | This applies to contrib/ files, our scripts, and the documentation. Dan: fix 'make clean' in contrib/ directory. Signed-off-by: Nezmer <git@nezmer.info> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add .in extension to files in contribNezmer2010-10-11
| | | | | | | This is needed If we want to use sysconfdir,localstatedir and other variables. Signed-off-by: Nezmer <git@nezmer.info> Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: more informative delta messagesXavier Chantry2010-10-11
| | | | | | | | | - Print an error if database entry was not found and delta entry cannot be added - More informative line when delta entry is added (oldfile -> newfile) Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: add delta generationXavier Chantry2010-10-11
| | | | | | | | | This allows deltas to be generated at repo-add invocation time as opposed to just added to the database. It will generate the delta from the package version currently in the database. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: fix typo in ignore001Xavier Chantry2010-10-11
| | | | | Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: Use mkfifo instead of GNU-only 'mknod <file> p'Nezmer2010-10-11
| | | | | | | | | | 'mknod <file> p' is apparently GNU-only. Looking at coreutils' source code, It just calls mkfifo. This one line patch should fix makepkg logging in non-GNU systems. Signed-off-by: Nezmer <git@nezmer.info> Signed-off-by: Dan McGee <dan@archlinux.org>
* CLI args: add pactest with an invalid combinationJakob Gruber2010-10-11
| | | | | | | | | Pacman should catch cases in which the passed arguments don't apply to the current operation (sync/query/...). Also see FS#20950. Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: fix gensyncXavier Chantry2010-10-11
| | | | | | | | | | | | | | | gensync generated a sync.db file with PKGINFO syntax, this is not quite what pacman expects. Also the file was only added to the Server path: root/var/pub/sync/sync.db but it was not available in the normal sync db path: root/var/lib/pacman/sync/sync.db Change gensync() to generate var/lib/pacman/sync/sync.db and then copy it to var/pub/sync/sync.db (this is used by sync200 -Sy test). Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: use simpler method to create tarXavier Chantry2010-10-11
| | | | | | | Just like in 24fc623e1a8bf905cf0367f9bd40bc5bd6034378, apply to pmdb gensync as well. Signed-off-by: Dan McGee <dan@archlinux.org>
* Only check for function if we are using libfetchDan McGee2010-10-11
| | | | | | | | We did this check unconditionally, rather than only doing it if we were actually going to build and run with libfetch. This is safe because we would have already bailed if libfetch was explicitly requested but not found. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove use of `seq` in pactreeDan McGee2010-10-11
| | | | | | | | | | | | | | This is not a bash builtin, so can potentially cause portability issues. Additionally, the use of it is completely unnecessary as it can all be done within bash (and done faster). $ time pactree xfwm4 >/dev/null (old version) real 0m3.245s $ time ./contrib/pactree xfwm4 >/dev/null (new version) real 0m3.042s Signed-off-by: Dan McGee <dan@archlinux.org>
* Avoid stat call to determine is_directory if possibleDan McGee2010-10-11
| | | | | | | | | | On Linux and OS X, we can determine if an entry obtained through a readdir() call is a directory without also having to stat it. This can save a significant number of syscalls. The performance increase isn't dramatic, but it could be on some platforms (e.g. Cygwin) so it shouldn't hurt to use this unconditionally where supported. Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2010-10-05
|\
| * Check for python-2.7Allan McRae2010-10-05
| | | | | | | | | | | | | | | | | | Add python-2.7 to the list of checked versions of python and add a check for a python2 binary before resorting to the unversioned python binary. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Make testsuite python-2.7 compatibleRémy Oudompheng2010-10-05
| | | | | | | | | | | | | | | | | | os.walk(".") adds a prefix of "./" to filenames in python-2.7 which causes libalpm not to like archives generated in the testsuite resulting in widespread failure. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: canonicalize paths from environmental variablesAllan McRae2010-10-05
| | | | | | | | | | | | | | | | | | | | This prevents circular symlinks and weird final package locations when using commands like 'PKGDEST="." makepkg'. Fixes FS#20922. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: compare paths using bash testAllan McRae2010-10-05
| | | | | | | | | | | | | | | | | | Compare paths using bash's "-ef" rather than by string tests as this takes symlinks into account. This will prevent issues similar to those in FS#20922 if (e.g.) $PKGDEST is a symlink to $startdir. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: improve srcdir check and add pkgdirAllan McRae2010-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | The checking of the package for $srcdir references was overly sensitive and gave a lot of what appear to be false positives with binary files (in particular with debugging symbols kept). Restrict the search for $srcdir to non-binary files as this should still catch the majority of configuration issues the check was initially designed to catch. Also, add a similar check for $pkgdir. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: remove STRIP_DIRSAllan McRae2010-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For binary packages, the majority of the time used in the debugs symbol stripping process is the actual stripping of the binaries/libraries and not the testing of which files to strip. This allows more complete stripping of packages that install to "non-standard" paths that would not be generally included in makepkg.conf. Any performance hit that may be apparent for (_large_) "arch=('any')" packages can readily be avoided by disabling stripping in the PKGBUILD options array. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Set pm_errno on libarchive errors while readingSebastian Nowicki2010-09-27
| | | | | | | | | | Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2010-09-27
|\|
| * bacman: unify package creation with makepkgAllan McRae2010-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently bacman always compresses with gzip now matter what PKGEXT is set to. Rework the entire package creation process to be similar to that in makepkg. This also make the explicit assumption that PKGEXT is defined in makepkg.conf. Thanks to Nelson Chan <khcha.n.el@gmail.com> for the original patch to fix the incorrect package compression. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'build-system'Dan McGee2010-09-27
|\ \
| * | Update build system (automake, autoconf, libtool)Dan McGee2010-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately this patch is hard to split up into smaller chunks. Our build system and the associated automake/autoconf/libtool macros has been left untouched for a while, and could use a refresher. * Upgrade ltmain.sh to the latest version * Move away from a huge acinclude.m4 directory to using individual files in the m4/ subdirectory, suggested by upstream automake documentation * Update all macros to their latest available version * Adjust Makefile.am and autogen.sh to accommodate m4/ subdirectory Signed-off-by: Dan McGee <dan@archlinux.org>
| * | Update more supplementary build scriptsDan McGee2010-09-23
| | | | | | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * | Update config.guess and config.subDan McGee2010-09-23
| | | | | | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * | Clean up root .gitignoreDan McGee2010-09-23
| | | | | | | | | | | | | | | | | | | | | | | | We had a few files listed in here that we have checked in to our repo, which doesn't make a whole lot of sense. Also alphabetize the list while we are at it. Signed-off-by: Dan McGee <dan@archlinux.org>
| * | Update gettext Makefiles to 0.18Dan McGee2010-09-23
| | | | | | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | | Add FORTIFY_SOURCE supportAllan McRae2010-09-27
| | | | | | | | | | | | | | | | | | | | | | | | Adds a check for the minimum mainline GCC version for FORTIFY_SOURCE support and enables -D_FORTIFY_SOURCE=2 by default when building with --enable-debug. Signed-off-by: Allan McRae <allan@archlinux.org>
* | | Add wrapper around asprintf callsAllan McRae2010-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not checking the return value of asprintf calls reuslts in a warning when using -D_FORTIRFY_SOURCE=2. This adds a simple wrapper around asprintf calls which checks the return value. Currently the check does nothing more than outputing a message to stderr on failure, but that is at least an improvement over silent failures. Signed-off-by: Allan McRae <allan@archlinux.org>
* | | repo-add: make --quiet output more quietAllan McRae2010-09-27
|/ / | | | | | | | | | | Fixes FS#20403. Signed-off-by: Allan McRae <allan@archlinux.org>
* | Merge branch 'maint'Dan McGee2010-09-15
|\|
| * Update Portuguese translationGaspar Santos2010-09-15
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * PKGBUILD-example.txt: Remove superfluous "|| return 1".Lukas Fleischer2010-09-15
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update Kazakh translationBaurzhan Muftakhidinov2010-09-15
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * Minor translation file updates after `make distcheck`Dan McGee2010-09-03
| | | | | | | | | | | | | | It touched up these a bit after it ran, so might as well check the changes in so we don't have to deal with them again later. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Retroactive additions to 3.4.1 changesDan McGee2010-09-03
| | | | | | | | | | | | Forgot to mention things involving the translation changes we had. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove quotes in remaining bash regexesDan McGee2010-09-07
| | | | | | | | | | | | | | | | After a8dcfeccfc, Allan noted that one more regular exprssion inside makepkg also contained quotes; these should not be there for the same reason as that commit. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Restore trimming of db and pkg extensionsDan McGee2010-09-07
| | | | | | | | | | | | | | | | These keep having to change because we are getting really good at changing the downloaded filename. Shorten the match sequences to just .db and .pkg and trim everything after and including these strings. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Fix libfetch configure checkingDan McGee2010-09-06
| | | | | | | | | | | | | | | | | | | | I don't know what I tested in commit 3e7b90ff6950, but it definitely wasn't working as advertised. Fix the checks in the source code itself to match the right define (HAVE_LIBFETCH), as well as make sure the configure check defaults to looking for the library but not bailing if it could not be found. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2010-09-03
|\|
| * libalpm Swedish translation updateTobias Eriksson2010-09-03
| | | | | | | | | | Signed-off by: Tobias Eriksson <tobier@tobier.se> Signed-off-by: Dan McGee <dan@archlinux.org>
| * German translation updatesMatthias Gorissen2010-09-02
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>