summaryrefslogtreecommitdiff
path: root/src/pacman/pacman.c
Commit message (Collapse)AuthorAge
* Add a fetch callback to allow front-end download supportSebastian Nowicki2009-07-22
| | | | | | | | | | | This allows a frontend to define its own download algorithm so that the libfetch dependency can be omitted without using an external process. The callback will be used when if it is defined, otherwise the old behavior applies. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> [Dan: minor cleanups] Signed-off-by: Dan McGee <dan@archlinux.org>
* Introduce -SuuNagy Gabor2009-07-22
| | | | | | | | | | | | | | | If the user switches from unstable repo to a stable one, it is quite hard to sync its system with the new repo (the user will see many "Local is newer than stable" messages, nothing more). That's why I introduced -Suu, which treats a sync package like an upgrade, iff the package version doesn't match with the local one's. I added a new pactest (sync104.py) to test this, and I updated the documentation of -Su. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> [Dan: slight doc reword] Signed-off-by: Dan McGee <dan@archlinux.org>
* New feature: files verificationDan McGee2009-07-22
| | | | | | | | | | | | | This implements FS#13877. Add a new option "-Qk" which checks if all of the files for a given package (or packages) are really on the system (i.e. not accidentally deleted). This can be combined with filters and other display options. It also respects both the --quiet and --verbose flags to give varying levels of output. Based on the original patch by Charly Coste <changaco@laposte.net>, thanks for your work! Signed-off-by: Dan McGee <dan@archlinux.org>
* Update copyright headers and messagesDan McGee2009-07-01
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* We don't need root with -SpNagy Gabor2009-06-01
| | | | | | | | | | | | FS#8905 is fixed. The front-end passes PM_TRANS_FLAG_NOLOCK to the back-end, so it doesn't lock the database. That's why we don't need root anymore. I reworked (and renamed) needs_transaction() accordingly. I also added missing -Sc check there (for example, -Sci didn't print non-root error, but pacman wanted to lock the database). Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Change package to package(s) and file to file(s) in documentationNagy Gabor2009-06-01
| | | | | | | | The pacman --help pages and the manual suggested that only one package can be upgraded/removed per transaction. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Query documentation updatesNagy Gabor2009-05-18
| | | | | | | | | | The old documentation didn't emphasize our filtering options at all, and it was a bit misleading. ("List ALL...") I also clarified the description of -Qu. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Document --debugNagy Gabor2009-04-05
| | | | | | | | After some irc/forum experiences, I decided to document this option. However, I left the debug-level undocumented (--debug=2). Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* HoldPkg reworkNagy Gabor2009-01-12
| | | | | | | | | | | | | | | | | | | The HoldPkg feature is even more important when the packages to be held are pulled automatically by pacman, in a -Rc and -Rs operation. Before, it only applied when the packages were explicitly requested by the user to be removed. This patch extends holdpkg to -Rc and -Rs by doing the HoldPkg check just before trans_commit. Additionally, the whole HoldPkg stuff was moved to the front-end. I changed the default behavior to "don't remove", so I modified remove030.py pactest as well. See also: FS#9173. Original-work-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2008-12-02
|\ | | | | | | | | Conflicts: lib/libalpm/dload.c
| * Give an error message on alpm_db_register_sync() errorNagy Gabor2008-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch slightly modifies pacman.c/_parseconfig(): See FS#12148. Now pacman prints the following error message in that case: "error: could not register 'unstable' database (could not open database)" I also added an error message for alpm_db_setserver() error. I changed the "return(1);" scheme to "ret = 1; goto cleanup;" to make sure that we free allocated memory and close open files. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* | -Qu reworkNagy Gabor2008-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | From now on -Qu is an "outdated package" filter on local database. (This is a behaviour change.) This patch fixes some memleaks and makes the code cleaner, for details see my comment on FS#7884. FS#11868 is implemented. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-10-12
|\|
| * Make interrupt handler async-safeDan McGee2008-10-12
| | | | | | | | | | | | | | Calling printf() in a signal handler can be dangerous, so avoid it by writing directly which is guaranteed to be safe according to signal(7). Signed-off-by: Dan McGee <dan@archlinux.org>
| * Ensure we don't have double slashes when creating frontend pathsDan McGee2008-10-12
| | | | | | | | | | | | | | | | Because libalpm always returns a root path with a trailing slash, when we use it to create our unspecified paths we get double slashes in the result. Use the fix suggested by Jürgen Hötzel to remedy this. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-08-26
|\|
| * Add missing comma to -S --help messageRoman Kyrylych2008-08-25
| | | | | | | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Move -Sp implementation to the front-endNagy Gabor2008-08-23
|/ | | | | | | | | | | | | | This patch kills one of our hackish pseudo transactions: PRINTURIS. (The other one is -Sw) From now on, front-end must not call trans_commit in case of -Sp, it should print the uris of target packages "by hand" instead. PRINTURIS flag was removed, NOCONFLICTS flag can be passed to skip conflict checks. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Cleanup of _alpm_pkg_compare_versions.Xavier Chantry2008-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change the return values to be more informative. It was previously boolean, only indicating if a sync package was newer than a local package. Now it is a simple wrapper to vercmp, handling the force flag. * Remove the verbose output from _alpm_pkg_compare_versions. The "force" message is not so useful. The "package : local (v1) is newer than repo (v2)" message can be moved to -Su operation. For the -S operation, it is better to have something like : "downgrading package from v1 to v2" * Don't display the "up to date -- skipping" and "up to date -- reinstalling" messages, when the local version is newer than the sync one. * Fix the behavior of --needed option to not skip a target when the local version is newer, and clarify its description. * Add a new alpm_pkg_has_force function This allows us to access the pkg->force field like any other package fields. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman : clarify help message.Xavier Chantry2008-08-23
| | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman.c: fix typo s/NoPassiveFTP/NoPassiveFtpXavier Chantry2008-08-19
| | | | | | | | | | | | | This fixes FS#11203. The doc has always mentioned NoPassiveFtp, but an inconsistency was introduced with commit 76f816b9f764434d02e90207ee4656ebae2b6a8c when case sensitive comparision was introduced, and was only found after commit b3e6cf652c9e989badaf5499abb1d64c1a110927 which dropped the case insensitive comparison. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove UseColor from front-endNagy Gabor2008-07-29
| | | | | | | This option wasn't used. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Various updates needed prior to a new releaseDan McGee2008-06-08
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Reimplement TotalDownload functionalityDan McGee2008-06-04
| | | | | | | | | | | | Add a new totaldlcb callback function to libalpm and make pacman utilize it when the TotalDownload option is enabled. This callback function is pretty simple- it is meant to be called once at the beginning of a "list download" action, and once at the end (with value 0 to indicate the list has been finished). The frontend is responsible for keeping track of adding individual file download amounts to the total xfered amount in order to display some sort of overall progress. Signed-off-by: Dan McGee <dan@archlinux.org>
* Allow GIT version to be used in pacman buildsDan McGee2008-05-31
| | | | | | | | | | | | | | | | | Add a new configure flag, --enable-git-version, that allows the output of 'git describe' to be used in the version string associated with this package. This could aid in debugging for users that are using a development version of pacman and we should be able to figure out which cut of code they are using. Sample output: $ pacman --version Pacman v3.1.4-190-g4cfa-dirty - libalpm v2.3.1 $ makepkg --version makepkg (pacman) 3.1.4-190-g5861-dirty Signed-off-by: Dan McGee <dan@archlinux.org>
* Disable geteuid in cygwin.Xavier Chantry2008-05-14
| | | | | | | | | | This is one of those rare cases where we actually want to code in a platform-specific #ifdef. Because you don't need to be the root user on a Windows box, and fakeroot doesn't exist so we can do easy testing, lets disable any checking of the UID. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add SyncFirst option.Chantry Xavier2008-05-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch offers a way to fix FS#9228. By putting "SyncFirst = pacman" in pacman.conf, the version check will happen before the transaction really starts, and before any replacements is made. Otherwise, no version check is done. The sync301 pactest was updated to use this SyncFirst option. Example session with SyncFirst = pacman, and a newer pacman version available : $ pacman -Su (or pacman -S <any targets>) :: the following packages should be upgraded first : pacman :: Do you want to cancel the current operation :: and upgrade these packages now? [Y/n] resolving dependencies... looking for inter-conflicts... Targets: pacman-x.y.z-t Total Download Size: x.xx MB Total Installed Size: x.xx MB Proceed with installation? [Y/n] n As Nagy previously noted, doing this check on any -S operations might look intrusive, but it can be required. For example, the case where you want to install a package with versioned provisions, using a pacman version which didn't support that feature yet (and there is already a newer pacman in sync db supporting it). Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Make all error messages use pm_fprintfAllan McRae2008-05-11
| | | | | | | | | | Tested using many easily generated error conditions. Also added "malloc failure" (conf.c) and "segmentation fault" (pacman.c) error messages for translation. Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> [Dan: fix trailing whitespace errors, other compilation issues] Signed-off-by: Dan McGee <dan@archlinux.org>
* Update configure.ac to current codeDan McGee2008-04-07
| | | | | | | | Remove a few functions and things that were unnecessary, update the help line calls to the current function name, and make the small change to pacman.c for the signal handler return type that is defined in config.h. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add new CleanMethod option.Chantry Xavier2008-03-23
| | | | | | | | | | | | | | | | As it was already mentioned several times, the new -Sc behavior in 3.1 is great, but only when the package cache is not shared. This option has two possible values : KeepInstalled and KeepCurrent With KeepCurrent, -Sc will clean packages that are no longer available in any sync db, rather than packages that are no longer in the local db. The resulting behavior should be better for shared cache. Ref : http://www.archlinux.org/pipermail/pacman-dev/2008-February/011140.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Kill the dependsonly option.Chantry Xavier2008-03-22
| | | | | | | From the man page : "This is pretty useless and we're not sure why it even exists." Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* Drop case insensitive comparisons in the config parsing.Chantry Xavier2008-03-17
| | | | | | | | | | | | | | | These case insensitive comparisons didn't work in some locales, like tr_TR where upper(i) != I. So a second case sensitive comparison had to be made for each directive. Only keeping case sensitive comparisons make the code cleaner and treat all locales equally. Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011445.html Also fix pactests to use the correct case. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add -Rss optionNagy Gabor2008-03-10
| | | | | | | | * -Rss removes all dependencies (including explicitly installed ones). * updated documentation * two pactest files added to test the difference between -Rs and -Rss Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
* Merge branch 'maint'Dan McGee2008-03-09
|\ | | | | | | | | | | Conflicts: configure.ac
| * Use sigaction instead of signal.Chantry Xavier2008-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | From signal man page : "The behavior of signal() varies across Unix versions, and has also varied historically across different versions of Linux. Avoid its use: use sigaction(2) instead. See Portability below." The code was taken from there : http://www.gnu.org/software/libtool/manual/libc/Sigaction-Function-Example.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * src/pacman/pacman.c : split cleanup function.Chantry Xavier2008-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function was used in two different ways : - as a signal handler : the argument was the signal number - called manually for freeing the resources : the argument was the return value So the first part is now handler(int), and the second cleanup(int). Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011388.html Remaining problems : - the return values are messy. for example, 2 can mean both that it was interrupted (SIGINT == 2), or that --help or -V was used (returned by parseargs). - apparently signal is not portable and sigaction should be used instead Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
| * New alpm_version functionNagy Gabor2008-03-06
| | | | | | | | | | | | | | | | | | | | Now pacman frontend uses this function instead of the compile-time libalpm version number. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> [Dan: fix one more spot where LIB_VERSION was used] Signed-off-by: Dan McGee <dan@archlinux.org> (cherry picked from commit 49197b7492d61bf1fc6bef59a708f4f586f32edb)
* | Remove the Add option from the command lineDan McGee2008-03-08
| | | | | | | | | | | | There is still a lot of code that could be cleaned up internally. Signed-off-by: Dan McGee <dan@archlinux.org>
* | New alpm_version functionNagy Gabor2008-03-01
| | | | | | | | | | | | | | | | | | Now pacman frontend uses this function instead of the compile-time libalpm version number. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> [Dan: fix one more spot where LIB_VERSION was used] Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-02-15
|\| | | | | | | | | | | | | Conflicts: lib/libalpm/be_files.c lib/libalpm/package.c
| * setlibpaths(): remove a stray set_option lineDan McGee2008-02-11
| | | | | | | | | | | | | | | | | | For some reason, we set our dbpath to the logfile path, which was completely broken, and we didn't even check the return value coming back (which of course was -1 meaning the set failed). Add some comments so people can understand what is going on here now too. Signed-off-by: Dan McGee <dan@archlinux.org>
* | New remove option : -u / --unneeded (FS#6505).Nagy Gabor2008-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | New --asexplicit optionNagy Gabor2008-01-21
|/ | | | | | | | | | | 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>
* Disallow a NULL section in _parseconfigDan McGee2008-01-13
| | | | | | | | | | | | | 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>
* Make the user-agent string a bit less verboseDan McGee2008-01-11
| | | | | | | | | 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>
* Output a single newline on receipt of a SIGINTDan McGee2008-01-10
| | | | | | | | | | | 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>
* Rename -t --orphans to -t --unrequired (FS#9144).Chantry Xavier2008-01-10
| | | | | | | | | | 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>
* Remove upgradedelay and all code associated with itDan McGee2008-01-08
| | | | | | | | 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>
* Allow unreadable Include files to be non-fatalAaron Griffin2007-12-17
| | | | | | Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> [Dan: remove unused variable, make parseconfig static] Signed-off-by: Dan McGee <dan@archlinux.org>
* Update GNU GPL boilerplate and copyright datesDan McGee2007-12-10
| | | | | | | 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>