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

2898 Commits

Author SHA1 Message Date
Dan McGee
d485c0370f Improve documentation of -k/--dbonly
We had the long option wrong in some places and its behavior wasn't
documented at all with regards to -U/--upgrade.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-05 11:18:27 -05:00
Dan McGee
9528c36452 Add two new pactests for --dbonly
It caught me by surprise that:
1. These weren't being tested at all
2. The --dbonly combined with -U not only "works" but is also completely
   undocumented. It also has some weird behavior on install vs. upgrade that
   may need addressing.

Add some tests which will hopefully provoke some discussion.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-05 11:11:20 -05:00
Nagy Gabor
f9fa822ccb Remove unused 'z' option from getopt_long's optstring
In addition, I permuted shortopts to make it more readable.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-05 10:39:44 -05: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
6b6eb6345b Fix up the cross-compilation patch library lookup
Don't explicitly add things to the list that might not need to be there, and
get the fallback list of libraries correct.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-04 23:43:43 -05:00
Dan McGee
eb6af031ec Build vercmp without needing link to libalpm
Include the object file directly from the libalpm version comparison code as
it is the only thing we need. This drops the dependency of vercmp on
libalpm and all of the stuff we know it drags in.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-04 23:42:01 -05:00
Dan McGee
4f80993933 Remove call to function logger
It isn't really necessary here and it helps us get rid of some link
pollution so we can have a slim vercmp binary.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-04 23:38:52 -05:00
Dan McGee
2a6f3f0652 Move vercmp code into a separate file
This will facilitate using this object file on its own in the vercmp tool
which will be done in a future commit. The net impact on the generated
binaries should not be noticeable after this commit.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-04 23:32:13 -05:00
Dan McGee
8a6bbed98e Update PKGBUILD.proto to include a package() function
Relevant after we deprecated `makepkg -R` without a package() function being
present in the PKGBUILD.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-27 13:08:09 -05:00
Allan McRae
90aca75cb9 makepkg: BSD find compatibility fix
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-26 18:49:28 -05:00
Christophe Chapuis
753599b504 contrib/pactree: generate reverse dependency trees
Add an option to show the tree of packages which depend on a given
package

Signed-off-by: Allan McRae <allan@archlinux.org>
2010-04-26 18:49:11 -05:00
Nagy Gabor
652762488a New pactests for the phonon/qt issue
Original-work-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-26 18:47:56 -05:00
Allan McRae
6995aed9ae makepkg: deprecate repackaging without a package function
File permissions are not guaranteed to stay the same on exit from fakeroot,
so repackaging may result in files with different permissions. This is
avoided when using a package() function (or split packages) as the
packaging step is rerun.

Signed-off-by: Allan McRae <allan@archlinux.org>
[Dan: touched up message for translation purposes]
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-26 18:46:41 -05:00
Serge Ziryukin
7608dd74d7 check for valid optarg before using strdup
Signed-off-by: Serge Ziryukin <ftrvxmtrx@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-26 14:50:31 -05:00
Nagy Gabor
88254d762d Show --print and --print-format options with -Rh, -Sh and -Uh only
http://mailman.archlinux.org/pipermail/pacman-dev/2010-March/010519.html

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-25 21:59:27 -05:00
Xavier Chantry
7965345d43 More consistent printing of off_t and time_t
time_t : %ld
off_t : %jd and cast to intmax_t

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-25 21:58:35 -05:00
Dan McGee
21abae98cb Update -Si docs to reflect new -Sii operation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-25 21:36:30 -05:00
Allan McRae
98ee520907 Sort and avoid duplicates in -Sii output
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-25 21:32:48 -05:00
Allan McRae
526806e7ac alpm_list_diff_sorted - make some arguments const
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-25 21:31:37 -05:00
Matthias Lanzinger
bf7c3eb17f Fix cross-compilation issues with git and libfetch
This patch fixes 2 issues I encountered when cross-compiling pacman.
First is the test for libfetch which requires explicit linking to all
libraries libfetch depends on.

The other problem results from the AC_CHECK_PROGS test for git. This
test will stop configure with an error when cross-compiling.
The fix moves the call to AC_CHECK_PROG so that is only called of
--enable-git is actually set.

