Commit Graph

2315 Commits

Author SHA1 Message Date
Nagy Gabor 471ed04790 alpm_list_remove treat NULL needle as "nothing"
So if you want to remove NULL needle from a list, alpm_list_remove will
return with "not found".

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-17 20:20:13 -05:00
Nagy Gabor 5929508198 Fix a possible segfault in alpm/remove.c
Before removing a package from target list (in remove_prepare_keep_needed),
we should check whether we have already removed it.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-17 20:20:06 -05:00
Nagy Gabor 03021713e5 _alpm_db_add_pkgincache rework
Commit 8240da6cb3 broke some alpm hierarchy
and introduced a new memleak (trans->packages was never freed in case of add
transaction, even if the transaction wasn't committed), so it is reverted
now.

We follow a different approach to reduce memory usage:
_alpm_db_add_pkgincache doesn't duplicate the whole package before adding
it to the cache, only the package name and version (INFRQ_BASE).
This method needs very small extra memory (compared to the reverted method),
and after transaction commit we use less memory than before (since the
big 'files' fields are not copied to cache), this is useful in GUIs.

Note: The old add_pkgincache was a bit broken, since pkg->origin wasn't
filled in correctly.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Acked-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-15 19:16:42 -05:00
Nagy Gabor ffa3056010 Use "pacman -S $dep" in makepkg's dependency resolving
This method is equivalent with pacman's resolvedeps.
$dep can be any (versioned) dependency.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-15 19:14:23 -05:00
Nagy Gabor 37b5972212 Fix some memleaks in alpm/add.c
In case of error some allocated memory wasn't freed in commit_single_pkg.
Note: The return value of this function is not used.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-15 19:13:30 -05:00
Nagy Gabor 17e9c9d9ff Fix a wrong FREELIST usage in add.c
The dynamic pmconflict_t must be freed with _alpm_conflict_free.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-15 19:12:22 -05:00
Dan McGee 0bf66b097f makepkg: speed up svn revision check for large repositories
Using the suggestion from FS#10905, use 'svn info' rather than 'svn log' to
get the current revision number, which is much quicker for large Subversion
repositories. Eventually git will rule the world. :)

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-15 19:09:15 -05:00
Dan McGee 95995ae93f Remove pacman.static build from build files
This presents plenty of problems on OSes besides Linux, and even on Linux
when the libtool file for libarchive isn't present. The static build isn't
all that useful anyway as missing something such as glibc will still leave
you unable to run the pacman.static binary. Remove it from the formal build
process.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-15 19:05:24 -05:00
Xavier Chantry 8741908276 src/pacman/sync.c : Display only errors with -Sp and -Sw operations.
In particular, this avoids warnings cluttering the output of these
operations.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-13 09:19:24 -05:00
Nagy Gabor fd8969f678 sync_addtarget rework
Now '-S provision' handling is done in the back-end.

In case of multiple providers, the first one is selected (behavior change:
deleted provision002.py). The old processing order was: literal, group,
provision; the new one: literal, provision, group. This is more rational,
but "pacman -S group" will be slower now. "pacman -S repo/provision" also
works. Provision was generalized to dependencies, so you can resolve deps by
hand: "pacman -S 'bash>2.0'" or "pacman -S 'core/bash>2.0'" etc. This can be
useful in makepkg dependency resolving. The changes were documented in
pacman manual.

alpm_find_pkg_satisfiers and _alpm_find_dep_satisfiers functions were
removed, since they are no longer needed.

I added some verbosity to "select provider instead of literal" and
"fallback to group".

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-13 09:16:55 -05:00
Nagy Gabor f724fb2702 remove_addtarget rework (in front-end)
Now "pacman -R foo" first searches for literal, and then for group.
This is faster in most cases, see:
http://www.archlinux.org/pipermail/pacman-dev/2008-July/012311.html

"-R group" implementation was broken, since alpm_grp_get_pkgs returns with
an pmpkg_t list, not a string list.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-13 09:15:07 -05:00
Nagy Gabor 1d9d47d62c New remove060.py pactest
This is a group removal test.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-13 09:14:36 -05:00
Dan McGee b196cc43a5 Merge branch 'maint' 2008-07-07 21:39:42 -05:00
Nagy Gabor d92b0e674d Fix a bogus message in Hungarian translation
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:30:42 -05:00
Nagy Gabor 30702350fa Remove requiredby from pactests
Also remove some meaningless pactests (broken requiredby, requiredby*.py
tests). requiredby001.py was renamed to upgrade076.py.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:14:13 -05:00
Nagy Gabor 72c0ab5c51 Resolvedeps rework
I divided resolvedeps into 2 functions. The new _alpm_resolvedep function
will resolve one dependency, for example the 'foo>=1.0-1' dependency.  It
can be useful in sync_addtarget refactoring.

