summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2008-02-06New remove option : -u / --unneeded (FS#6505).Nagy Gabor1-0/+3
With --unneeded option 'pacman -R' doesn't stop in case of dependency error; it removes the needed-dependency targets from the target-list instead. See also: http://archlinux.org/pipermail/pacman-dev/2007-October/009653.html . The patch also adds a new causingpkg field to pmdepmissing_t which indicates the to-be-removed package which would cause a dependency break. This is needed, because miss->depend.name may be a provision. miss->causingpkg will be useful in -R dependency error messages too. [Xavier: renamed inducer to causingpkg, removed the _alpm_pkgname_pkg_cmp helper function as requested by Aaron. This might be added by a further commit. Other small cleanups, updated manpage and bash completion.] Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-06Merge branch 'maint'Dan McGee6-9/+46
Conflicts: contrib/gensync contrib/updatesync
2008-02-06Don't follow symlinks with -Qo.Chantry Xavier1-4/+11
Fixes FS#9473 and the issue reported there : http://www.archlinux.org/pipermail/pacman-dev/2008-February/011061.html Only the dirname should be resolved, not the basename. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-06pacman/util.c: add mdirname functionDan McGee2-0/+29
This function mirrors mbasename and will be used by the 'owns' machinery. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-06Remove "Installed Size" hackerationDan McGee1-5/+1
Keeping this hack around where installed size is only shown if it is greater than total download size encourages broken repository databases. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-03Clarify the "failed to add target" errors.Chantry Xavier3-5/+6
Make the error message printed when addtarget fails consistent between add.c, remove.c and sync.c. The main problem was that the "failed to add target" in case of a removal operation could sound confusing. There was also a little output problem with -U ("failed" was missing). Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-27pmsyncpkg_t cleanupNagy Gabor1-14/+11
Fix for sync044.py and reason001.py. Rename sync->data to sync->removes (alpm_list_t *) Replace pmsynctype_t sync->type by pmpkgreason_t sync->newreason The type field was set to UPGRADE or DEPEND or REPLACE. Instead of using type = UPGRADE or DEPEND, we now rather use a "pmpkgreason_t newreason" field directly (= explicit or depend) which allows a better handling of the install reason. And the REPLACE type is now deduced implicitly when the sync->removes list is not empty. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-27Merge branch 'maint'Dan McGee1-6/+3
2008-01-27Clarify the "cancel current operation" message.Chantry Xavier1-6/+3
Fixes FS#9295. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> [Dan: 'new pacman' -> 'new pacman version'] Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-24testdb : add conflicts checking.Chantry Xavier1-0/+8
Testdb will now scan the local database to check there are no conflicts. I'm not sure how it's possible to get this situation. At least pacman doesn't allow installing a package that conflicts with a local one, without removing the local one. But maybe in a very weird situation, or because of a bug, it could be possible. But anyway, this only requires 5 lines of code. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-22Merge branch 'maint'Dan McGee3-4/+4
2008-01-22New --asexplicit optionNagy Gabor1-0/+7
This is the symmetric of --asdeps, install packages explicitly. Documentation and completion files were updated accordingly. Added sync301.py and upgrade032.py pactest files to test this. I also made a little modification in ALLDEPS handling too. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-22Move the deptest code from frontend to backend.Chantry Xavier1-38/+8
The deptest code (pacman -T) used by makepkg was mostly in the frontend. There were 2 drawbacks: 1) the public splitdep function returns a pmdepend_t struct, but the _alpm_dep_free function for freeing it is private. So there was a memleak. 2) there is a helper in the backend (satisfycmp in deps.c) which makes this function much easier. So this adds a new public alpm_deptest in libalpm/deps.c, which cleans pacman_deptest in pacman/deptest.c a lot. Besides, alpm_splitdep was made private, because the frontend no longer requires it, and _alpm_dep_free is also private. Finally the deptest001 pactest was extended. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-20two string fixes.Chantry Xavier2-2/+2
* added a newline to a conflict message in add.c * removed the trailing dot in a replace message in callback.c. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-20Remove frontend translation of "debug:" messageDan McGee1-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-15Merge branch 'maint'Dan McGee2-4/+3
2008-01-15Revert "Fix case where pacman asks for confirmation when it should not"Chantry Xavier1-2/+1
yesno function already handles noconfirm. No need to do it twice. This reverts commit dffa0654f2eae1c427a74c647d22f0bbd201ccf7.
2008-01-14Disallow a NULL section in _parseconfigDan McGee1-2/+2
If we allow _parseconfig to continue processing when section is not defined, then we have the potential to segfault during strcmp calls. This is no good. For some reason, we had existing logic that tested this case but only if it was processing and 'Include' directive. Expand the check to check for a NULL section in all cases, and print an error message if this is the case. Reported here: http://bbs.archlinux.org/viewtopic.php?id=42235 Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-13Merge branch 'maint'Dan McGee1-5/+13
2008-01-13Notify of package replacements when using noconfirmAllan McRae1-5/+13
Fixes FS#5179. Prints a notification of package replacements when updating the packages using the --noconfirm flag. Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-12Merge branch 'maint'Dan McGee1-4/+2
2008-01-12Make the user-agent string a bit less verboseDan McGee1-4/+2
We shouldn't pass things like the kernel version in the user agent string, as it may be a bit too revealing and is not really necessary. Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=57555 Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-11Use dynamic string allocation in package structuresDan McGee1-0/+4
This also affects all structures with static strings, such as depmiss, conflict, etc. This should help a lot with memory usage, and hopefully make things a bit more "idiot proof". Currently our pactest pass/fail rate is identical before and after this patch. This is not to say it is a perfect patch- I have yet to pull valgrind out. However, this should be quite safe to use in all situations from here on out, and we can start plugging the memleaks. Original-work-by: Aaron Griffin <aaronmgriffin@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-11Output a single newline on receipt of a SIGINTDan McGee1-5/+6
Fixes FS#9147, where issuing a ctrl-C at a prompt puts the users prompt on the same line as our question. This can also occur during download bars. Although we might end up putting one too many newlines to the screen now, it is better than not putting one at all. Also update the copyright in pacman.c. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-11Rename -t --orphans to -t --unrequired (FS#9144).Chantry Xavier3-7/+7
It turns out the orphan name was misleading. Real orphans are packages installed as dependency no longer required by any others (-Qtd). The -t option only shows package not required by any others, so --unrequired describes it better. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-10Move the fallback on providers from backend to frontend.Chantry Xavier1-3/+31
This reverts commit e28973169d2e5eda8b64ebdda11ece0dc761d978. This code might fit better in the frontend than in the backend finally. Ref: http://www.archlinux.org/pipermail/pacman-dev/2007-November/010150.html I also changed it for fixing FS#8763 : if there is exactly one provider, pacman will pull it and print a warning. if there are several providers, pacman will list them and fail. It's up to the user to pick one. Add sync501 pactest to reflect that.
2008-01-08Remove upgradedelay and all code associated with itDan McGee1-5/+0
It wasn't even implemented correctly, and it really doesn't have a use if packagers just do their job correctly anyway for a distro. Let's not try to solve a problem with the wrong solution now. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-29Fix case where pacman asks for confirmation when it should notKarolina Lindqvist1-1/+2
There is another case where pacman-git asks for confirmation, when it should not. It is when removing packages. If running with makeworld --noconfirm --rmdeps the question will come to the log file, and never appear on the console, so you can wait forever wondering what is happening. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-21Check ignored packages in _alpm_sync_addtarget().Nathan Jones1-1/+1
This will allow someone to install a group but ignore individual packages inside the group. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-21testdb : fix wrong usage of checkdeps.Chantry Xavier1-2/+1
During last rebase where the checkdeps prototype changed, I messed up the arguments order (remove list, then upgrade list). That made testdb totally useless. Also remove the newline that was manually added by the log callback. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-18Allow unreadable Include files to be non-fatalAaron Griffin1-6/+3
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> [Dan: remove unused variable, make parseconfig static] Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-18Only query pacman upgrade when performing actual upgradeAllan McRae1-36/+38
Fixes FS#7147. Do not ask about upgrading pacman when -w and -p flags are used. Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-11Update GNU GPL boilerplate and copyright datesDan McGee18-61/+25
Update the GPL boilerplate to direct people to the GNU website for a copy of the license, as well as bump all of Judd's copyrights to 2007. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-09Improve changelog handling through addition of open/read/close functionsDan McGee3-26/+23
Thanks to Allan for inspiring all this work on what was one little TODO item in the codebase. :) Change changelog handling so we can now dump a changelog from both installed packages and package files (fixes FS#7371). We do this by moving all of the machinery to the backend where it should have been in the first place. The changelog reading is now done through a open/read/close interface similar to the fopen/fread/fclose functions (can you guess how it is done?). It is buffered by the frontend, so programs using the library can read as much or as little as they want at a time. Unfortunately, I could not implement a changelog_feof function due to some shortcomings of libarchive. However, I left the stub code in there, commented out, in case it becomes possible later or anyone wants to take a stab at it. Original-work-by: Allan McRae <mcrae_allan@hotmail.com> Improved-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-09src/pacman/: use the FREELIST macro when possible.Chantry Xavier4-9/+4
Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-09testdb.c : add vim modeline according to HACKING, and reindent the file.Chantry Xavier1-98/+100
Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-06pacman/sync.c : improve the sync db cleanup feature.Chantry Xavier1-10/+14
This feature (introduced by b118ce55bd01c7ebd42b5b6d4a0f34aa925701d8 as a part of -Sc) could actually be helpful in the 3.0 -> 3.1 transition, because all sync dbs will be left in /var/lib/pacman/, while the updated ones will go to /var/lib/pacman/sync/. So it'll now clean everything in /var/lib/pacman/, and only the unused databases in /var/lib/pacman/sync/ (with the exception of local/ and sync/ in both cases). Note: This feature is undocumented. I wonder if moving it to another option, something like -S --dbclean, wouldn't help for documenting it. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-04Update some errors in messages found during localizationDan McGee1-2/+2
Also perform the updates in the message files so we don't break translations. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-04pacman/sync.c: mark sync_trans as staticDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-04Oops- forgot to ever set init to 1 in setlibpaths()Dan McGee1-0/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-04Delay output during progress barChantry Xavier3-3/+65
This fixes the output issue related to the progress bar by delaying the output. We can decide later (post-release) if we like this method or we want to switch to something else. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> [Dan: just some minor cleanups] Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02parseconfig: refactor duplicate code out into a functionDan McGee1-66/+39
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02Remove "done" messages from frontend callback functionDan McGee1-31/+16
This should simplify our output a bit when it comes to determining whether or not we need a newline in our output. A "done" message was almost always immediately followed by another start message anyway (or some other output), so it really isn't necessary. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02Fixes for the ineptitude of libalpm DB registrationDan McGee1-45/+61
When a DB is "registered" in libalpm, it goes and tries to create paths and other BS which is stupid, but a pain in the butt to fix. For now, work around this terrible behavior by ensuring our paths are always set before we call any alpm_db_register function. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02Make pacman path handling (hopefully) a bit more intuitiveDan McGee3-41/+62
I made pacman path handling a bit odd with my rootdir changes a while back in order to increase flexability. However, it had a bit of a drawback in that dbpath/logfile/etc. would not default to being under the rootdir if that was the only parameter you specified in the config file or on the command line. (Note: logfile handling was always broken due to the explicit logfile line required in config files) Pacman now works as follows: if a rootdir is specified but not dbpath or logfile: attempt to place the logfile and dbpath in their default locations under root if an explicit dbpath/logfile is specified: interpret these as absolute paths, regardless of the rootdir setting if nothing is specified: fall back to configured defaults Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02Add new --needed option for -S.Chantry Xavier2-16/+8
During a pacman operation such as a group install, pacman can ask several questions such as "local version is up to date. Upgrade anyway?". They are usually all answered either by yes or by no: * yes when you want to reinstall all the targets. * no when you only want to install the missing ones (either because you are installing a group, or because you are copying a pacman -S line from wiki or whatever). So instead of asking this question for each target, it is now now configured with a flag. Yes will be the default -S behavior, No will be achieved with the --needed flag. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-01Unify dump_pkg_full in pacman [-Si, -Qip, -Qi and -Qii]Nagy Gabor4-62/+58
dump_pkg_sync is now a trivial wrapper for dump_pkg_full Some smaller changes: * string_display function added to util.c [prints None in case of empty string] * Filename field added to -Qip * rename License to Licenses * 'Compressed Size' used instead of 'Download Size' for -Qip Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> [Dan: fix whitespace errors, spacing issues, const modifiers] Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-29Move requiredby computation before any display startsDan McGee1-2/+6
This should reduce the chances of people thinking pacman hung during the middle of something. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-25pacman/query.c : -Qo optimization.Chantry Xavier1-0/+8
I didn't understand why realpath was called on every files of every filelist in query_fileowner : ppath = resolve_path(path); It turns out this is needed for the diverted files. For example, cddb_get installs /usr/lib/perl5/site_perl/5.8.8/CDDB_get.pm which actually ends in /usr/lib/perl5/site_perl/current/CDDB_get.pm . And for making pacman -Qo /usr/lib/perl5/site_perl/current/CDDB_get.pm , realpath has to be called on both the target, and the file in the filelist. However, realpath is costly, and calling it on every single file resulted in a poor -Qo performance. Worst case : pacman -Qo /lib/libz.so.1 0.35s user 1.51s system 99% cpu 1.864 total So I did a little optimization to avoid calling realpath as much as possible: first compare the basename of each file. Result: src/pacman/pacman -Qo /lib/libz.so.1 0.24s user 0.05s system 99% cpu 0.298 total Obviously, the difference will be even bigger at the first run (no fs cache), though it's quite scary on my system : 1.7s vs 40s previously. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-25Move mbasename from pacman.c to util.cChantry Xavier3-22/+23
This function can be useful in other places. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>