Commit Graph

380 Commits

Author SHA1 Message Date
Dan McGee 4845207fd4 Make pacman path handling (hopefully) a bit more intuitive
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-02 12:20:55 -06:00
Chantry Xavier 250331a636 Add new --needed option for -S.
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-02 11:14:13 -06:00
Chantry Xavier 11133da587 Move mbasename from pacman.c to util.c
This function can be useful in other places.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-25 16:13:30 -06:00
Artyom 1e9a1a0292 Add -q/--quiet option for controlling output.
Currently this only affects -Ss, -Sl, and -Q to output less information (only
package names).

In the future, we can reuse this flag for other things as well.

[Aaron: rewritten as a front-end flag]
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
[Dan: squashed commits together]
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-25 14:33:32 -06:00
Dan McGee f5d2150e9d Remove -F/--freshen operation
This operation made sense in the days before sync DBs existed, but it no
longer has the same usefulness it once did.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-21 11:51:17 -06:00
Nathan Jones 46ec9e3548 Make it easier to ignore multiple packages.
This makes --ignore and --ignoregroup able to accept multiple
packages/groups by separating each with a comma.

For instance: pacman -Su --ignore kernel26,udev,glibc

This was requested in the comments of FS#8054.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-13 20:59:02 -06:00
Nathan Jones 70a91cbb22 Add help for --ignoregroup.
Signed-off-by: Nathan Jones <nathanj@insightbb.com>
[Dan: split usage line into two lines for clarity]
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-13 20:58:45 -06:00
Dan McGee 6b98599953 pacman: remove leftover help string for -Rh
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-11 09:51:08 -06:00
Nathan Jones b206af78e0 Add TotalDownload option.
This will be used in the next commit.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-11 09:46:09 -06:00
Nathan Jones 5c58b3d500 Add IgnoreGroup and --ignoregroup option.
This will be used in the next commit.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-11 09:44:26 -06:00
Dan McGee 11f99e0685 Add LOGFILE as a define at compile time for pacman
It has always been a bit odd that logfile had to be specified in the config
file, but no other paths did. Add LOGFILE as a preprocessor definition, and
make a call to alpm_option_set_logfile() to set the default location so no
logfile parameter is necessary in pacman.conf.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-05 21:10:22 -06:00
Dan McGee 86ca39d15e Clean up usage of extern variables
Instead of declaring the extern variable in every *.c file, include it in
the header file that makes sense. This means handle.h for the handle, and
conf.h for the pacman side config object.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-04 12:05:22 -06:00
Dan McGee dea9b3bc0f Fix basename usage in pacman and utilities
basename() is a rather untrusty function call on a lot of platforms as it
does some weird and different things. To solve this, I added a mbasename
fuction to pacman to take its place, and simply removed its usage in the
utilities (it isn't worth dealing with there).

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-04 09:50:43 -06:00
Dan McGee a8731ff2f7 Fix mcheck detection and usage
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-26 20:31:25 -05:00
Dan McGee 8b1fb61df2 Ensure all localization stuff is correctly guarded
Anything dealing with libintl and localization should be correctly guarded
inside an ENABLE_NLS block on both the pacman and libalpm sides.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-22 23:52:55 -05:00
Nathan Jones e472e80c08 Download delta files if UseDelta is set.
Delta files will be used if the size is smaller than a percent
(MAX_DELTA_RATIO) of the package size.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-19 19:29:17 -05:00
Chantry Xavier 5d30c5c0b7 pacman/pacman.c : put back root check even if -r is specified.
Root is needed for most install / remove operation, because it's needed
for chrooting, for running scriptlets.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-10-14 17:56:40 -05:00
Chantry Xavier e03a1f0044 pacman/pacman.c : add --logfile option.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-10-08 20:46:56 -05:00
Dan McGee 1ff8e7f364 Remove the non-user friendly --ask option
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-08 20:46:55 -05:00
Chantry Xavier 52e7e6d747 needs_transaction adjustments
I just moved the root path check out of needs_transaction, and put it directly
in pacman.c . I think this part is alright.

For the other problems, I thought about doing the transaction first, in a new
sync trans function, which will init and release a transaction.  And then doing
the commands like -Ss / -Sl / -Sg / -Si.

The problem is that for commands like -Sys / -Syl / etc, only the refresh part
of the transaction should be done.  So I had to introduce an ugly sync_only
hack.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-10-03 21:02:36 -05:00
Aaron Griffin 4942d21632 Break out transaction test to a separate function
Added needs_transaction, putting out "hey do we need root?" tests in one place.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-09-28 00:25:57 -05:00
Aaron Griffin 50bb16e015 OMG a space!
Yeah, I added a space. It deserves its own commit.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-09-28 00:25:57 -05:00
Chantry Xavier a6b58638d1 document the -Qii option.
I suppose -Qii could be used for other things than displaying
the list of backup files, but currently, it's the only one,
so that's how I documented it..

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-27 22:00:57 -05:00
Chantry Xavier b0aa510592 trans.c : reworking of transaction interruptions
My two previous hacks related to this part
(8038190c7c and
b15a5194d1) were caused by the lack of
understanding of a feature introduced a while ago:
Better control over CTRL-C interruptions -- do not leave the DB in an
inconsistent state (54008798ef).

Now I have been looking at this commit, and the added feature is indeed
interesting. The main problem I had with it is that it does a rather
unusual use of alpm_trans_release, which caused a few problems that I tried
to fix in a weird way. I think these problems were caused by the fact that
there weren't any difference between "interrupt transaction" and "release a
transaction which failed" actions from the alpm_trans_release POV.  So I
decided to add a new function instead, alpm_trans_interrupt, which is
called on Ctrl+C, and which only sets trans->state to STATE_INTERRUPTED so
that remove_commit and add_commit can exit cleanly at a safe moment. This
allowed me to revert my two previous hacks as well.

Also ensure we handle SIGINT correctly in all cases- if a transaction is
not ongoing, then we can free the transaction and exit quickly.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-16 20:17:44 -05:00
Chantry Xavier 046c8a6819 Remove the DB consistency check from pacman and libalpm.
This reverts commit dfc85cb5f5
and b6f3fe6957.
This DB check is already in testdb (among others).

Also testdb now uses the db path set at make time by default,
so specifying the db path is optional.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-16 20:10:18 -05:00
Stefano Esposito 27acdc2c94 make alpm_strerror binding friendly
I'm currently working on python bindings for alpm written in pyrex. While
working i found that declaring alpm_strerror as
	char * alpm_strerror (void)
instead of
	char * alpm_strerror (int err)

and then using pm_errno in the implementation instead of err, could make it
more bindings-friendly.

Dan: cleaned up and added void to declaration. Instead of replacing existing
function, add a new function called 'alpm_strerrorlast(void)'.

Signed-off-by: Stefano Esposito <stefano.esposito87@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-11 20:58:27 -05:00
Travis Willard b6f89f03af separate local from sync dbs on filesystem
Introduce two new methods into the API - alpm_db_register_sync and
alpm_db_register_local, which replace the functionality of
alpm_db_register. db_register_local always returns the local DB, and
db_register_sync will always try to register a sync DB. This conceptually
separates the local DB from sync DBs in the code. Also updated the pacman
frontend to use the new functions. In addition, this changes the location
of all sync DBs in the filesystem from $DBPATH/$REPO to $DBPATH/sync/$REPO,
This removes the silly limitation that a sync DB couldn't be named 'local',
along with structurally separating sync DBs and the local DB in the
filesystem.

Signed-off-by: Travis Willard <travis@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-26 23:44:32 -04:00
Dan McGee 10c3f335d0 pacman.c: clarify reason for doing 2 strcmp operations
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-22 14:02:14 -04:00
Dan McGee 515754faac Various valgrind mem leak fixes
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-21 23:29:10 -04:00
Dan McGee d09d114e99 Add a default cachedir if one wasn't specified
Use the default cachedir (specified at compile time) if one wasn't specified
on the command line or in the config file.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-21 21:53:38 -04:00
Dan McGee c22e381a8b Post trial install changes, round one
A bunch of changes related to my first "real" install of pacman-git into
/usr/local and trying to use it.

* Shift some uses of free -> FREE in libalpm.
* Move stat and sanity checks of config paths into libalpm from the
  config and argument parsing in pacman.c.
* Fix issue where dbpath still was not defined early enough due to its
  requirement for being used in alpm_db_register. This should be rewritten
  so it doesn't have this dependency, but this will work for now.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-21 21:28:05 -04:00
Dan McGee fc65a9bcb1 Fix some errors spit out by -Wextra
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-16 16:19:06 -04:00
Dan McGee 47cada81a0 pacman.c: Alphabetize listing of query options
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-16 11:04:58 -04:00
Chantry Xavier 0f539832f4 new query options : explicit (-Qe) and deps (-Qd).
The t shortcut for --test was removed,
the orphan option (previously -Qe) was renamed to -Qt,
-Qe lists all packages installed explictly,
and -Qd lists all packages installed as dependencies.

Besides, t can be combined with either e or d.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-08-15 20:21:43 -04:00
Dan McGee 178c1d228d Cleanup of pacman.c and addition of default paths to frontend
Instead of barfing when the root path and db path haven't been defined,
have pacman set them to some sane defaults when they aren't specified on
either the command line or the config file.

Also do some cleaning of error output and Doxygen comments.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-23 16:58:04 -04:00
Dan McGee a1e57cbec8 Add --asdeps option to pacman
This replaces the former -D operation that was undocumented and rather
hacky. It can be used with add, upgrade, or sync transactions and will affect
all packages installed. Should close FS #7193.

Also tell makepkg to use this new flag.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-15 12:46:02 -04:00
Dan McGee ea1fef69ad Remove gettext calls from all PM_LOG_DEBUG messages
There is no real reason to burden our translators with these messages, as
anyone helping to debug these will probably want them in English.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-10 14:24:58 -04:00
Dan McGee 7daa6708d2 Remove lockfile configuration from frontend, make it job of libalpm
I previously introduced some patches to make just about every path in
pacman/libalpm configurable; doing this with the lockfile seemed a bit too
far and we really should just place the lockfile where it belongs- with the
DB that needs locking.

More details in this thread:
http://archlinux.org/pipermail/pacman-dev/2007-June/008499.html

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-27 23:34:38 -04:00
Dan McGee 7bdb904af5 pacman.c: make parseconfig a bit more robust
Don't let parseconfig overwrite settings that parseargs already made.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-27 22:58:21 -04:00
Dan McGee da6b175d01 pacman.c: Refine error messages used by parseconfig
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09 13:38:14 -04:00
Dan McGee 35a794c2ed Allow multiple CacheDirs to be specified
This should hopefully allow multiple cache dirs to be specified in
pacman.conf and/or on the command line, and allow pacman to test
each one for the package file. The first one found to be writeable is
used as the download cache.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09 13:03:25 -04:00
Dan McGee b6f3fe6957 Implement a -Qt operation in frontend to test the database
After adding a alpm_db_check() operation in the back end, we can call it
in the front end and present a user-friendly interface to it.

Inspired-by: VMiklos <vmiklos@frugalware.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09 12:58:12 -04:00
Dan McGee 25c5b39d05 Fix up things after the last few changes
* Readd default logmask of ERROR and WARNING
* Remove DOWNLOAD log level as it no longer applies
* Add 'no targets' logic back in where it applies
* Switch some prints in parseconfig to ERROR

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09 12:57:50 -04:00
Dan McGee fc93601b98 Revamp pacman.c main function ordering, switch some output to pm_printf
Reorder some of the initilization stuff in pacman.c, as well as remove
some code that should be reimplemented elsewhere- checking the target
list to see if it is NULL.

Change the temp printf statements in parseconfig to pm_printf as well.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09 12:57:50 -04:00
Dan McGee 466b79bf8f Fix up outstanding parseconfig issues
The db variable was left unset when calling alpm_db_register, leading
to a failure to ever register a sync db. Also added a check to ensure
DBPath was set when trying to register a database.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 23:10:49 -04:00
Dan McGee 358cc5804a Rip alpm_parse_config out of libalpm
Switch over to the new frontend parseconfig.

* Fix a few issues in parseconfig
* Remove unused callback upon database registration
* Remove conf file related errors from error.c/alpm.h

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 23:10:49 -04:00
Dan McGee 6949ab9761 Move three config options out of the backend
Move chomp, usecolor, and showsize out of the backend and into the
pacman frontend as they are pacman-specific options and not related
to the behavior of libalpm.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 23:10:49 -04:00
Dan McGee 65662315b6 Add a parseconfig to the pacman frontend that compiles
Warning: this compiles but may not work as intended quite yet. :)

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 23:10:49 -04:00
Dan McGee d9ff7bbcd2 Remove hardcoded defines from libalpm
Remove any use of the former path variables defined by the Makefiles or
config.h. These are now runtime configurable only with pacman.conf (or by
using flags on the command line).

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 17:00:30 -04:00
Nathan Jones 80237630af Change -z|--showsize flag to ShowSize pacman.conf option
Also cleaned up some duplicate printf lines related to the ShowSize option.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-01 11:00:39 -04:00
Dan McGee 7bd2ff6851 Move DB and cache dirs away from there dependence on ROOTDIR
This change allows us to use all autoconf specified paths, most notably
$(localstatedir). It is quite a change and touches a lot of files, as
all references to the DB and cache were done with the ROOTDIR as a prefix.