Signed-off-by: Matthias Lanzinger <mlaenz@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-25 21:28:01 -05:00
Dan McGee
cdbb90aceb Show 'Required By' in -Sii output
Just as we do in -Qi, we can compute required by information for sync
database packages. The behavior seems sane; for a given package, the -Sii
required by will show all packages in *any* sync database that require it.

Implements FS#16244.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-23 22:24:14 -05:00
Dan McGee
ad4efa539d Strip extension off all package compression types
Since we were searching for '.pkg.tar.gz' before, we now have started to
show extensions during the download when we have a '.pkg.tar.xz' package.
Just look for '.pkg.tar.' (or '.db.tar.') instead and suppress anything
found from that point on.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-18 21:46:03 -05:00
Dan McGee
f6c7de77ed Unbreak the database partial extraction code
Basically I'm the idiot that thought I could make it better and completely
forgot how freeing the contents of the original lists would screw up our
nice little diff extraction lists. This caused segfaults among other
problems. Last time I try to do that...

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff627ce26 in strcmp () from /lib/libc.so.6
(gdb) bt

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-15 23:06:22 -05:00
Dan McGee
a36ff9404b Bump copyright dates to 2010
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 19:46:59 -05:00
Xavier Chantry
1aa1d00248 fix a few warnings reported by clang
- remove unused variables
- some more sanity checks
- safer printf

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 19:25:48 -05:00
Dan McGee
be2f43191d Reduce duplicate code in DB extraction
Follow-up to the previous "Only extract new DB entries" patch; move the
partial extraction code inside one side of the loop so we can use the same
code for actually doing file extraction.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 19:16:26 -05:00
Xavier Chantry
2f4ee4341d Only extract new DB entries
This implements FS#15198. The idea apparently came from Csaba Henk
<csaba-ml <at> creo.hu> which submitted a patch to Frugalware, so thanks to
him, even though I did not look at the code :)

The idea is to only extract folders for new packages into the package
database and clean up the old directories. This is essentially implementing
Xyne's "rebase" script within pacman.

If using -Syy, just remove and extract everything.

If using -Sy :
1. Generate list of directories in DB
2. Generate list of directories in archive
3. Compare both
4. Clean up old directories
5. Extract new directories

Original-work-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
[Dan: fix compile error, s/int/size_t/]
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 19:12:24 -05:00
Dan McGee
69b3a811a1 Mark two functions static
These were just introduced in the `--print` patch, and don't need to be
exposed outside of util.c.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 18:47:40 -05:00
Xavier Chantry
d39b1dbe62 Add new --print operation for all operations
And a new --print-format option to configure the output.

This implements FS#14208

Example usage :
pacman -Sp --print-format "%r/%n-%v : %l [%s]" kdelibs
extra/kdelibs-4.3.2-4 : ftp://mir2.archlinuxfr.org/archlinux/extra/os/i686/kdelibs-4.3.2-4-i686.pkg.tar.gz [0,00]

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 18:44:40 -05:00
Xavier Chantry
67700b926a print installed packages
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 18:41:38 -05:00
Xavier Chantry
e4be3e06af callback: use variable length for progressbar text
This fixes FS#17523

We always used a fixed value of 50 for textlen, which is often not enough
for download progress bar. At least we can use a bigger width on large
terminal (e.g. 60% of width) and keep 50 as minimum.

