Commit Graph

380 Commits

Author SHA1 Message Date
Nagy Gabor f4ecc908ec We don't need root with -Sp
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>
2009-06-01 22:01:04 -05:00
Nagy Gabor 1b4135ca5d Change package to package(s) and file to file(s) in documentation
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>
2009-06-01 21:59:03 -05:00
Nagy Gabor f89f7e136b Query documentation updates
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>
2009-05-18 23:09:24 -05:00
Nagy Gabor 5fcc9ae7f4 Document --debug
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>
2009-04-05 21:11:48 -05:00
Nagy Gabor a888f377a5 HoldPkg rework
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>
2009-01-12 22:44:00 -06:00
Dan McGee 61c6552862 Merge branch 'maint'
Conflicts:
	lib/libalpm/dload.c
2008-12-02 22:15:02 -06:00
Nagy Gabor a50b067470 Give an error message on alpm_db_register_sync() error
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>
2008-11-30 16:38:37 -06:00
Nagy Gabor 314b4462d2 -Qu rework
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>
2008-10-31 19:46:13 -05:00
Dan McGee fa02a71abd Merge branch 'maint' 2008-10-12 21:36:45 -05:00
Dan McGee 30851a24ff Make interrupt handler async-safe
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>
2008-10-12 21:35:30 -05:00
Dan McGee 18452a6c51 Ensure we don't have double slashes when creating frontend paths
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>
2008-10-12 21:27:52 -05:00
Dan McGee 1c47500ea6 Merge branch 'maint' 2008-08-26 20:11:25 -05:00
Roman Kyrylych ece3d3606a Add missing comma to -S --help message
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-25 17:54:05 -05:00
Nagy Gabor baf5852555 Move -Sp implementation to the front-end
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>
2008-08-23 09:50:40 -05:00
Xavier Chantry 5b51dbb11e Cleanup of _alpm_pkg_compare_versions.
* 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>
2008-08-23 08:47:07 -05:00
Xavier Chantry 0969c2e700 pacman : clarify help message.
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 08:38:36 -05:00
Xavier Chantry fb5c5086e1 pacman.c: fix typo s/NoPassiveFTP/NoPassiveFtp
This fixes FS#11203.

The doc has always mentioned NoPassiveFtp, but an inconsistency was
introduced with commit 76f816b9f7 when case
sensitive comparision was introduced, and was only found after commit
b3e6cf652c which dropped the case insensitive
comparison.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-19 18:42:42 -05:00
Nagy Gabor 9a6fd1b021 Remove UseColor from front-end
This option wasn't used.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-29 21:46:42 -05:00
Dan McGee 0fc538fcdb Various updates needed prior to a new release
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-08 13:50:01 -05:00
Dan McGee fe781e4ce4 Reimplement TotalDownload functionality
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>
2008-06-04 15:38:53 -05:00
Dan McGee 636610432a Allow GIT version to be used in pacman builds
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>
2008-05-31 12:06:34 -05:00
Xavier Chantry fb09d35e6a Disable geteuid in cygwin.
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>
2008-05-14 09:17:02 -05:00
Chantry Xavier d5278ebb3b Add SyncFirst option.
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>
2008-05-13 15:49:02 -05:00
Allan McRae 3c3cb001a4 Make all error messages use pm_fprintf
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>
2008-05-11 20:05:28 -05:00
Dan McGee 57acfced0d Update configure.ac to current code
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>
2008-04-07 19:27:35 -05:00
Chantry Xavier 3d10d460df Add new CleanMethod option.
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>
2008-03-23 13:38:23 -05:00
Chantry Xavier 5af076f09f Kill the dependsonly option.
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>
2008-03-22 18:39:15 +01:00
Chantry Xavier b3e6cf652c Drop case insensitive comparisons in the config parsing.
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>
2008-03-17 20:58:28 -05:00
Nagy Gabor 35135c0a0c Add -Rss option
* -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>
2008-03-10 19:16:01 -05:00
Dan McGee 91b7f288fe Merge branch 'maint'
Conflicts:

	configure.ac
2008-03-09 12:03:54 -05:00
Chantry Xavier 51e0303e84 Use sigaction instead of signal.
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>
2008-03-09 11:35:01 -05:00
Chantry Xavier 2f9f48eddd src/pacman/pacman.c : split cleanup function.
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>
2008-03-09 11:30:59 -05:00
Dan McGee 3ec45486ff Remove the Add option from the command line
There is still a lot of code that could be cleaned up internally.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-08 14:13:34 -06:00
Nagy Gabor 54af52f87d New alpm_version function
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 49197b7492)
2008-03-06 19:05:14 -06:00
Nagy Gabor 49197b7492 New alpm_version function
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>
2008-03-01 17:02:05 -06:00
Dan McGee 6b07b5d345 Merge branch 'maint'
Conflicts:

	lib/libalpm/be_files.c
	lib/libalpm/package.c
2008-02-15 19:40:22 -06:00
Dan McGee 8068a14c52 setlibpaths(): remove a stray set_option line
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>
2008-02-11 20:40:44 -06:00
Nagy Gabor e63366ae5e New remove option : -u / --unneeded (FS#6505).
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-06 08:46:15 +01:00
Nagy Gabor 2a7101c049 New --asexplicit option
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-21 19:39:26 -06:00
Dan McGee 549c2878f9 Disallow a NULL section in _parseconfig
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-13 18:42:00 -06:00
Dan McGee 318d5c4ba8 Make the user-agent string a bit less verbose
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-11 19:29:44 -06:00
Dan McGee 0a65de10b1 Output a single newline on receipt of a SIGINT
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-10 23:07:52 -06:00
Chantry Xavier aec7c13648 Rename -t --orphans to -t --unrequired (FS#9144).
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-10 22:58:19 -06:00
Dan McGee 9dd016001e Remove upgradedelay and all code associated with it
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>
2008-01-08 15:49:52 -06:00
Aaron Griffin a4b8138797 Allow unreadable Include files to be non-fatal
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-17 20:56:35 -06:00
Dan McGee 9781d0d637 Update GNU GPL boilerplate and copyright dates
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-10 22:55:39 -06:00
Dan McGee 874f3379ff Update some errors in messages found during localization
Also perform the updates in the message files so we don't break
translations.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-04 09:56:28 -06:00
Dan McGee d6354ff248 Oops- forgot to ever set init to 1 in setlibpaths()
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-03 22:17:19 -06:00
Dan McGee 32e625db14 parseconfig: refactor duplicate code out into a function
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02 15:10:18 -06:00
Dan McGee 8a474e8735 Fixes for the ineptitude of libalpm DB registration
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-02 12:56:57 -06:00
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