Commit Graph

52 Commits

Author SHA1 Message Date
Florian Pritz cd2370754a Remove ts and sw from vim modeline when noet is set
Forcing vim users to view files with a tabstop of 2 seems really
unnecessary when noet is set. I find it much easier to read code with
ts=4 and I dislike having to override the modeline by hand.

Command run:
find . -type f -exec sed -i '/vim.* noet/s# ts=2 sw=2##' {} +

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28 20:19:25 +10:00
Andrew Gregory 3d2c8e1fd0 conf.c: extract ini parsing code to separate files
Move _parseconfig to ini.c as _parse_ini and create a convenient wrapper
for the public API.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-08-21 11:06:41 +10:00
Allan McRae 27d9c25ee2 Split common utility functions for libalpm and pacman
There is duplicated code in the util.c files in the libalpm and pacman
source code. Split this into a separate file so that it can be shared
via a symlink. This prevents code divergence between the two code bases.

Also, move mbasename and mdirname from pacman/util.c into util-common.c
in preparation for the following patch that uses them to add an extension
to pacsave files.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04 21:49:37 +10:00
Allan McRae 18ddf90ff4 Move check function into its own file
There is going to be a lot of overlap in the code for the quick
and full checks that can be abstracted into their own functions.
Also many other file checking functions will be needed for the
full check. Put all these in a separate source file.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14 13:45:12 +10:00
Dave Reisner 40d6894910 buildsys: eschew use of DEFS, prefer AM_CPPFLAGS
This is redundant, and any usage of -D should belong to CPPFLAGS.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Dave Reisner 793eff3704 buildsys: define warning CFLAGS in separate var
Continue the trend of not touching the environment CFLAGS, ensuring that
the user always has the final say.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08 22:28:45 -04:00
Allan McRae 8741551dc9 Move ROOTDIR definition into config.h
This was the only variable of its kind when a define was done on the
compiler command line.  Move it into config.h instead.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-13 10:02:50 -06:00
Dave Reisner d6ccd44390 include config.h via Makefiles
Ensures that config.h is always ordered correctly (first) in the
includes. Also means that new source files get this for free without
having to remember to add it.

We opt for -imacros over -include as its more portable, and the
added constraint by -imacros doesn't bother us for config.h.

This also touches the HACKING file to remove the explicit mention of
config.h as part of the includes.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-21 18:13:17 -06:00
Dan McGee a4a7006a13 po/: split into scripts/po/ and src/pacman/po/
This is the first step at separating the pacman message catalog and the
scripts message catalog. Makefiles, configure.ac, and other such files
are adjusted accordingly, as well as renaming files. The TEXTDOMAIN of
scripts is also adjusted.

Note that no actual pot or po files get changed here; these will get
pruned in a future commit so each catalog contains only the necessary
messages.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-23 22:50:01 -05:00
Chris Brannon ac88e90557 Let pacman specify GnuPG's home directory.
GnuPG looks for configuration files and keyrings in its home directory.
For a user, that is typically ~/.gnupg.
This patch causes pacman to use /etc/pacman.d/gnupg/ as the default
GnuPG home.  One may override the default using --gpgdir on the command-line
or GPGDir in pacman's configuration file.

Signed-off-by: Chris Brannon <cmbrannon@cox.net>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23 03:22:36 -05:00
Xavier Chantry e277e838d7 Makefile: Use git describe --dirty for GIT VERSION
dirty indicates if the repo has uncommited changes or not when building,
so dont hardcode this info.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-22 10:02:57 -06:00
Nagy Gabor ac9dde072c Introduce -D, --database
The request of FS#12950 is implemented.

On the backend side, I introduced a new function, alpm_db_set_pkgreason(),
to modify the install reason of a package in the local database. On the
front-end side, I introduced a new main operation, -D/--database, which has
two options, --asdeps and --asexplicit. I documented this in pacman manual.
I've created two pactests to test -D: database001.py and database002.py.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-05 10:37:01 -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
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
Dan McGee bf84c23266 Merge branch 'maint' 2008-04-15 19:07:51 -05:00
Dan McGee d685d0220f Fix gettext on non-Linux platforms
Linux includes all the gettext stuff in glibc, so there is no need for the
libintl links which we failed to include in our linker variables. Update the
makefiles which should enable NLS support on all platforms, including OS X
and Cygwin.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-14 21:01:30 -05:00
Dan McGee 797c190f93 Remove frontend add code that is no longer necessary
Change the pacman_upgrade stub function to do what pacman_add used to do so
we can eliminate pacman_add. Move the code to the more-descriptive name of
upgrade.c.