The resolvedeps parameters were changed, to be coherent with recursedeps:
* the target-list is an alpm_list* instead of alpm_list**. This is OK,
  because alpm_list_add == alpm_list_add_last
* syncpkg param was removed. list contains the to-be-installed packages,
  resolvedeps will add the required dependencies into this list
* trans param was removed, it was used in QUESTION() only, which can be used
  on the main (handle->trans) transaction only (because the front-end cannot
  access our pseudo-transactions at all!).

The patch fixes some wrong dynamic pmdepmissing_t usage.

I did a behavior change (and sync1003.py was modified accordingly), which
needs some explanation: The old resolvedeps didn't elect packages from
'remove' list. I've dropped this because I don't want that 2nd excluding
list param. In fact, in real life, we ~never need this rule. Resolvedeps is
called before checkconflicts, so only -Su's %REPLACES% packages are sitting
in 'remove' list. This means, that we have the replacement packages in our
target list. Usually "foo replaces bar" means, that bar isn't in our repos
any more, so resolvedeps *cannot* elect it; but usually it won't try it at
all, because foo is in the target list, and it is expected to satisfy
'bar>=1.0-1'-like dependencies too. Since checkdeps and checkconflicts is
done after resolvedeps, this cannot cause any harm.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:12:55 -05:00
Nagy Gabor 8856146d71 Swap parameters on PM_TRANS_CONV_INSTALL_IGNOREPKG callback function
PM_TRANS_CONV_INSTALL_IGNOREPKG callback function can get 2 params: foo, bar
in this order (packages), bar can be NULL.

Old API:
foo, NULL: Do you want to install foo from IgnorePkg?
foo, bar: foo requires bar from IgnorePkg. Do you want to install bar?
New API:
foo, bar: Do you want to install foo from IgnorePkg? (If bar!=NULL:) bar
requires it.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:12:30 -05:00
Nagy Gabor 616b5967b8 New _alpm_find_dep_satisfier function
This function finds the first satisfier package in a pkglist. Using it
instead of _alpm_find_dep_satisfiers eliminates some memleaks and it is
faster. (_alpm_find_dep_satisfiers and _alpm_find_pkg_satisfiers will be
removed soon.)

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:04:37 -05:00
Nagy Gabor f7199f36ba New _alpm_dep_edge function
The function is introduced to kill some code duplication. The function name
uses the 'dependency graph' terminology.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:04:16 -05:00
Nagy Gabor 2122eb1428 Don't duplicate packages in requiredby list
This is a "fix" for FS#10226. I think that multiple versioned dependencies
are quite common now, and the old behavior is quite annoying there. This
patch won't cause any slow-down.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:03:52 -05:00
Nagy Gabor 5f701005ed Use $PKGEXT (from /etc/makepkg.conf) in bacman
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-01 21:08:50 -05:00
Xavier Chantry 11695bd0d7 repo-add cleanup.
* change ln -s to ln -sf in the Makefile to prevent a failure when the link
already exists.
* make test_repo_db_file simpler and more natural, move the complexity out
of it.
* remove one $cmd = repo-remove check that wasn't needed

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-29 17:37:45 -05:00
Allan McRae d534488f2d Remove symlinks to libtool files
This prevents dangling symlinks to removed libtool files when
the !libtool option is used.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-27 09:07:39 -05:00
Carlo Bersani b15fb504a1 bacman: fix issue with symlink early copy
test -e tries to resolve the link before testing, so if the link is copied
before the actual file, the script exited. This fixes the issue.

[Dan: also add some improved quoting in the script]

Signed-off-by: Carlo Bersani <carlocci@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-22 21:21:05 -05:00
Allan McRae 74eb2f5c61 Additional path quoting and srcdir/pkgdir usage
Removes the remaining $startdir/{src,pkg} usage and adds quoting
around (hopefully) all remaining path variables

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-22 21:12:39 -05:00
Dan McGee 7edb2e5b0d Add information on version comparison to manpages
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-19 19:28:56 -05:00
Dan McGee d594b6e797 Merge branch 'maint' 2008-06-19 08:51:36 -05:00
Dan McGee 5c6809987e makepkg.conf: make keeping docs the default
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-19 08:50:17 -05:00
Dan McGee deec3c8d00 autoclean.sh: Fix paths to po/ dir
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-19 08:47:44 -05:00
Alper KANAT d88524ea0e Add libalpm Türkçe (Turkish) translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-19 08:46:56 -05:00
Dan McGee 29bf6814f7 Use access() instead of stat() when possible
We were using the stat() system call in quite a few places when we didn't
actually need anything the stat struct returned- we were simply checking for
file existence. access() will be more efficient in those cases.

