1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-10-31 15:45:03 -04:00
Commit Graph

250 Commits

Author SHA1 Message Date
Allan McRae
1d0a69c655 Fix gpgme detection
The gpgme detection had a couple of issues which are fixed:

1) In some cases it would not error out when gpgme was missing and
--with-gpgme was passed.

2) In some cases, the CFLAGS/LDFLAGS etc would not be properly
restored.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-02-13 11:50:33 +10:00
Maxime Gauduin
8624eddb31 Make sed follow symlinks on Linux
Signed-off-by: Maxime Gauduin <alucryd@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-28 23:38:46 +10:00
Allan McRae
89ecf8cabe Make path to ldconfig configurable
The FHS (2.3) says having ldconfig in /sbin is optional and it is usually
located in /usr/sbin.  So /sbin/ldconfig should not be hard coded in
pacman.  Instead, provide a configure option --with-ldconfig that defaults
to the current path.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-28 23:38:46 +10:00
Allan McRae
ad280e1b56 Revert execvp and related commits
This reverts commit 4a8c2852a8.
This reverts commit 993700bc6b.
This reverts commit bb4d2b72c1.
This reverts commit 60b192e383.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-28 23:30:40 +10:00
Allan McRae
993700bc6b Do not require full path for scriptlet shell
This increases robustness to the shell location changing paths.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-17 22:32:54 +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
241d6b884a makepkg: use --apparent-size when du supports it
Amazingly, using "sleep 1" to convince btrfs to report correct file
sizes is only a 90% fix.  Sometimes more sleep is needed.

Instead we use the --apparent-size argument to du to get actual file
sizes. This is used only on Linux as the various BSDs do not support
this argument.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03 12:03:10 +10:00
Allan McRae
d5a6ce8ca1 Remove checks for geteuid
The geteuid function is defined in POSIX and we will not support any
operating systems without it.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03 12:03:10 +10:00
Allan McRae
5aaf5bcf83 Remove Cygwin support
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03 12:03:10 +10:00
Allan McRae
13667fd4b1 makepkg: allow debug package suffix to be configurable
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Dave Reisner
1c0c292728 pactree: autodetect and use unicode line drawing characters
Add a compile time check for langinfo.h so that we can possibly use
unicode line drawing characters if the current locale is supportive of
them. This can be explicitly disabled at runtime with the use of a new
switch: -a, --ascii.

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
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
768c8ba100 configure.ac: cleanup duplication in --enable-git-version
Avoid adding our own messaging, as autoconf will add this for us with
the result of the AC_CHECK_FILE test. Reuse the cache variable from
autoconf to set our local variable.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Dan McGee
1d0ab50c05 Fix thinko in configure.ac CFLAGS empty checking
Since commit d2669b47, CFLAGS specified on the command line haven't been
respected at all, resulting in no optimization being applied to builds.
This exposed one warning flag issue in some new code, which is also
fixed here.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae
d2669b4781 Do not enable _FORTIFY_SOURCE without optimization
With glibc-2.16, using -D_FORTIFY_SOURCE requires that optimization (-O)
be used or it will prodice a warning message. Enable -Werror in our
test for _FORTIFY_SOURCE support to catch when a users specifies CFLAGS
without optimization.

The line to set CFLAGS="" when no CFLAGS are specified (either due to
being unset or geniunely empty) is required as autoconf will use
"-O2 -g" for its tests by defult when CFLAGS is unset, but will not add
them to the CFLAGS used...

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-01 09:16:46 -05:00
Jeremy Huntwork
19c2347507 Portability fixes for makepkg
Allow makepkg to work correctly when used with find from busybox.
Fix handling of cross directory symlinks.

Signed-off-by: Jeremy Huntwork <jhuntwork@lightcubesolutions.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-06-25 23:06:43 -05:00
Dave Reisner
82b7122542 libalpm: add pkg-config file
No one seems to do this "correctly", but for the sake of having an easy
method of detecting the presence and version of libalpm on a given
system, we provide a straightforward .pc file.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-25 20:02:36 -04:00
Dave Reisner
ea4aa6f184 configure: require bash >= 4.1 at compile time
We've unofficially agreed to raise our minimum supported bash version to
4.1, and since added features that require it. Additionally, an earlier
commit adds a syntax check to the builds of scripts/ and contrib/ which
could conceivably fail with an earlier shell. Therefore, make this a
hard requirement of the build process.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24 09:54:06 -04:00
Dave Reisner
8679cd68d8 scripts/library: introduce parseopts
This will replace our current options parser used in pacman-key,
makepkg, and ideally elsewhere. It follows heuristics closer to that of
GNU getopt long (and thus pacman itself), with the exception that it
does not allow for options with optional arguments. Due to the way this
parser will be used, this sort of functionality will not be needed.

