1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-10 11:35:00 -05:00
Commit Graph

1288 Commits

Author SHA1 Message Date
Dan McGee
dde7b6f87a Attempt to clean up _alpm_sync_prepare
This function is an absolute disaster, so we'll take it one step at a time
here. This was a quick once-over of the whole thing, trying to straighten
out some of the spaghetti code and fix some mistakes that others found.

We are now down to two failing pactests again: sync300 and upgrade051.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-10 23:17:19 -04:00
Nagy Gabor
544bcbe664 Implement simple topological sort algorithm for sortbydeps
Based on the "depth first search" algorithm, for more infos visit:
http://en.wikipedia.org/wiki/Topological_sorting

The previous algorithm used by sortbydeps was too slow, and to work around
it the number of steps needed to get correct result was reduced greatly.
So it produced wrong results in several cases :
1) smoke001.py
2) http://bugs.archlinux.org/task/7229

More here: http://archlinux.org/pipermail/pacman-dev/2007-April/008057.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-10 22:13:58 -04:00
Chantry Xavier
8588b4823b Ensure correct and consistent usage of depmiss
See comment from Nagy here :
http://www.archlinux.org/pipermail/pacman-dev/2007-April/008134.html
This also makes easier correct usage of checkdeps in sync.c,
which fixes sync901 pactest (and so bug 6057).

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-10 21:41:06 -04:00
Dan McGee
07069cd502 pactest: fix description of remove040
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-10 21:33:24 -04:00
Chantry Xavier
796cc4e6ed Fix for removing a package that is no longer needed
Fix for remove041 pactest. You could not remove a package before that
was provided by something else already installed on the system. This fixes
this problem.

Reference:
http://archlinux.org/pipermail/pacman-dev/2007-April/008131.html
http://archlinux.org/pipermail/pacman-dev/2007-April/008134.html

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-10 21:25:01 -04:00
Chantry Xavier
1da78a7d25 Add two new pactests for FS #6057
As described in the bug report, installing taglib-rcc (sync900 pactest)
works fine. But installing taglib back (sync901 pactest) doesn't.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-10 20:14:20 -04:00
Chantry Xavier
ece1ee7ef2 Add new pactest remove042
Same as remove040, with cascaded remove instead of simple remove.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-10 17:41:35 -04:00
Nagy Gabor
0436601224 Small speed-tuning to upgrade-checkdep
Posted on the ML here:
http://archlinux.org/pipermail/pacman-dev/2007-April/008131.html

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-10 17:31:18 -04:00
Nagy Gabor
97ba9c9227 Fix issue when upgrading two packages that would break deps
Fixes for pactest upgrade060. Posted on the ML here:
http://archlinux.org/pipermail/pacman-dev/2007-April/008130.html

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-10 17:25:20 -04:00
Nagy Gabor
970f15d832 Fix breakage in checkdeps when upgrading a multiple-depend
Fixes pactest upgrade059. Posted on the ML in the following messages:
http://archlinux.org/pipermail/pacman-dev/2007-April/008127.html
http://archlinux.org/pipermail/pacman-dev/2007-April/008129.html

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-10 17:20:12 -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
cadd28072a be_files.c: Fix compilation bug since I removed unnecessary LOG_STR_LEN
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09 13:37:47 -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
VMiklos
dfc85cb5f5 Add a alpm_db_test() function to the backend for checking DB consistency
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
a32ca90192 Remove logmask stuff from backend; switch logging callback to new pm_printf
Remove the logmask functionality from the backend as it has been moved to
the frontend, and change the logging callback function to use pm_printf.

In addition, make much better use of va_list- use the args list instead
of a arbitrarily chosen string to print to in the logging functions.

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
a7f417f35c Update configure.ac with a few new functions to check for
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09 12:57:49 -04:00
Dan McGee
d317acaee8 Add a series of pm_printf functions to pacman frontend
Add pm_printf, pm_fprintf, and pm_vfprintf to the pacman frontend for use by
debug printing and other output messages from pacman. These will be
incorporated into the log callback functions in the next iteration of
changes.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09 12:57:49 -04:00
Roman Kyrylych
430a19c604 makepkg: Make it possible to create an empty package
Signed-off-by: Roman Kyrylych <roman@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09 12:26:43 -04:00
Dan McGee
564d779c2c mirrorlist: Add Brazilian mirror
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09 12:21:11 -04:00
Dan McGee
f7912e9dc6 Const correctness!
Add some 'const' keywords all over the code to make it a bit more strict on
what you can and can't do with data. This is especially important when we
return pointers to the pacman frontend- ideally this would always be
untouchable data.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-05 17:34:33 -04:00
Dan McGee
4906b76c85 Clean up unnecessary headers and macros from alpm.c
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-05 17:32:53 -04:00
Dan McGee
d8e88aa017 Fix compilation with GCC 4.2.0
'inline' keyword in C99 is not correctly recognized, so compilation fails on
the warning it spits. This fixes this.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-05 17:32:09 -04:00
Dan McGee
26e3db423a Merge branch 'alpm.c_cleanup' into frontend_config
Conflicts:

	lib/libalpm/alpm.c
