Commit Graph

1417 Commits

Author SHA1 Message Date
Chantry Xavier f81e619974 libalpm/sync.c : don't go back on STATE_PREPARED when committing fails.
In my opinion, a commiting transaction that failed isn't equivalent
to a prepared transaction.
Some things could have been done in the meantime.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-08-17 14:46:27 -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 16c91bedf8 configure.ac: Clean up and document version number increments
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-16 15:27:38 -04:00
Andrew Fyfe 1cb6d80631 Clean up MD5 code.
* Move alpm md5 functions to lib/libalpm/util.c
	* Remove unneeded includes for md5.h
	* Replace md5 implementation with one from http://www.xyssl.org

Dan: clean up XySSL code by removing parts we don't use, and add a note
saying what changed.
Dan: fix alpm_get_md5sum, off by one error on the malloc call and other
small things.

Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-16 13:17:33 -04:00
Andrew Fyfe ba67fdae63 Remove support for SHA1 from pacman.
There's no need for a second hashing algorithm. MD5 serves the purpose
of verifying that a package file hasn't been corrupted during download.

Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-16 11:30:38 -04:00
Chantry Xavier ee977019e3 libalpm/db.c : add alpm_db_unregister_all.
This basically moves the code from alpm_release, which was mostly about
unregistering all databases, to a safer alpm_db_unregister_all.
This allows to avoid modifying the dbs_sync list while iterating over it,
and and also prevent alpm_release from looping infinitely when a database
can't be unregistered.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-08-16 11:08:17 -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 8038190c7c libalpm/db.c : allow unregistering db for interrupted transaction.
This prevents alpm_release to loop infinitely in case of
an interrupted transaction, where the database wasn't
unregistered.
alpm_release should probably also be fixed, as it can
still loop if db_unregister fails for another reason.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-08-15 20:22:31 -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
Chantry Xavier 064de149b7 libalpm/query.c : makes orphans and foreign options as filters.
The --foreign and --orphans functions now behave as a filter
for the other options. This cleans the code a bit, and will
make easier the adding of new filter options, like
explicit (show only explictly installed packages) or depends
(show only packages installed as dependencies).

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-08-15 20:21:18 -04:00
Dan McGee f4dbb204f1 src/util: Clean up headers and a few fixes
Remove some unnecessary headers in the two utilities as well as fix
a possible non-null termination issue in vercmp.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-15 20:16:46 -04:00
Dan McGee a65ad4efc1 package.h: implement origin_data union in pmpkg_t struct
We were using a void *data element in pmpkg_t before, which is unsafe by its
nature of being untyped. Reimplement data as origin_data being a union that
can hold either a path to a package file or a pointer to a cache database,
and make the other necesary updates in the code to reflect this. See package.h
for details.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-14 10:14:35 -04:00
Dan McGee 49c29e16b3 Code cleanup
Remove the commented desc_localized stuff, we can find it later in version
control. Also remove some unnecessary includes of the stat header and
use -fstack-protector-all which is a bit more broad.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-14 09:33:55 -04:00
Andrew Fyfe 47ee89ada9 scripts/makepkg.sh.in: Fix 2 bugs
- Downloaded files weren't being copied to $srcdir
	- Counter wasn't being incremented for checksum checks

Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
2007-08-12 21:19:08 -04:00
Chantry Xavier f2c7187e43 pacman/sync.c : return 0 on succesful search, 1 otherwise.
Closes FS#7690.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-08-12 21:18:44 -04:00
Nagy Gabor 3a0a4db129 libalpm/conflict.c : small speed-up and fix.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-08-12 21:15:37 -04:00
Nagy Gabor ab06221521 libalpm/conflict.c : small memleak fix.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-08-12 21:14:14 -04:00
Nagy Gabor b96922679e Add two pactest for versioned conflicts.
A side effect of the previous commit ( ea9a756eea )
is that it's now possible to use versioned conflicts.
Add two new conflict pactests for showing it.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-08-12 21:14:05 -04:00
Dan McGee dc5e6d5d87 Update mtune/mcpu/march comments in makepkg.conf
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-30 23:11:32 -04:00
Dan McGee e0ffc60c53 Fix re-pacman locale issues
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-26 20:21:38 -04:00
Juan Pablo González Tognarelli e4f56298be Update Spanish translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-26 19:06:56 -04:00
Andrew Fyfe ce10b5f1e2 Fix gettext output in repo-{add,remove}
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-26 18:59:40 -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
Chantry Xavier ea9a756eea libalpm/conflict.c : cleanup + fix for conflict001.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-20 11:58:52 -04:00
Nagy Gabor 72c15482dc add conflict001 pactest.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-07-20 10:42:01 -04:00
Nagy Gabor 0d00f7095f libalpm/sync.c : two memleak fixes in _alpm_sync_prepare.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-07-20 10:37:24 -04:00
Chantry Xavier b0c064d59b libalpm/sync.c : fix DEPENDSONLY flag handling.
I didn't like the patch proposed by Nagy for the sync1002 pactest here:
http://www.archlinux.org/pipermail/pacman-dev/2007-July/008971.html