* add --lock command-line option to pacman to specify the location of the
  lockfile (this can now be specified at configure time by setting the
  $localstatedir path).
* Rip quite a few settings out of configure.ac as they are now picked by
  setting the paths during configure or make.
* Fix bug with /tmp fallback for sync downloads not working correctly
  (related to root location, now the system tmp dir is used).
* Simplified the parameters to some libalpm functions, and added get/set
  for the new lockfile option.
* Renamed several of the DEFS to names without the PM_ prefix.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-05-31 02:51:28 -04:00
Chantry Xavier 51225b3263 Add -Qee option for the original behavior of -Qe
-Qee now lists "orphans" the way pacman used to - that
is, -Qe lists packages required by nothing that were
installed as a dependency, but -Qee lists all packages
not required by something else.

Also, I snuck in a compile fix for my real_path cleanup earlier, heh

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-05-20 01:20:07 -05:00
Nathan Jones 5c930c318e Display size for packages
This patch adds a -z|--showsize option to the -Q and -S commands. The
option displays the size of individual packages. This is something that
I have wanted for a while, and there is a feature request for it.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-05-14 01:22:15 -04:00
Dan McGee a71b943a09 Set HTTP_USER_AGENT envvar in pacman
Instead of using libdownload's default user agent string, make one of
our own.