Before (strace pacman -Ss pacman):
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 33.16    0.005987           0     19016           stat64

After:
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 34.85    0.003863           0     12633         1 access
  7.95    0.000881           0      6391         7 stat64

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-15 22:52:27 -05:00
Xavier Chantry 7ff5a917fd makepkg: add several quotes needed after nullglob.
After the "shopt -s nullglob" change, all regular expressions should be
properly quoted.
This commit only fixes the ones I found, there are probably others left, so
this should be kept in mind for easier future fixing.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-15 13:53:15 -05:00
Xavier Chantry b9445c12cf makepkg: Add missing quotes for the source array.
Now makepkg can handle filenames with whitespaces in the source array.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-15 13:52:54 -05:00
Sebastian Nowicki b8a66d6859 Use openssl for checksum verification instead of *sum utilities
md5sum, sha1sum, etc, do not exist on BSD systems by default. Openssl is a
good portable alternative. This also brings in a dependency for openssl.

Closes FS#10530.

Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-15 13:52:03 -05:00
Dan McGee 2158b8e298 Expand PKGBUILD documentation
Add documentation for $startdir, $srcdir, and $pkgdir variables, as well as
general information about the build() function and about custom variables
in PKGBUILDs. This addresses FS#10634.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-14 12:00:43 -05:00
Dan McGee fff746052c Document pacman -q/--quiet operation
Fixes FS#10644.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-14 12:00:40 -05:00
Dan McGee a1dfa8e61f Combine repo-add and repo-remove into one script
They shared about 75% of their code, so there is no real reason we should
maintain them separately. Merge the differences accordingly and add a check
based on the basename of the command used to decide what behavior to follow.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-14 11:31:18 -05:00
Dan McGee 89819b3f92 repo-*: allow use of readlink or realpath
Linux coreutils provides readlink, and BSD systems tend to have realpath
available. Both commands provide similar functionality but of course have
different names. Add a check for either and use what is available.

While doing this, also unify some of the differences that have cropped up
between repo-add and repo-remove.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-14 10:48:28 -05:00
Allan McRae c11bdf19b1 Move geninteg block in makepkg before error checking
This patch moves the generating of integrity checks to before any
error checking takes place in the PKGBUILD file.  This allows integrity
generation to complete when unrelated errors exist in a PKGBUILD file
and allows the removal of multiple checks of the GENINTEG variable that
would otherwise be needed.

In addition a minor fix is made to a comment.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-14 08:35:40 -05:00
Dan McGee 7313c8546a Merge branch 'maint' 2008-06-12 19:21:06 -05:00
Xavier Chantry 331891ceb1 fr.po : fix one minor alignment problem.
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-06-12 19:20:39 -05:00
Alper KANAT 6d737254fc Add pacman Türkçe (Turkish) translation
No libalpm translation yet.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-12 19:14:16 -05:00
Juan Pablo González Tognarelli 0077bfa3a0 Spanish translation updates
Fixes to old translations and new strings for upcoming 3.2 release.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-12 19:10:43 -05:00
Dan McGee 7fc306cd41 Use shell builtin to list files for package inclusion
On BSD systems, as super user, the 'ls' command displays all dot files by
default, causing these to get included when not intended. If we use the bash
glob operator, we can avoid issues with ls on different platforms; however,
we need to turn the nullglob shell option on first to ensure we don't have
problems in empty directories.

Originally-noticed-by: Sebastian Nowicki <sebnow@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-12 19:06:14 -05:00
Dan McGee 1824bc6ee6 Allow use of GIT_VERSION in documentation dir
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-08 17:26:02 -05:00
Dan McGee f827c9572e makepkg: remove deprecated --usesudo code
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-08 17:25:28 -05:00
Allan McRae 4979157cba makepkg: add --allsource option
This supplements the --source option and does nearly the same thing, except
downloaded source files are included in the archive as well. The sources are
now packages with a pkgname/ prefix.

Original-work-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-08 17:16:40 -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
Thomas Bächler 512282ca54 Minor fix to German translation
Signed-off-by: Thomas Bächler <thomas@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-07 15:30:55 -05:00
Allan McRae fcac23763b bacman - regenerate package from system
Original work by Carlo "carlocci" Bersani with additions by
Xavier Chantry and Allan McRae

This script rebuilds an already installed package using metadata
stored into the pacman database and system files.  Replaces the
outdated re-pacman script

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-06 07:01:22 -05:00