before:
 nautilus-2.28.4-1-x...     5.7M  789.2K/s 00:00:07 [####################################] 100%
after:
 nautilus-2.28.4-1-x86_64         5.7M  770.7K/s 00:00:08 [##############################] 100%

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 18:39:43 -05:00
Xavier Chantry
e5dce888c0 callback.c : less magic progress bars
1 - Explain magic numbers

2 - There was a weird off by 1 mess in the progress bar. The code supposedly
shared the width between 50 chars for text (textlen) and the rest for the
progress bar (proglen = getcols() - textlen).
But the code actually used textlen + 1 for the text and proglen - 1 for the
progress bar (with haslen=1, the progress bar was actually empty), which was
a bit confusing so I changed it.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 18:39:26 -05:00
Xavier Chantry
087be2f1fb delta : add external cleanup script
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 18:34:42 -05:00
Allan McRae
6f0ffb2386 makepkg: always update symlinks to compressed man pages
When a man page has both symbolic and hard links, any symlink pointing
to other than the alphabetically first hardlink was not "compressed"
and left dangling towards the uncompressed man page. Fixes FS#18569.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 18:34:27 -05:00
Cedric Staniewski
5fe41df8a9 makepkg: make strip options configurable
The newly added variables STRIP_BINARIES, STRIP_SHARED and STRIP_STATIC,
that are set in makepkg.conf, specify the strip options used on binaries
and shared and static libraries.
In addition, files are now stripped more aggressively by default.

Implements FS#13592 the way it was suggested by Allan in the comments.

Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 18:34:16 -05:00
Dan McGee
22331fdadb makepkg: Remove setgid bit on srcdir/pkgdir creation
It was noted in FS#17533 that setgid bits are carried down into any created
subdirectories, and thus could end up being in a built package if the
original package directory was marked g+s. When we create src/ and pkg/,
explicitly chmod them to remove any sticky bits.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2010-03-14 18:32:44 -05:00
Allan McRae
65d43fbb84 makepkg: abort on missing or non-writable PKGDEST
When PKGDEST pointed to a non-writable location, makepkg would fail
after completing the build process. This patch makes it abort as
soon as PKGDEST is parsed.

Also, move the SRCDEST check to the same point rather than right
before downloading sources (which was after dependency checks).

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 18:30:35 -05:00
Allan McRae
a4e3fd1847 makepkg: only strip files that are writable
TODO: http://mailman.archlinux.org/pipermail/pacman-dev/2010-January/010390.html

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 18:30:23 -05:00
Nezmer
de5473c026 makepkg: Add documentation for the new SRCPKGDEST variable
Add SRCPKGDEST documentation to the makepkg.conf man page

Signed-off-by: Nezmer <git@nezmer.info>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-28 23:25:13 -06:00
Cedric Staniewski
eee61a0bbc makepkg: document environment variables PKGDEST and SRCDEST
Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-28 23:25:08 -06:00
Allan McRae
7ea0a115db makepkg: update required programs
Remove getopt, add xz.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-28 23:23:04 -06:00
Cedric Staniewski
1a00ee5c27 bash_completion: remove absolute utility paths again
The location of the used utilities may and does differ between various
distributions and therefore absolute paths do not work well. Since the
main purpose of its introduction was to avoid side-effects caused by
aliases, it is sufficient to disable possible aliases temporarily by
preceding the commands with a backslash.

Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-28 23:19:03 -06:00
Pierre Schmitz
d85421ec62 contrib/*_completion: match *.pkg.tar.*
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-28 23:17:54 -06:00
Allan McRae
afb61bb22a Do not print installed size when only downloading
When using --downloadonly the "Total Installed Size" message is not
needed and perhaps misleading.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-01-19 23:39:22 -06:00
Nagy Gabor
27bc2f7eb8 Print "there is nothing to do" with NOOP transactions
The "local database is up to date" message has been replaced with "there
is nothing to do" message. This used with "empty" -S, -R, -U operations too.
(Examples: pacman -S ignored_pkg, pacman -Ru needed_pkg.)

See FS#17859.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-01-19 22:14:12 -06:00
Dan McGee
0eadc99240 Merge branch 'maint'
Just a slight touchup in makepkg due to the [ -> [[ conversion, so nothing
to see here.

Conflicts:
	scripts/makepkg.sh.in
2010-01-19 22:03:54 -06:00
Dan McGee
8b3f5f0ce6 bash_completion: use absolute paths to utilities
Fixes issues noted in FS#16630.

Signed-off-by: Dan McGee <dan@archlinux.org>
(cherry picked from commit 03f35b1432)

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-01-19 21:58:01 -06:00
Cedric Staniewski
ce9bb994f8 makepkg: fix abortion after sourcing /etc/profile
The source command triggers / might trigger the ERR trap which makes
makepkg abort right after a successful installation of missing
dependencies.

Thanks to Xavier Chantry <shiningxc@gmail.com> for finding this
solution.

Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
(cherry picked from commit 77e84bea71)

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-01-19 21:56:36 -06:00
Allan McRae
0c3f502064 contrib/bacman: fix checking if file has been added
Fixes FS#17140.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
(cherry picked from commit 0199a7ee71)

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-01-19 21:56:00 -06:00
Dan McGee
a12ed63545 NULL out handle after release
We free'd the handle but didn't NULL out the global variable, leading to
problems if you try to reinitialize the library. Make sure we clean up after
ourselves.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-01-19 21:52:54 -06:00