Format:
Pacman/3.0.1 (Linux i686 2.6.21-rc7-ARCH; en_US.utf8) libalpm/1.0.0

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-28 05:25:05 -04:00
Dan McGee a8b683d8e2 Add a cb_log call on segfaults
This should make it easier to see exactly where a segfault occurs; old
method was prone to output flushing issues.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-28 03:09:37 -04:00
Dan McGee 63588aff19 Remove output.c and output.h
One function was left in this set of files after the earlier cleansing, so
I moved yesno to util.c.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26 19:20:46 -04:00
Dan McGee 8d46cf6651 Remove ERR calls from the code
All ERR() calls have been replaced with fprintf(stderr, ...).

Still to be done- fix all the newline issues that are sure to pop up. What fun!

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26 16:23:59 -04:00
Dan McGee 961be77c93 Remove MSG output macro (#define and in code)
This is the first step of converting output to standard functions such as printf, and
eventually allowing compiliation with the -pedantic flag as is done on the libalpm
side.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26 15:28:54 -04:00
Dan McGee f0304168ee Move log.c/h -> output.c/h to properly reflect what is contained
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26 14:34:47 -04:00
Dan McGee dc05cd107c Pacman side code consolidation- unify callback functions to one file
Some more major code reorginization here. The download progress callback
function has been renamed and moved to callback.c, which is the former
trans.c with the download and log callbacks added. In addition, this allows
util.c to be cleaned up as fill_progress can now be static in callback.c.
We've also cut two more source files out.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26 14:34:41 -04:00
Dan McGee 97313ba316 More pacman side cleanup
* Cleaned up more of the header #includes, and got rid of a lot of stuff
  that was due to trying to make it compile on BSD/Darwin/CYGWIN. We can
  add it later but lets keep it simple for now and do it in seperate files
  if possible later.
* Removed a lot of #define MACROS. Some were not even used, and others were
  only used a few times.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26 14:34:41 -04:00
Dan McGee da3286a80d Allow sync search to work without arguments
Enable an -Ss operation to work without a target list. This allows all package information
to be printed (as opposed to individual -Sl operations on repositories).

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26 14:27:13 -04:00
Dan McGee 7760f5fe60 Remove more unnecessary stuff
* Remove libintl.h from most files, as we only need to include it once in
  util.h where _() is defined.
* Remove other unnecessary header inclusions.
* Remove a macro that was only used once and replaced it with actual code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-25 11:07:48 -04:00
Dan McGee 5e1419c0b5 Merge single-function header files on pacman side
Having a seperate header file for add, remove, query, etc. seemed overkill.
Merge them all into a common pacman.h and fix the necessary #includes.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-25 11:07:47 -04:00
Dan McGee 14606c301c Add void to functions with empty parameter list
Adding void [eg foo(void) instead of foo()] makes the code more compliant with
ANSI C.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-14 17:26:39 -04:00
Dan McGee d32ef4329c Remove some debug print statements that were left in on accident
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-01 21:52:28 -04:00
Dan McGee 8fd16d0dcb Clean up pacman.c, add localize function
* Add a localize function to do what was done before in main wrt i18n
  initialization.
* Added Doxygen comments to all functions in pacman.c.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-03-31 20:30:35 -04:00
Dan McGee c3ad8bd75f Make all paths and file locations configurable
Several important paths, file locations, and extensions were #define-d in the
source code instead of being configurable. This moves all of these to
the configure script where they can be picked upon running ./configure. We
may later want to make some of these even more visible and move them to
pacman.conf.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-03-30 15:55:58 -04:00
Dan McGee 3ef1aeb8bd Continue fixing usage instructions.
* Unify the main usage instructions to look a bit more like the rest
  with a usage and options line.
* Fix some of the spacing from the de-gettexting done yesterday.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-03-28 16:26:37 -04:00
Dan McGee 5ec3ed4674 Improve pacman.c gettext usage
* Break out a few strings in pacman.c that are used repeatedly to
  reduce unnecessary translations.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-03-27 20:26:54 -04:00
Dan McGee 19faa24cf3 Clarify some English messages as suggested by Nagy Gabor. I even did the hard
work of fixing these in the translation files, and I removed a few fuzzys
while doing so. If any more patches for translations come, try to do it
against these files.
2007-03-22 18:19:49 +00:00
Aaron Griffin 06d7e3d7c3 Giovanni Scafora <linuxmania@gmail.com>
* Fix typo in pacman.c
2007-03-22 00:20:05 +00:00
Dan McGee 40855b48fe * pacman.c: Add CacheDir to -v --verbose output. 2007-03-21 03:29:11 +00:00
Dan McGee cf6f184243 * Updated Italian translation
Giovanni Scafora <linuxmania@gmail.com>
* Many minor issues mentioned by Scott Horowitz <stonecrest@gmail.com>.
  - extra 'done' text in --noprogressbar output
  - missing flags in the pacman.8 manpage
  - unclear text in --noconfirm help description
2007-03-19 02:45:00 +00:00
Dan McGee a755dacea2 James Rosten <seinfeld90@gmail.com>
* Add missing help line for --sync --list.
2007-03-18 23:21:57 +00:00
Aaron Griffin abcb5494bc * Updated -V output to include the 2007 copyright date. 2007-03-07 20:29:28 +00:00
Dan McGee 869e81e1cf This commit looks much more monumental than it is. Almost all just #include
reordering and adding ones that were forgotten (noticed when trying to
compile after reordering).

* Updated the HACKING file to include information on #include usage.
* print -> vprint in "making dir" function in pactest.
2007-03-05 22:13:33 +00:00
Aaron Griffin 28b2dbb52c * Fixed the handle realroot stuff
* Added some {}
2007-03-04 09:16:28 +00:00
Aaron Griffin 4dd6c92228 * pacman hidden arguments: removed -Y and -D. -T is the only hidden arg now, to
be used in place of -Y.  Also, -D was rather silly, as it does mostly what -S
  does.
* Cleaned up pacman_deptest - removed the goofy faketarget stuff (NEEDS testing
  still)
* libalpm function renames
2007-02-26 08:43:02 +00:00
Aaron Griffin 8e1cdc5f8d We don't need this anymore 2007-02-23 03:40:20 +00:00
Dan McGee 332c127109 Big commit here, I'll try to cover all the bases.
* Updated all of the language files, as the POT file was updated. NOTE FOR
  TRANSLATORS, try to base your next contribution off of these, notice how
  some msgids and messages have been wrapped to the next line- it makes it
  easier to read anyway.
* More Makefile.am/configure.ac updates. 'make dist' and 'make distclean' now
  work properly, with only one caveat- the automatic testing in distclean
  doesn't do so hot as it is compiled with a default configure, which includes
  the fakeroot-proof code (which does not cooperate with pactest).
* Added a Makefile.am for the pactest directory.
2007-02-22 21:34:51 +00:00
Aaron Griffin a8dd8d5770 * Looks like I left some debugging code in there 2007-02-21 01:50:46 +00:00
Dan McGee bd6adec40b * Updated bash_completion script to 3.0 options.
* Changed that removal message again, hopefully it sounds good now.
* Shortened a usage option description so it would not wrap at 81 chars.
2007-02-19 04:13:13 +00:00
Dan McGee 01726a74e4 * Updated pt_BR translation (Douglas Soares de Andrade), and merged other
language files with latest pot file.
2007-02-15 14:32:01 +00:00
Dan McGee 3da9fb537a Fixed locale setting issues in the frontend, and fixed description of --cachedir. 2007-02-13 01:50:18 +00:00
Aaron Griffin 89099871a4 Reverted the exit 2 -> exit 0 change. This was there for a reason (so that
pacman didn't check targets and spit out an error message).
2007-02-13 01:37:48 +00:00
Aaron Griffin b623b98882 Exit status of 2 seems wrong for -V 2007-02-12 07:23:36 +00:00
Aaron Griffin 62cd381894 * Added --cachedir commandline option
* Removed usage of 'realpath'.  From the manpage:
  "Avoid  using this function. It is broken by design"
2007-02-12 07:03:08 +00:00
Aaron Griffin be85600dfd * Removed the 'vercmp' op from pacman. The standalone 'vercmp' binary should be
used instead
* Allow -T/--deptest to work without root privileges
2007-02-12 06:44:00 +00:00
Dan McGee 79d18c2617 * Remove "error: " text from ERR() call since it is appended by ERR anyway. 2007-02-09 17:58:19 +00:00
Aaron Griffin d8fd645c4c * Cleaned up direct pm_fprintf usage (move to MSG/ERR macros for now)
* Moved some stderr output to stdout
* Remove "RETRIEVE_LOCAL" trans event as libdownload handles local files
2007-02-09 16:02:01 +00:00
Dan McGee a7df172bee * Nice overhaul of manpages. It is at least a start.
* Alphabetized options in pacman usage.
2007-02-08 05:24:17 +00:00
Aaron Griffin 1bb3cd34bf Added the --upgrades option for -Qu (--query --upgrades) 2007-02-04 08:30:13 +00:00
Aaron Griffin 63000584b6 Implemented a crappy version of -Qu (query upgrades). This simply outputs the
packages to be upgraded in a -Su operation.  Much of the code is duplicated from
sync.c.
TODO: move the implementation to upgrades.c, and reimplement the sync_sysupgrade
function in terms of this:
    trans->packages = alpm_get_upgrades();
2007-02-04 08:26:52 +00:00
Aaron Griffin e3c7e92f10 * unified the progress bars (fill_progress function)
* fixed progress output (needs an fflush to move cursor properly)
* broke display_targets function out, to display a list of syncpkgs in
  preparation for a -Qu option
* added get_update_time function to deal with progress functions that shouldn't
  update too fast due to output redraw speeds
2007-02-04 01:36:45 +00:00
Aaron Griffin 670319c2fb Debug logging changes:
* The --debug params were goofy.  New setup allows --debug without params,
  --debug=<level> where level 1=debug output, 2=debug and download output,
  3=debug, download, and function tracing output.  This seems more sane to me.
* Removed PM_LOG_FLOW1 and PM_LOG_FLOW2.  They were just confusing.  When adding
  new functions, it is near impossible to determin if your output should be
  "flow1" or "flow2" without tracking all the way up the call chain.  Rarely
  would one ever say "ok, lets just show "flow2" output.  These have both been
  replaced with PM_LOG_DEBUG
* Removed the need for the root parameter on alpm_initialize. it is now
  defaulted to PM_ROOT just like dbpath and cachedir.  This allows alpm to be
  initialized BEFORE option parsing in the front end, saving us some duplicate
  variables in the frontend.
* Cleaned up front end variables due to early alpm_initialize call.
2007-01-31 06:10:21 +00:00
Aaron Griffin e22336673a Dan McGee <dpmcgee@gmail.com>
* Lots of code cleanup, and type fixes
* Make 'makeworld' a bit more in-line with the other stuff
* Make -Si and -Qi operations appear the same
2007-01-26 02:13:16 +00:00
Aaron Griffin 7f465320e4 Cleanup 'neednl' usage - make it static 2007-01-24 16:57:19 +00:00
Aaron Griffin 6167017264 Preliminary checkin for alpm_list conversion
* renamed pmlist_t -> alpm_list_t
* made alpm_list_t a public type (alpm_list.h header)
* removed additional storage for registered DBs in pacman source
* some code cleanup
* removed duplicate (pm)list_display functions from pacman source
* misc code cleanup
2007-01-19 09:28:44 +00:00
Aaron Griffin bb69613e42 * remove static neednl - no accessor functions (yet)
* remove getcols call in main()
2007-01-18 20:13:34 +00:00
Aaron Griffin 86b136bb59 Dan McGee <dpmcgee@gmail.com>
* Removed some unnecessary headers and library links
* Made things static if possible
* Cleaned up makefiles a bit
* Fixed some old comments in the code
* Fixed some errors the static code checker splint pointed out
* Backwards arguments in a memset call in _alpm_db_read (could have been worse)
* Other various small fixes

Other:
* Default to 80 columns when getcols cannot determine display width
* Removal of ._install as a valid install file in packages
2007-01-18 16:52:57 +00:00
Aaron Griffin c6f56aee57 Dan McGee <dpmcgee@gmail.com>
* fix for -Qii regression
* package.c cleanup
* some refactoring changes

Moved split_pkgname as per Dan's suggestion
2007-01-17 05:25:32 +00:00
Aaron Griffin b308f06a3a * Dan McGee's makepkg updates http://www.archlinux.org/pipermail/pacman-dev/2006-December/000792.html
* configure fixes (CFLAGS)
* no-strict-aliasing hacks until full C99 compliance
* --with-config-file configure option
2006-12-14 05:23:08 +00:00
Aaron Griffin 716e9ef095 A few minor updates so --root works again. 2006-12-08 08:17:41 +00:00
Aaron Griffin fc361cc111 Removed an extra call to alpm_option_set_root() - it is set by alpm_init() 2006-12-08 07:21:38 +00:00
Aaron Griffin 8028a1124a Added dbpath validation 2006-12-05 06:55:52 +00:00
Aaron Griffin 08dca1593f * Cosmetic changes and typo fixes
* IgnorePkg and --ignore work again
* Partial changes to support removal of conflicts for -U and -A (INCOMPLETE)
2006-12-01 09:32:29 +00:00
Aaron Griffin cb65f08d2f libalpm appends the trailing / to the config root, no need to do it here 2006-11-20 22:15:26 +00:00
Aaron Griffin aa1c0ba9f8 * repo-add script - to add entries to a db file directly from package data (no PKGBUILD)
* libalpm api changes - move from a _getinfo(p, WHAT_WE_WANT) scheme to a
  typesafe _get_what_we_want(p) scheme [not 100% complete yet]
* some const correctness changes
* removal of PM_* types in alpm.h in favor of the pm*_t types used throughout
  libalpm
2006-11-20 09:10:23 +00:00
Aaron Griffin 4470e5ce01 * Numerous mini valgrind fixes.
* Addition of hacky architecture check in the _splitname function
* Removal of libfetch from the archlinux proper - it has been renamed to
  libdownload and can be found at http://phraktured.net/libdownload
* Merge of _some_ of the Frugalware makepkg change - this may still be
  incomplete
* Removal of libftp from cvs proper
* PKGBUILD manpage now says 'PKGBUILD' instead of FrugalBuild (he he)
2006-11-14 07:58:42 +00:00
Aaron Griffin 734e077996 Skip root check on -Sp 2006-11-10 20:09:59 +00:00
Aaron Griffin d069999cbf Last mtrace/setenv change, I swear 2006-11-09 19:45:53 +00:00
Aaron Griffin 33c354031c Whoops - I fail at setenv 2006-11-09 19:44:52 +00:00
Aaron Griffin 2d3a707a05 mcheck() seems to cause segfaults. Annoying. Switched back to useing mtrace() - if anything valgrind is superior to mcheck anyway 2006-11-09 19:27:10 +00:00
Aaron Griffin 3e608e7e85 * Improved mcheck output
* Added minor libalpm const correctness
* Mini-memory fixes
2006-11-08 08:14:29 +00:00
Aaron Griffin 34931106d7 Added mcheck support for memory debugging 2006-11-07 16:32:48 +00:00
Aaron Griffin 9b4aabdb0f * Modified some error output and logging
* Changed the initial log mask (added PM_LOG_ERROR)
* Fixed -Syu so it now works if any databases were downloaded (it was working
  like a -Su)
2006-11-03 03:56:02 +00:00
Aaron Griffin fbf1aa6539 * Fixed some alpm_get_option calls (long params were used for C99 compliance,
but were used in error)
* Cleaned up some output newlines
* Added "local database is up to date" when no packages are upgraded
2006-11-02 02:29:10 +00:00
Aaron Griffin 5a8bbc99be Numerous changes:
*   Added 'ILoveCandy' support to all progress bars
*   Changed download callback with regards to libfetch libalpm changes
*   libfetch error output on failed sync
*   Misc others I may have forgot to name (check the diff, heh)
2006-10-31 06:41:42 +00:00
Aaron Griffin 7131b7ac87 A handful of minor changes:
* Removed the PMList typedef, in favor of the same naming scheme other
      structs use 'pmlist_t'
    * Added a time stamp on debug output, to make it more informational
    * Moved alpm_db_register to _alpm_db_register, making the public function
      not take a callback parameter
2006-10-20 06:26:55 +00:00
Aaron Griffin db769f667d Added alpm function docs along
pacman.c : Removed link to frugalware wiki
sync.c : do not display Uncompressed size if 0 (archlinux has no USIZE)
2006-10-15 21:06:08 +00:00
Aaron Griffin 3f27542156 Merged frugalware changes. Added a few other minor things too, but there's alot
to list.  The diff should show you 8)
2006-10-15 19:34:52 +00:00
Judd Vinet 54008798ef Patch from FW: Better control over CTRL-C interruptions -- do not leave the DB in an inconsistent state 2006-07-14 23:15:07 +00:00
Judd Vinet 7236dd3287 i18n stuff 2006-06-28 05:37:15 +00:00
Judd Vinet bb787e26ee first stage of i18n stuff from VMiklos 2006-05-15 02:19:57 +00:00
Aurelien Foret 25ca241a7c fixed dbpath initialization (found out by VMiklos <vmiklos@frugalware.org>) 2006-03-21 19:50:05 +00:00
Aurelien Foret 039e6d9ee4 - removed pacman.h
- removed unuseful extern declarations
- set pacman.c internal functions as static
2006-03-13 20:34:47 +00:00
Aurelien Foret 27be34c09b added a NOSCRIPLET flag to transactions (patch from VMiklos <vmiklos@frugalware.org>) 2006-03-07 18:17:03 +00:00
Aurelien Foret 1bd8f57a18 - changed flags type from char to int
- downloadonly implies FLAG_NOCONFLICTS
2006-03-04 15:33:44 +00:00
Aurelien Foret ce4c043805 disable progress bar if the output is redirected (patch from VMiklos <vmiklos@frugalware.org>) 2006-03-01 07:27:06 +00:00
Aurelien Foret 910fd6a687 the library must provide default values for main options 2006-02-20 20:59:35 +00:00
Aurelien Foret 041e51f68d sync with pacman 2.9.8 2006-02-16 22:57:25 +00:00
Aurelien Foret ce194bdd5e used MALLOC macro when possible 2006-02-14 18:48:13 +00:00
Aurelien Foret 2b8d00a5e8 fixed a possible memory leak 2006-02-04 10:39:12 +00:00
Aurelien Foret cdc97dd6f2 added line feeds when needed (patch from VMiklos <vmiklos@frugalware.org>) 2006-02-01 18:20:13 +00:00
Judd Vinet be38a51750 added a --noprogressbar switch for scripts to use 2006-01-28 05:07:50 +00:00
Aurelien Foret 2d08e902ef added a FAKEROOT define allowing to use pacman in a fakeroot enivronment (for tests purpose) 2006-01-21 16:50:01 +00:00
Aurelien Foret 4e8220fae7 added the possibility to "-Syy" (can be used to force synctrees update, even if mtimes are ok) 2006-01-17 21:30:02 +00:00
Aurelien Foret 08bf45aceb maked verbose group listing enabled by -Sgg instead of -Sgv 2006-01-13 21:27:25 +00:00
Aurelien Foret 325d297739 made use of the new ALLDEPS transaction flag to handle "makepkg -s" 2006-01-10 18:45:32 +00:00
Aurelien Foret 86e5c8bc06 sync_commit can now return conflicting files with a trans_prepare like data structure (patch from VMiklos <vmiklos@frugalware.org>) 2006-01-07 18:42:44 +00:00
Aurelien Foret 52346fc121 - removed uid checks (CYGWIN)
- fixed indentation in parseargs
2006-01-07 10:01:19 +00:00
Aurelien Foret f3a4197e34 code cleanup (mainly removed line spaces at the beginning of lines by tabulations) 2006-01-07 09:42:48 +00:00
Aurelien Foret 11b6a69266 moved pacman_deptest function in its own file 2006-01-06 22:19:14 +00:00
Judd Vinet 96de3501ab patch from VMiklos - use PACKAGE_VERSION instead of PACMAN_VERSION 2006-01-02 19:55:35 +00:00
Aurelien Foret 7ff3ad054b - reworked verbose levels
- fixed the handling of command line errors when no operation is specified
2006-01-01 15:12:20 +00:00
Aurelien Foret 5a0565cf24 *** empty log message *** 2006-01-01 10:06:28 +00:00
Aurelien Foret 2c0530e634 added a missing code chunk of the ignore command line option (patch from VMiklos <vmiklos@frugalware.org>) 2005-12-31 17:58:22 +00:00
Aurelien Foret 289b75d576 used defines from alpm.h instead of local ones (patch from VMiklos <vmiklos@frugalware.org>) 2005-12-31 17:03:48 +00:00
Judd Vinet 9a7190dfff verbosity fix from VMiklos 2005-12-20 23:37:22 +00:00
Judd Vinet 15689bddbf added Frugalware patch: -Q --foreign to display packages not found in sync repos 2005-12-14 02:23:14 +00:00
Aurelien Foret 48c6090098 added PACCONF, PACDB and PACROOT defines 2005-10-29 07:09:48 +00:00
Aurelien Foret 44fc71396f renamed pmconfig_t to config_t 2005-10-29 07:00:56 +00:00
Aurelien Foret 98df67cd18 added pmconfig_t structure to hold all the configuration
(patch from VMiklos <vmiklos@frugalware.org>)
2005-10-28 12:20:40 +00:00
Judd Vinet feb152d78c added a default cachedir 2005-10-20 20:44:14 +00:00
Judd Vinet a1526a3e7d added first part of the autoconf stuff - patch from Christian Hamar <krics@linuxforum.hu> 2005-10-17 18:52:43 +00:00
Judd Vinet a36ded25eb added conversation callback support for transactions 2005-10-09 06:09:57 +00:00
Judd Vinet 5ef51b3e26 Merging in recent fixes/additions from 2.9.7 2005-10-07 23:29:49 +00:00
Aurelien Foret 4ee51bdf46 Added a CYGWIN define to include header files required to build in a Cygwin environment 2005-10-06 07:28:30 +00:00
Aurelien Foret d5bfc60734 fixed a small memory leak during the cleanup of config data 2005-05-03 17:29:00 +00:00
Aurelien Foret a53bf50189 get ride of ORE tags 2005-05-02 08:05:47 +00:00
Aurelien Foret 9e7dfed18b added a --debug option to externally set the library log level 2005-05-02 07:37:55 +00:00
Aurelien Foret cda9c6671c reworked pacman_deptest() 2005-05-01 20:47:22 +00:00
Aurelien Foret 6511f1949e some remork for pacman_deptest() 2005-04-23 17:16:02 +00:00
Aurelien Foret 3fa2b0e3bd backported support for print-uris from pacman 2.9.x 2005-04-13 19:16:32 +00:00
Aurelien Foret 54593f515a added option -p in pacman usage screen 2005-04-13 19:11:29 +00:00
Aurelien Foret 48f8f521b1 reworked MSG and ERR outputs 2005-04-06 20:59:13 +00:00
Aurelien Foret c3f53cdf12 changed alpm_db_register() prototype 2005-03-29 21:09:54 +00:00
Aurelien Foret d16c8be8a0 turned pmdepmissing_t into an opaque structure 2005-03-29 20:32:10 +00:00
Aurelien Foret 350a3972d1 fixed an error message 2005-03-27 07:43:13 +00:00
Aurelien Foret 0226ed1723 Backport from pacman 2.9.5 (--ignore in usage) 2005-03-26 13:30:59 +00:00
Aurelien Foret 0550ba151f Backport from pacman 2.9.5 (code cleanup) 2005-03-25 22:37:13 +00:00
Aurelien Foret 950839b557 - added pmo_chomp support (from pacman 2.9.3)
- fixed a typo with pmo_proxyport usage
2005-03-20 14:17:34 +00:00
Aurelien Foret 2da0b2263e pacman_deptest() rework 2005-03-19 18:14:18 +00:00
Aurelien Foret 05ad2e0771 Copyright update 2005-03-19 09:01:27 +00:00
Aurelien Foret 0709c15543 Relocated log and transaction stuffs from pacman.c to log.c and trans.c 2005-03-19 09:00:40 +00:00
Aurelien Foret fe5636cc47 Dropped pmo_nosave parameter (now included in pmo_flags) 2005-03-16 21:53:45 +00:00
Aurelien Foret 2ce1105900 - added PM_EXT_PKG and PM_EXT_DB defines to alpm.h (taken from pacman 2.9.3)
- renamed ALPM_VERSION to PM_VERSION
2005-03-16 20:59:14 +00:00
Aurelien Foret 438f653ba6 Renamed PM_TRANS_CB_XXX to PM_TRANS_EVT_XXX 2005-03-15 18:41:02 +00:00
Judd Vinet d04baabafa Initial revision 2005-03-15 01:51:43 +00:00