Commit Graph

106 Commits

Author SHA1 Message Date
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
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
Dan McGee 20f73d6299 Remove versioncmp.{c,h}, clean up selective #ifdefs
Remove versioncmp.c by moving all functions to locations that make sense.

Move replacement functions (for building without glibc) into util.c where
they belong, and do proper checks for them instead of using __sun__, etc.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-12 15:20:43 -04:00
Dan McGee 653fb8fe03 Remove 'buildtype' from libalpm and pacman
Remove unused buildtype field from pmpkg_t struct and anything associated
with it, as it is unused at the moment. If we need to readd it, it is an
easy revert of this commit.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-11 23:36:13 -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 a2186a43a8 Add top level hidden file code to package.c
This was already taken care of in add.c by commit
2ae0438660, but was missed in package.c.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-08 23:46:48 -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 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 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
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 1381b58ceb Fix extraneous "ignoring upgrade" output on Ignore'd packages
Reorder package version checking so there is no output when a
package is listed in IgnorePkg.
Closes FS#7111

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-05-18 01:22:18 -05:00
Nagy Gabor a3994f975b Use alpm_depcmp in _alpm_pkg_update_requiredby
The old function did too much on its own; let alpm_depcmp do the hard
work. This will allow for future versioned provisions if necessary.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-05-14 10:56:52 -04:00
Dan McGee 2bcecbd62c Remove unnecessary casts on malloc and elsewhere
We had many unnecessary casts, most of them dealing with malloc and
other memory allocations. The variable type should take care of it;
no need to do it explicitly. In addition, I caught a const error while
removing the casts.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-05-14 03:16:55 -04:00
Dan McGee 8bbb5dd078 libalpm util.c and util.h cleanup
* Remove some unnecessary conditional compiling in util.h- move the
  functions tha required it to trans.c (along with a bunch of new header
  includes).
* Clean up util.h a bit- remove some header includes, remove universal
  libarchive include and only put it in the files that need it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-29 12:47:02 -04:00
Dan McGee a58e17a1d7 Remove STRNCPY macro from libalpm
Replaced calls to the STRNCPY macro with the actual strncpy function, and
pacman passes all pactests.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-29 12:03:09 -04:00
Dan McGee eeb38ef677 Remove 'removes' array from libalpm
We don't use this functionality for now, so get rid of it and the
functions associated with it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-28 19:56:29 -04:00
Dan McGee a3491224df Remove FREEPKG macro and correctly type _alpm_pkg_free
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-28 02:59:58 -04:00
Dan McGee 75efcbbff6 Clean up gettext on the libalpm side
Remove inclusion of libintl.h from all files, because we can do it once
in util.c where the _() macro is defined.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26 19:39:53 -04:00
Chantry Xavier 5de03497c3 Let IgnorePkg superceed the FORCE package flag
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-04-22 21:48:10 -05:00
Dan McGee d6d7435a6c Fix a 0 and '/0' switch
It looks like someone accidentally put a 0 instead of '/0', this fixes it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-03-29 00:57:04 -04:00
Dan McGee 0203fabe54 * Fix an issue where the same dependency was recorded multiple times in the
'required by' field.
2007-03-12 04:47:58 +00:00
Aaron Griffin 166ffc4f9e * Bug fix for makepkg dependency testing. This requires that we
expose alpm_splitdep and alpm_depcmp as public symbols
* Removed a duplicate strtrim for question responses
2007-03-07 07:45:30 +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
Dan McGee e24c22e308 * A little more hacking with wchar_t output, but nothing really changed in
it. Eventually we'll make progress.
* Rewrote the _alpm_splitdep function to behave more like all our other
  function calls. Use heap instead of stack allocation for the depend struct,
  so now it needs to be freed by the caller.
2007-03-03 09:43:16 +00:00
Aaron Griffin 7f5dada885 Big commit this time:
* Moved entirely to alpm_pkg_get_* accessors, to read data on demand
* Mostly removed the INFRQ_ parameters from outside the be_files backend (making
  the backend more extensible in the long run)
* packages created from _alpm_db_scan now have the db and origin set (making
  accessors actually work for these packages)
* removed _alpm_db_ensure_pkgcache

* totally revamped the _alpm_checkconflicts function, making it cleaner and
  easier to read (and thus fix in the long run) - maintainable code ftw
  NOTE: feel free to rename the functions... I couldn't think of anything better

* removed an extra loop in sync.c:find_replacements - no sense in looping over
  an entire DB while strcmp'ing the name, when we have get_pkgfromcache

