Commit Graph

219 Commits

Author SHA1 Message Date
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