Note that we have made no changes to the backend libalpm, where an ADD type
transaction could still be supported.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-08 14:13:34 -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
Dan McGee e5be26fb23 Make building of pacman.static optional
Because building of pacman.static fails on some platforms, we should make
it optional. It is enabled by default but can be disabled with the use of
the --disable-pacman-static flag.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-04 10:42:08 -06:00
Dan McGee 3e1b72f4f2 Clean up LDADD usage
We had a lot of unnecessary overstatements of libraries to include on
linking, and autoconf/automake takes care of this for us. This also helps
some compilation issues on other platforms.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-26 20:40:20 -05:00
Dan McGee d09d114e99 Add a default cachedir if one wasn't specified
Use the default cachedir (specified at compile time) if one wasn't specified
on the command line or in the config file.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-21 21:53:38 -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
Dan McGee 49f447d02c First step of moving translations from src/pacman/po to po/
Move the translations from src/pacman/po to just po/ so we can include the
scripts gettext translations in the same message catalog as that of the
pacman frontend. The libalpm message catalog, for now, will remain a separate
existence.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-06 17:59:08 -04:00
Dan McGee 7daa6708d2 Remove lockfile configuration from frontend, make it job of libalpm
I previously introduced some patches to make just about every path in
pacman/libalpm configurable; doing this with the lockfile seemed a bit too
far and we really should just place the lockfile where it belongs- with the
DB that needs locking.

More details in this thread:
http://archlinux.org/pipermail/pacman-dev/2007-June/008499.html

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-27 23:34:38 -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
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
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 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
Dan McGee dd926c7a1c Modernize and update configure.ac
Using the autoscan tool, ensure we are doing the checks we should be doing
in configure.ac. There is still more work to do, but this is a start at
cleaning up the file a bit to make it much easier to change in the future.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-05-30 09:04:36 -04:00
Dan McGee 63588aff19 Remove output.c and output.h
One function was left in this set of files after the earlier cleansing, so
I moved yesno to util.c.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26 19:20:46 -04:00
Dan McGee 7bbcaaaae9 Add -pedantic flag to pacman (frontend) CFLAGS
Now that we got rid of the ERR and WARN macros, compilation with
-pedantic turned on works with only minor changes.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26 16:59:38 -04:00
Dan McGee f0304168ee Move log.c/h -> output.c/h to properly reflect what is contained
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26 14:34:47 -04:00
Dan McGee dc05cd107c Pacman side code consolidation- unify callback functions to one file
Some more major code reorginization here. The download progress callback
function has been renamed and moved to callback.c, which is the former
trans.c with the download and log callbacks added. In addition, this allows
util.c to be cleaned up as fill_progress can now be static in callback.c.
We've also cut two more source files out.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26 14:34:41 -04:00
Dan McGee 34aefc62e4 Remove single-function upgrade.c
Move pacman_upgrade into add.c, at least for now. It really doesn't need
its own file. For the long term, we may want to move this whole file
back to upgrade.c if we deprecate the add operation.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-25 11:07:48 -04:00
Dan McGee 5e1419c0b5 Merge single-function header files on pacman side
Having a seperate header file for add, remove, query, etc. seemed overkill.
Merge them all into a common pacman.h and fix the necessary #includes.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-25 11:07:47 -04:00
Dan McGee ba1806f5ac * Removed ${CFLAGS} from Makefile.am(s) as it was causing all CFLAGS to be
duplicated.
* Updated the util Makefile.am to link with the proper libalpm.la.
* Fixed bitmasking issues in be_files.c and db.h.
* Rankmirrors updates from James Rosten (with some cleaning up of my own).
  KeyboardInterrupts are now handled gracefully.