Instead of relying on eval+set, options are normalized into an array,
OPTRET, which callers should expect to be populated after returning from
parseopts. This avoids problems with quotes and spaces in arguments,
assuming that the user quotes properly when passing into the
application.

A new test harness for parseopts is added in test/scripts.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-24 08:38:36 -05:00
Dave Reisner
1eb6a9cbfe configure: avoid linking against libssl
We're not linking to libssl, only libcrypto. -Wl,--as-needed will get
rid of this, but there's no sense in checking for and linking against a
library we don't need.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-24 08:34:17 -05:00
Allan McRae
8fb1948cd0 Add more warning flags
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-04-09 00:03:32 -05:00
Dan McGee
b729ed0109 Add a new configure option for excessive compiler warning flags
This adds a bunch of warning flags to the list used when compiling.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-08 22:28:45 -04:00
Dave Reisner
30ca48df4c buildsys: move autotools bloat to build-aux
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08 22:28:45 -04:00
Dave Reisner
5f77402577 buildsys: cleanup libtool and autoconf initialization
- Use LT_INIT over AC_PROG_LIBTOOL, as the latter is a deprecated alias
  for the former.
- Remove redundant macros which are called implicitly by LT_INIT.
- Remove unneeded AC_PROG_CXX call (we don't use c++ anywhere)
- Add AC_CONFIG_MACRO_DIR([m4]) -- not strictly necessary, but added for
  consistency with autogen.sh and Makefile.am

ref: http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08 22:28:45 -04: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
Dave Reisner
7fcb445f35 buildsys: use AC_DEFINE for CYGWIN macro
Instead of directly modifying CFLAGS, use config.h for its intended
purpose.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08 22:28:45 -04:00
Dave Reisner
cb5b66367d buildsys: cleanup gpgme compile time check
- handle gpgme libs and cflags separately rather than appending to
  CFLAGS and LDFLAGS
- be consistent in AC_LINK_IFELSE check for gpgme 1.3.0 (though this is
  irrelephant since we don't actually run)
- be consistent with usage of "have" and "with" variables (this
  actually ends up reducing SLOC)
- when voluntary detection fails, unset GPGME_CFLAGS and GPGME_LIBS
- when requested support fails the version check, complain about the min
  version.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08 22:28:41 -04:00
Dave Reisner
b2226ed11b buildsys: use pkg-config for libcurl detection
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08 18:48:31 -04:00
Dave Reisner
059c572ca5 buildsys: use pkg-config for libarchive detection
This also introduces a versioned dependency of >=2.8.0.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08 18:48:31 -04:00
Dave Reisner
c5d951846d buildsys: use pkg-config for openssl detection
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-08 18:48:31 -04:00
Allan McRae
cb5ae428b6 Check minimum required gpgme version
We use interfaces first introduced in gpgme-1.3.0 so test we have
at least that version.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 11:28:28 -05:00
Allan McRae
b5043dd6c3 Make selecting scriptlet shell work
The initial patch to implement this achieved nothing apart from
adding a configure option.  This patch makes that configure option
do what it advertises.

Note that specifing any shell apart from /bin/sh causes testsuite
failures as /bin/sh is the only shell in the testing environment.

Bug-found-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 11:27:56 -05:00
Dan McGee
4ca6590af5 Merge branch 'maint'
Conflicts:
	lib/libalpm/signing.c
	lib/libalpm/sync.c
2012-04-07 11:23:55 -05:00
Dan McGee
3f1ea8b62f Revert "makepkg: calculate exact total file size"
This reverts commit b264fb9e9d.
With our "fix" of sleeping for BTRFS, we can go back to using `du` to
calculate total installed size.
2012-04-07 11:20:08 -05:00
Dan McGee
b752561a52 4.0.3 release NEWS, version bumps, etc.
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07 11:04:00 -05:00
Dan McGee
8de0631edb Merge branch 'maint'
Conflicts:
	lib/libalpm/be_package.c
2012-03-08 18:08:15 -06:00
Allan McRae
cb64fbeac4 Do not dereference symlinks when calculating size
Passing the "-L" flag to stat means we get the size of the file
being pointed to for symlinks instead of the size of the symlink.

Keep "-L" usage in repo-add as we want the actual size of the
package/delta/signature there.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-03-05 11:44:34 -06:00
Dan McGee
c7321a7b80 Merge branch 'maint'
Conflicts:
	lib/libalpm/sync.c
	src/util/pactree.c
2012-02-13 10:14:06 -06:00
Nathan Phillip Brink
115c0381c2 Use AM_PATH_GPGME macro from gpgme instead of home-built gpgme detection.
Fixes compilation on Gentoo, where CPPFLAGS=-I/usr/include/gpgme is
necessary.

The AC_SYS_LARGEFILE macro call has to be before the GPGME checks,
otherwise the GPGME header gives an error about ABI incompatibilities.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-13 10:07:22 -06: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
Allan McRae
3ba5391839 Allow specifying shell for running scriptlets
Some distributions insist on using bash specific commands in their
install scripts under the assumption that "sh" is a symlink to bash.
This can causes issues if (e.g.) their users what to change sh to
point at another shell, such as dash, that does not support these
features. Add a configure option to explicitly set the shell being
used to run install scripts.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-13 10:02:35 -06:00
Dan McGee
e7bc1e3c9a 4.0.2 release updates
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-02-11 15:24:35 -06:00
Dan McGee
e50c4a8837 Merge branch 'maint'
Conflicts:
	lib/libalpm/diskspace.c
	src/pacman/util.h
2012-01-23 12:20:52 -06:00
Dave Reisner
44f146f232 lib/dload: enforce usage of TCP keepalives
This is particularly important in the case of FTP control connections,
which may be closed by rogue NAT/firewall devices detecting idle
connections on larger transfers which may take 5-10+ minutes.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-23 12:14:58 -06:00
Dan McGee
1eb40c8328 Add diskspace checking support for Solaris/Illumos
Was able to get my hands on one of these boxes today, so add yet another
new way of doing this. I'm glad these calls are so standardized. This
was compile tested on Linux and Illumos and seems to still be working in
both places.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-19 16:28:04 -06:00
Allan McRae
b264fb9e9d makepkg: calculate exact total file size
The current calculation of the total file size for a package using "du"
suffers from issues in portability and correctness.  Especially on btrfs,
this can result in clearly wrong package information such as:

Download Size  : 14684.29 KiB
Installed Size : 7628.00 KiB

Use an approach based on "stat" to calculate total file size.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-28 22:32:22 -06:00
Dan McGee
dacda1f6b3 Make automake generate silent rules by default
This will require you to pass 'V=1' if you want the previous, more
verbose output.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-08 09:15:41 -06:00
Dan McGee
48188fbeee Add 'silent-rules' to automake setup in configure.ac
This is awesome, and I don't know why we haven't already done this. It
gives us the much more less verbose make output in a few different ways:

* If you run `make V=0`, you will get the quiet output.
* If you run `./configure --enable-silent-rules`, the quiet output is
  the default; verbose output can be had by passing V=1 to make.

    make[3]: Entering directory `/home/dmcgee/projects/pacman/lib/libalpm'
      CC     add.lo
      CC     be_local.lo
      CC     be_package.lo
      CC     be_sync.lo
      CC     delta.lo
    .....

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-07 09:59:27 -06:00
Dan McGee
919b604c29 Merge branch 'maint' 2011-11-16 14:51:17 -06:00
Dan McGee
dee8144ce5 Add helper method for creating and opening archive object
This moves the common setup code of about 5 different callers into one
method. Error messages will now be common and shared in all places;
several paths did not have any messages at all before.

In addition, we now pick an ideal block size for the archive read based
off the larger value of our default buffer size or the st.st_blksize
field. For a filesystem such as NFS, this is often much larger than the
default 8192- values such as 32768 and 131072 are common.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-16 14:51:06 -06:00