So here is another attempt of fixing it.
In case of the DEPENDSONLY flag :
1) pass an empty list to resolvedeps instead of the list of targets
2) empty the trans->packages targets list before adding the resolved deps.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-07-20 10:34:28 -04:00
Nagy Gabor 5991e85abb Add sync1002 pactest.
Reference:
http://www.archlinux.org/pipermail/pacman-dev/2007-July/008971.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-07-20 10:33:42 -04:00
Chantry Xavier df2447cd23 libalpm/alpm_list.c : add SYMEXPORT to all alpm_list_ functions.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-07-20 10:28:07 -04:00
Dan McGee 23a4d51b7a Reorder functions in libalpm/package.c for Doxygen purposes
Put all of the public functions at the top and inside the Doxygen packages
group.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-18 10:26:21 -04:00
Nagy Gabor 88077889a4 Hungarian translation updates
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-18 10:12:14 -04:00
Chantry Xavier 240bdf5971 libalpm/deps.c : split alpm_depcmp.
That function wasn't big, but this might be useful
for later refactoring of the search for satisfier code.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-17 10:10:27 -04:00
Chantry Xavier c68d3cc38a libalpm/deps.c : split sortbydeps function.
The _alpm_sortbydeps function has two main part :
1) initialization of the graph structure
2) the sorting itself

So it didn't seem bad to move the first part to a second function.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-17 10:06:26 -04:00
Dan McGee 466d289e6a Remove unnecessary entries from .gitignore files
.gitignore works recursively, so we don't need Makefile and Makefile.in
in all of the subdirectory .gitignore files.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-16 16:49:28 -04:00
Chantry Xavier fa2164a59e Use only one mirror list for all repos
Fully implement what this commit allows:
ebad199614

Dan: update .gitignore as well.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-16 16:42:09 -04:00
Chantry Xavier 99572ed8f6 new pmdepend_t / pmdepmissing_t accessors.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-16 09:21:13 -04:00
Chantry Xavier ab2354e762 Add remove046 pactest for FS#7622.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-07-16 09:20:17 -04:00
Dan McGee 1d97da9450 makepkg: Add note with some required programs for execution
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-15 22:31:29 -04:00
Dan McGee 591bfabbd3 Clean up libalpm/add.c and revise file extraction code
This is a full refactoring of _alpm_add_commit into multiple functions and a
better layout for later. Some highlights:

* No regressions in pactest performance.
* Much cleaner layout. add_commit is split into four functions:
  upgrade_remove, extract_single_file, commit_single_pkg, _alpm_add_commit
* No more super-functions, the heaviest (extract_single_file) is finally
  under 400 lines, with much improved commenting as well.
* Incorporation of Andrew Fyfe's ideas for fixing FS #7484. Try to handle
  all possible cases of extraction combinations with files, symlinks, dirs,
  and non-existant entries on the filesystem. This should make our dealings
  with libarchive fall more into our control.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-15 21:36:46 -04:00
Chantry Xavier aaf291c11c Add new sync012 pactest.
This test installs three packages with a circular dependency,
to check everything still goes fine in that case.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-07-15 19:46:18 -04:00
Dan McGee a909fe6018 Update AUTHORS file, change encoding to UTF-8
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-15 15:00:49 -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
Nagy Gabor c2920033d0 libalpm/deps.c : cleanup + little fix for resolvedeps.
The resolvedeps function was a bit negligent, as showed by the sync011 pactest.
Reference :
http://www.archlinux.org/pipermail/pacman-dev/2007-July/008782.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-07-15 10:37:38 -04:00
Dan McGee 66b09410b4 Switch repo-add, repo-remove, and pacman-optimize to bsdtar
Relatively straightforward fixes (s/tar/bsdtar/g, add hyphens to options).

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-15 10:29:26 -04:00
Dan McGee f0ea21cffc Ensure requiredby entries are removed during an upgrade
This fixes the failure of the requiredby004 pactest in a not so pretty way,
but it gets the job done. I purposely used the extremely long name of
PM_TRANS_TYPE_REMOVEUPGRADE to be both clear and in the hope that someone
else will figure out a better solution.

Original idea from Nagy Gabor, patch updated and cleaned for current code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-14 09:34:39 -04:00
Nagy Gabor ce1fb07436 libalpm/sync.c : ldconfig is run twice.
remove _alpm_ldconfig call from _alpm_sync_commit,
since sync operation causes an upgrade transaction,
where ldconfig is already run.

Reference:
http://www.archlinux.org/pipermail/pacman-dev/2007-April/008132.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-14 01:12:18 -04:00
Chantry Xavier edcefb1d58 libalpm/remove.c : revert part of commit to fix remove044 pactest
In 1c9f30b9fa

This change should be done AFTER the TODO in recursedeps is implemented.
Then we'll be able to first sort the list, then call recursedeps which keeps
it sorted. For now, the sorting should still be done as the last step.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-13 17:18:27 -04:00
Dan McGee b5ab4bffb7 Add TRANSLATORS file
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-13 16:01:17 -04:00
Nagy Gabor 9f9086573a Update hungarian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-13 15:44:39 -04:00
Chantry Xavier 1c9f30b9fa libalpm/deps.c : fix for remove044 pactest.
Patch from Nagy that makes removedeps use alpm_depcmp.

I also renamed removedeps to recursedeps, as it can have
a more general usage, and added an include_explicit argument,
so we can control if packages explictly installed are added or not.

Note: Small changes made by me (Dan) as well- mostly some English grammar
correction and a few other cleanups.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-13 10:37:13 -04:00