2007-03-12 03:02:57 +00:00
Dan McGee 3595201f5f * A lot of Makefile.am updates to try to get 'make dist' and 'make distcheck'
to work as expected.
2007-02-22 04:36:02 +00:00
Aaron Griffin 1334f5c56c * Use the libtool'd .la file as a link target so we can run pactest properly 2007-02-21 06:35:07 +00:00
Aaron Griffin a382d33d45 Cleaned up some more output
* Questions no longer start with "error:"
* downloaded size is output as a float now
2007-02-10 09:34:59 +00:00
Jürgen Hötzel 13f9fc4d19 * Fix building outside $(srcdir).
* Removed ./gen-mirrorlist.sh invocation from configure script:
  Mirror-files are generated by make, not configure.
2007-01-29 22:18:31 +00:00
Aaron Griffin e22336673a Dan McGee <dpmcgee@gmail.com>
* Lots of code cleanup, and type fixes
* Make 'makeworld' a bit more in-line with the other stuff
* Make -Si and -Qi operations appear the same
2007-01-26 02:13:16 +00:00
Aaron Griffin 6167017264 Preliminary checkin for alpm_list conversion
* renamed pmlist_t -> alpm_list_t
* made alpm_list_t a public type (alpm_list.h header)
* removed additional storage for registered DBs in pacman source
* some code cleanup
* removed duplicate (pm)list_display functions from pacman source
* misc code cleanup
2007-01-19 09:28:44 +00:00
Aaron Griffin 86b136bb59 Dan McGee <dpmcgee@gmail.com>
* Removed some unnecessary headers and library links
* Made things static if possible
* Cleaned up makefiles a bit
* Fixed some old comments in the code
* Fixed some errors the static code checker splint pointed out
* Backwards arguments in a memset call in _alpm_db_read (could have been worse)
* Other various small fixes

Other:
* Default to 80 columns when getcols cannot determine display width
* Removal of ._install as a valid install file in packages
2007-01-18 16:52:57 +00:00
Aaron Griffin 2546a35cd5 Configuration changes:
* Added libdownload check in configure.ac
* Added generation for mirrorlists in pacman.d
    NOTE: autoconf sucks for things like this, so gen-mirrorlist is required

Dan McGee <dpmcgee@gmail.com>:
    * mirrorlist.in file

Roman Kyrylych <roman.kyrylych@gmail.com>:
    * ukrainian mirror

Jürgen Hötzel <juergen@hoetzel.info>:
    * conditional build for pacman.static
2006-12-28 16:54:35 +00:00
Aaron Griffin aa1c0ba9f8 * repo-add script - to add entries to a db file directly from package data (no PKGBUILD)
* libalpm api changes - move from a _getinfo(p, WHAT_WE_WANT) scheme to a
  typesafe _get_what_we_want(p) scheme [not 100% complete yet]
* some const correctness changes
* removal of PM_* types in alpm.h in favor of the pm*_t types used throughout
  libalpm
2006-11-20 09:10:23 +00:00
Aaron Griffin 4470e5ce01 * Numerous mini valgrind fixes.
* Addition of hacky architecture check in the _splitname function
* Removal of libfetch from the archlinux proper - it has been renamed to
  libdownload and can be found at http://phraktured.net/libdownload
* Merge of _some_ of the Frugalware makepkg change - this may still be
  incomplete
* Removal of libftp from cvs proper
* PKGBUILD manpage now says 'PKGBUILD' instead of FrugalBuild (he he)
2006-11-14 07:58:42 +00:00
Aaron Griffin 3e608e7e85 * Improved mcheck output
* Added minor libalpm const correctness
* Mini-memory fixes
2006-11-08 08:14:29 +00:00
Aaron Griffin 5a8bbc99be Numerous changes:
*   Added 'ILoveCandy' support to all progress bars
*   Changed download callback with regards to libfetch libalpm changes
*   libfetch error output on failed sync
*   Misc others I may have forgot to name (check the diff, heh)
2006-10-31 06:41:42 +00:00
Aaron Griffin 3f27542156 Merged frugalware changes. Added a few other minor things too, but there's alot
to list.  The diff should show you 8)
2006-10-15 19:34:52 +00:00
Judd Vinet 7236dd3287 i18n stuff 2006-06-28 05:37:15 +00:00