Other:
* package struct "license" -> "licenses"
* Created _alpm_sync_find (duplicate code in some places, find_pkginsync
* Minor const correctness changes along the way
* fixed a couple extra '/' pathing issues (non-issues really)
* removed a duplicate pkg_cmp function
2007-03-03 08:13:59 +00:00
Dan McGee efca1cc010 * Modified values of INFRQ_* options so we start at 0x01 and not 0x00. This
allows for the same bit operators to be used across the board on pkg_get
  operations.
* Changed name of INFRQ_NONE -> INFRQ_BASE to more clearly reflect what it
  does (loads pkg name and version).
* Added a few missing things on package functions, such as SYMEXPORT and
  ALPM_LOG_FUNC.
* Slight updates to pmenv to print 'pass' and 'fail' instead of 'passed' and
  'failed'. Keeps output a bit more concise.
* Fixed a doxygen comment spelling error. :P
2007-03-01 19:07:38 +00:00
Aaron Griffin 4aca4980a7 *** empty log message *** 2007-03-01 05:42:53 +00:00
Dan McGee 13e2111045 * Unifying placement of REPLACES in desc file, as pacman2 does. We'll worry
about bigger DB changes later, but lets not screw anything up for release.
* Removed some weird uses of "not ... ==" usage in pactest- correct me if I'm
  wrong, but isn't "!=" a lot more clean and concise?
* Print description of failed tests in the pactest summary. This could get
  dirty with a lot of failed tests though, so watch out.
2007-02-28 16:37:24 +00:00
Aaron Griffin 8fbdd03cce * Enforce const char* params when using strings
* Unified some functions names "package" -> "pkg" for consistency
* Removed the goofy 'faketarget' stuff used for dep testing
* Renamed alpm_pkg_isin -> alpm_pkg_find
* Renamed alpm_db_readpkg -> alpm_db_get_pkg
2007-02-26 08:38:48 +00:00
Aaron Griffin 78ecf9a12b * The info level for this was wrong, causing replacements to not really work 2007-02-23 08:00:06 +00:00
Aaron Griffin faad70aa54 * Too much debugging output in the alpm_pkg_compare_versions function
* Using the wrong info level for replacements
2007-02-23 07:53:25 +00:00
Aaron Griffin d584d8c068 * Modified the handling and output w.r.t. IgnorePkg entries. -Sy always ignores
these packages, but -S explicitly asks for confirmation.
2007-02-23 02:10:56 +00:00
Aaron Griffin 871e123cf3 * Cleaned up some debug output
* Fixed a segfault in the conflict checking code
* Added an automatic failure in the case of -A/-U for a replacement of an
  existing package.  This requires a large amount of work and is postponed for
  now.  Example:
    If ncmpc is installed, pacman -U /path/to/ncmpc-svn.pkg.tar.gz will fail
    with and appropriate error message
2007-02-22 04:42:59 +00:00
Dan McGee a5f630fda6 * Fixed inconsistency of args- _alpm_db_read, _alpm_db_write. 2007-02-21 08:34:36 +00:00
Aaron Griffin 119b3ab043 Moved the update_depends function to trans.c, as it depends on a transaction
object
2007-02-18 22:07:11 +00:00
Aaron Griffin 92ad556512 * A whole mess of backup changes
- the code should be clearer, more organized, commented, and have worthwhile
    variable names now
  - proactive backup=()s now work.  That is, adding a file to a backup array
    does what it should on the upgrade to that package, no longer forcing you to
    wait a full upgrade cycle for it to take effect
* ldconfig was being run twice on an upgrade operation - fixed
* fixed another pm_fprintf/printf output corruption with the progress bars
* refactored some duplicate code for adjusting 'requiredby' lists
* Added config.rpath to .cvsignore
2007-02-17 08:55:05 +00:00
Aaron Griffin a1f36454c2 Added a 'contrib' directory for other stuff that might be a good idea to maintain here.
* moved bash_completion from the "archlinux" script in the official bash_completion package
* moved zsh_completion from the AUR zsh-pacman package
2007-02-16 19:37:00 +00:00
Aaron Griffin 3a2d87d61d * Fixed _alpm_pkg_compare_versions so that it does not output warnings if versions match. (reported by Travis Willard) 2007-02-14 16:15:09 +00:00
Aaron Griffin 103dbb9fd1 * Refactored conflict checking within packages. Profiling from Dan showed an
unbelievable amount of strcmp() calls (25 million) due to the list searching.
  This has been reimplemented with a set-intersection scheme, due to the fact
  that file lists are always ordered. - NEEDS TESTING
* Minor clean up, "globalized" the str_cmp helper to match the alpm comparison
  signature, so we can use it elsewhere.
2007-02-13 08:15:38 +00:00
Aaron Griffin af48c695eb Removed desc_localized for the time being. We don't have localized
descriptions, nor do we actually build them with the newest makepkg.  The actual
implementation in here seems like it could be done better, and it soaks a large
amount of CPU time according to profilers.
2007-02-13 01:46:33 +00:00
Aaron Griffin d080809c45 * Package file parsing - fixed size and isize - isize is the "size" variable
from the PKGINFO, and size is the stat() size of the archive
* Removed the useless 'output' param from package.c:parse_descfile
* Installation progress
  - Call progress callback once at 0% for initialization
  - 'needdisp' was useless
  - alpm_list_count is called an excessive amount in these nested loops.  Now we
    only call it once per iteration
  - Use the compressed sizes for PROGRESS calcs as uncompressed (isize) is not
    exact (it is missing metadata sizes), and thus produces > 100% numbers
2007-02-10 23:44:39 +00:00
Dan McGee 73402a1459 * Fix compile errors/warnings.
* Update .cvsignore files a bit.
2007-02-09 21:54:57 +00:00
Aaron Griffin f8cd4858ca * I made "alpm_versioncmp" public a while back, without noticing this was already done (alpm_pkg_vercmp). I dropped this change, making versioncmp "private" again. (alpm_versioncmp -> _alpm_versioncmp, hidden symbol)
* Make alpm_get_upgrades use the same version check that -Su and -S use.
2007-02-09 21:08:10 +00:00
Aaron Griffin cbd516a06e Only honor 'force' if versions are NOT identical 2007-02-07 06:12:53 +00:00
Aaron Griffin 6c5066471c Cleanup and more debug info for alpm_pkg_compare_versions 2007-02-07 05:57:28 +00:00
Dan McGee 96a0115630 Cleaning up mistakes. :P 2007-02-06 21:28:29 +00:00
Aaron Griffin 79c277a218 Attempt #2 at -S/-Su unification: verify that the 'force' option has been read before comparing versions 2007-02-06 20:57:17 +00:00
Aaron Griffin 7d63ecfac6 Copy-pasta errors. 8) 2007-02-06 17:41:36 +00:00
Aaron Griffin 67ea493ec2 Attempt to unify the -S and -Su version comparissons for when a package is newer
See FS#5388
2007-02-06 17:39:32 +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