2007-06-04 23:32:38 -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
64d36db5f4 Move functions out of alpm.c to where they belong
alpm.h is the only "publically viewable" file, so there is no reason to have
functions in alpm.c that belong in package.c, db.c, etc. Move the functions
where they belong and leave only the library init functions in alpm.c.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 22:52:04 -04:00
Andrew Fyfe
e0afe6e94a Autotool clean up.
* Add vim modeline to Makefile.am and configure.ac
	* Fix white space in Makefile.am and configure.ac
	* Add contrib/wget-xdelta.sh to EXTRA_DIST in Makefile.am

Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 22:24:29 -04:00
Andrew Fyfe
f32292367a scripts/makepkg.in: Add gettext translation for WARNING and ERROR.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
2007-06-04 22:01:26 -04:00
Andrew Fyfe
a78ad0d38d contrib/wget-xdelta.sh: Replaced with an improved version.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
2007-06-04 22:00:56 -04:00
Andrew Fyfe
b757cc9414 scripts/makepkg.in: Fix version comparision in create_xdelta().
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
2007-06-04 22:00:35 -04:00
Andrew Fyfe
241832853c scripts/abs.in: Rearrange/Cleanup.
* Rearrange the script.
        * Add gettext support.
        * Clean up usage message.

        * Add PACKAGE_BUGREPORT to substitution in scripts/Makefile.am

Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 21:59:17 -04:00
Jaroslaw Swierczynski
a63d58daec Update Polish Translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 21:22:29 -04:00
Dan McGee
1698022bea Fix pacman-optimize autoconf paths
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 17:35:31 -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
Dan McGee
a094deacf4 Start moving hardcoded paths out of libalpm
Move the defaults for RootDir, CacheDir, DBPath, and LockFile into
pacman.conf, just as LogFile was done before. Add a section to
alpm_parse_config to look for a LockFile directive.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 17:00:30 -04:00
Nagy Gabor
029a8a9d44 Add five new pactest tests where pacman currently fails
Most of these new tests deal with provisions upon sync or upgrade being
changed by packages, and pacman not being smart enough to deal with
it yet.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 17:00:30 -04:00
Giovanni Scafora
ecb594107e Add gettext/i18n to most of the currently-used scripts
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 16:54:25 -04:00
Dan McGee
d0679da4f3 makeworld: var rename from version -> myver
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-04 16:54:25 -04:00
Andrew Fyfe
c6c60bcc80 scripts/makepkg.in: More clean up.
* Add ChangeLog to source package.
	* Quote references to $BUILDSCRIPT.
	* Check $srcdir isn't empty when running --noextract.
	* Check $pkgdir isn't empty when running --repackage.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-03 22:21:06 -04:00
Andrew Fyfe
b69edc1c35 scripts/makepkg.in: Improve error handling and clean up on exit.
* makepkg now runs with errexit (exit on syntax error) enabled
	  for the whole script.
	* Removed unneeded setting of errexit around build().
	* Added bash traps to catch TERM HUP INT signals.
	* Added trap to catch unhandled/unknown errors.
	* Added trap to call clean_up() when the script exits.
	* Moved call to remove_deps() into clean_up().
	* Moved -c/--clean code into clean_up().

Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-03 22:19:52 -04:00
Andrew Fyfe
76fd85450e Clean up output messages for translation.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
2007-06-03 22:19:52 -04:00
Andrew Fyfe
2fb2613ec1 scripts/makepkg.in: Rewrite check_{options,buildenv} to tidy them up.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
2007-06-03 22:19:51 -04:00
Andrew Fyfe
3b1e67628e scripts/makepkg.in: Clean up.
* Move create_xdelta() outside of fakeroot run.
	* Clean up dep check functions.
	* Clean up extract_sources().

Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-03 22:19:51 -04:00
Roman Kyrylych
508d5cb3a3 Correct descriptions of configure options
Signed-off-by: Roman Kyrylych <roman@archlinux.org>
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2007-06-03 21:45:06 -04:00
Dan McGee
214f264bd0 Rename functions in makepkg for consistency
Add a hyphen to any function name that needs it so we are consistent across
the board.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-02 13:44:54 -04:00