summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-10-14bash_completion: remove upstream deprecated functionsCarlos Diaz
Populate $cur and $prev with the new bash-completion 1.2 function, _get_comp_words_by_ref. _get_cword and _get_pword have been deprecated. Signed-off-by: Carlos Diaz <839273@gmail.com>
2010-10-13Merge branch 'maint'Dan McGee
2010-10-13Add several pactests for epoch codeDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13Add epoch verification to makepkgDan McGee
If defined, it must be an integer. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13Update contrib/ for epochDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13Add epoch support to pactestDan McGee
This adds epoch support to pactest, while still producing packages and database entries the same way makepkg and repo-add currently do in a backward compatible fashion (still including the 'force' option). Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13Make repo-add and makepkg epoch-awareDan McGee
Allow it to be a variable in the PKGBUILD as well as propagating it through to the built package and the package database. We leave some backward compatibility in place by placing the '%FORCE%' option in the database if the package contains an epoch; this will be used by older versions of pacman and more or less ignored by versions that use epoch. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13Update documentation to reflect new epoch package variableDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13Add epoch support to pacman/libalpmDan McGee
This will allow for better control of what was previously the 'force' option in a PKGBUILD and transferred into the built package. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13Small tweaks after backend mergeDan McGee
Just a few small things I noticed looking through the code. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13Merge remote branch 'allan/backend'Dan McGee
2010-10-14Only write to local reposAllan McRae
We do not write to sync repos so kill the code for that. Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14Clean-up parsing sync databaseAllan McRae
Remove unnecessary parsing of fields not found in sync desc file. Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14Clean-up parsing local databaseAllan McRae
Remove unnecessary parsing of fields not found in local desc files. Leave %FORCE% parsing as this likely will make an appearance in desc files in the future. Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14Remove lazy loading of deltasAllan McRae
Local packages do not have deltas so remove lazy loading of delta information. Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14Move and rename splitnameAllan McRae
The splitname function is a general utility function and so is better suited to util.h. Rename it to _alpm_splitname to indicate it is an internal libalpm function as was the case prior to splitting local and sync db handling. Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14Restrict visibility of checkdbdir and get_pkgpathAllan McRae
These functions are only needed by be_local and were only promoted to db.{h,c} as part of the splitting of handling the local and sync dbs. Move them into be_local.c and make them static again. Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14Clean up all old database files and directoriesAllan McRae
Clean-up the previous download location of the sync database and any old extracted sync database directories which are unneeded with the tar-db backend. Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14Only download sync databasesAllan McRae
As the sync databases are read directly from the tarball, we no longer need to extract them. Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14Parse sync databaseAllan McRae
Read in package information for a tar based sync database. Do not use lazy loading for sync db. Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14Populate sync db from archiveAllan McRae
Read in list of packages for sync db from tar archive. Breaks reading in _alpm_sync_db_read and a lot of pactests (which is expected as they do not handle sync db in archives...). Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14Completely separate local and sync db handlingAllan McRae
Put the db_operations struct to use and completely split the handling of the sync and local databases. Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14Separate be_files into be_sync and be_localAllan McRae
The file be_files.c is "split" to be_local.c and be_sync.c in order to achieve separate handling of sync and local databases. Some basic clean-up of functions that are only of use for local or sync databases has been performed and some rough function renaming in duplicated code has been performed to prevent compilation errors. However, most of the clean-up and final separation of sync and local db handling occurs in following patches. Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-13Fix bash shell location checkDan McGee
BASH is defined when you are actually using bash during configure, which sucks because it ends up being '/bin/sh', messing up all of our scripts. Change the name of the variable we use in configure, and also ensure we get a full path to the executable by using AC_PATH_PROGS rather than AC_CHECK_PROGS. Finally, change the variable name everywhere we use it. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13Move db cache handling functionsAllan McRae
These will be needed for the handling of both local and sync database caches, so put them in a common location. Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-13Move database handling utility functionsAllan McRae
Move splitname, checkdbdir, get_pkgpath into db.{h,c} as these will be needed to parse both the local and sync databases during the initial splitting. They will be moved out of db.{h,c} at to more appropriate locations at a later stage. Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-13Fix documentation syntax and typoAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-13Initial hack at a DB operations structDan McGee
It doesn't do a whole lot yet, but these type of operations will potentially be different for the DBs we load. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13Move the cache stuff where it should beDan McGee
Cache bullshit only has relevance to be_files, so move it there. Signed-off-by: Dan McGee <dan@archlinux.org> [Allan: BIG rebase] Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-13Move changelog functions to callback structDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13Complete rework of package accessor logicDan McGee
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>
2010-10-13Allow local and sync db to be treated separatelyDan McGee
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>
2010-10-13Unify caching concerns in package accessorsDan McGee
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>
2010-10-12contrib/ follow-up workDan McGee
* Add a .gitignore file * Use the same 'GEN' output we have in the scripts/ Makefile when doing our edits on the .in files * Remove PKGBUILD.vim and vimprojects from our edit list, they have no need to be in the list Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11CLI args: stricter/better parsingJakob Gruber
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>
2010-10-11CLI args: reorganize parsingJakob Gruber
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>
2010-10-11util: fall cleaning on single file programsDan McGee
* 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>
2010-10-11Use sysconfdir, localstatedir, BASH instead of hardcoded valuesNezmer
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>
2010-10-11Add .in extension to files in contribNezmer
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>
2010-10-11repo-add: more informative delta messagesXavier Chantry
- 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>
2010-10-11repo-add: add delta generationXavier Chantry
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>
2010-10-11Read 'force' entry from packagesDan McGee
We weren't reading this in from our packages, thus causing us not to write it out to our local database. Adding this now will help ease the upgrade path for epoch later and not require reinstallation of all force packages. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11pactest: fix typo in ignore001Xavier Chantry
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11makepkg: Use mkfifo instead of GNU-only 'mknod <file> p'Nezmer
'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>
2010-10-11CLI args: add pactest with an invalid combinationJakob Gruber
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>
2010-10-11pactest: fix gensyncXavier Chantry
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>
2010-10-11pactest: use simpler method to create tarXavier Chantry
Just like in 24fc623e1a8bf905cf0367f9bd40bc5bd6034378, apply to pmdb gensync as well. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11Only check for function if we are using libfetchDan McGee
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>
2010-10-11Remove use of `seq` in pactreeDan McGee
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>
2010-10-11Avoid stat call to determine is_directory if possibleDan McGee
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>