Commit Graph

2117 Commits

Author SHA1 Message Date
Dan McGee 9c7ebe6872 Remove a bit more download.h pollution
Kill it where it isn't absolutely necessary.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-06 20:28:43 -05:00
Dan McGee 4c872594da Remove unnecessary header file, move one macro to util.c
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-06 20:20:20 -05:00
Dan McGee e4a4cf7ce5 libalpm error cleanup, step 1
Remove unused error codes, begin refactoring some of the others.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-06 20:16:57 -05:00
Dan McGee 4004bf9caf Remove libdownload reference from pacman frontend
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-06 20:02:39 -05:00
Dan McGee 404e0a0e10 Add quiet printout to --owns functionality
If we specify -q/--quiet on an --owns operation, only print a matching
package name rather than the verbose human-readable message.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-06 19:49:41 -05:00
Dan McGee 073bac794d Merge branch 'maint'
Conflicts:

	configure.ac
	contrib/Makefile.am
2008-04-01 22:14:58 -05:00
Dan McGee 0b8abf376f Update NEWS and configure.ac for 3.1.4 release
Also fix a broken contrib/ Makefile, found with make distcheck. I also let
the little translation linebreak update slip in here as it was small enough
not to be a big deal, and this should just prevent it from happening again
later anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-01 22:04:56 -05:00
Dan McGee ab9187d07d Set handle->logstream to null after fclose()
We correctly closed the logfile stream when recalling set_logfile, but did
not NULL out the dead pointer once we did this. Fix the problem which was
the cause of FS#10056.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-01 18:08:58 -05:00
Dan McGee 0bd6fb3bc2 Update -Ss and -Qs pactests to include groups
This update causes query003 to fail before commit
4b8ada818e. Hopefully the issue doesn't crop
up again but we might as well test for it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-30 16:47:27 -05:00
Dan McGee 5f17ac8150 Enable display of multiple groups in -Ss and -Qs output
Not too complicated of a fix, but just adds some code to loop over the
entire group list and space it out.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-30 16:41:13 -05:00
Dan McGee 4b8ada818e Fix segfault on -Qs usage
This segfault creeped in as a result of commit bf867003. We were incorrectly
assuming the group member of our package was a pmgrp_t list when in fact it
is just a string list, which caused a segfault on any -Qs operation.

Also slightly cleanup the -Ss code (which was originally correct unlike the
-Qs code).

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-30 16:36:55 -05:00
Dan McGee 0d1263af26 Merge branch 'maint' 2008-03-30 13:42:24 -05:00
Dan McGee 41c1295559 doc/pacman.8: fix manpage typo
Fix a misspelling and make a clarification while we are at it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-30 13:41:19 -05:00
Dan McGee d9b9e60d7d Fix manpage typo
Noticed in FS#10025.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-30 11:00:53 -05:00
Chantry Xavier 3fe43ffa04 Duplicate the result of archive_entry_pathname.
After the libarchive upgrade from 2.4.12 to 2.4.14, our usage of
archive_entry_pathname became dangerous. We were using the result of that
function even after calls to archive_entry_set_pathname.
With 2.4.14, the entryname becomes wrong after these calls, and so all the
future use of entryname are bogus. entryname is used quite a lot for
logging, so that's not so bad. But it's also used for the backup handling,
so that's not very cool. For example, reinstalling a package with backup
entries will erase all the md5 entries from the DB, because they won't be
found back.

entryname is now a static string so that we can easily keep the result of
archive_entry_pathname.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: fixed version numbers in commit message]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-28 18:32:04 -05:00
Nagy Gabor 562442633a Use pkgcache instead of db_scan in remove.c
This should be a notable speed-up (apart from kernel cache).

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-28 17:53:04 -05:00
Dan McGee d140b440a8 Read .PKGINFO directly from package file
With the addition of the archive_fgets() function, we can now skip the temp
file usage in pkg_load/parse_descfile that was not needed. This has a nice
benefit of probably being both faster, reducing code, and getting rid of
"expensive" file operations.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-27 12:07:32 -05:00
Dan McGee f8c737d3b6 Add an archive_fgets() function
This crude function allows reading from an archive on a line-by-line basis
similar to the familiar fgets() call on a FILE stream. This is the first
step in being able to read DB entries straight from an archive.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-27 12:07:26 -05:00
Dan McGee 1dfd841e40 Make db->treename a pointer
I really don't think we need statically allocated strings here.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-26 20:19:44 -05:00
Dan McGee 5f1ccdbc27 Merge branch 'maint' 2008-03-23 16:58:53 -05:00
Nagy Gabor d1ea16dfd0 Avoid duplicated target names.
This patch should avoid duplicated target names in the backend.
1. sync_loadtarget will return with PM_ERR_TRANS_DUP_TARGET when trying to
add a duplicated target
2. sysupgrade never pulls duplicated targets
3. resolvedeps won't pull duplicated targets anymore

A pulled list was introduced in sync_prepare to improve the
pmsyncpkg_t<->pmpkg_t list conversion by making it more direct.

Also replace sync1005 and sync1006 by the sync1008 pactest, which is
similar but more interesting (the provisions are dependencies instead of
explicit targets).
sync1005 didn't work as expected anyway. It was expecting that pacman
failed, and pacman indeed failed, but not for the good reason. It didn't
fail during the preparation step because of conflicting targets, but during
the commit step, because of a md5 error...
And sync1006 didn't pass and was not really worth fixing. We have already
enough failing pactests more important than these two.
sync1008 pass with this patch.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-23 16:57:14 -05:00
Dan McGee 6104f2e1fb memleak fix: ensure we free result of get_destfile()
In the file:// download case, we didn't free the return from get_destfile()
after we were done with it. Fix it. (Found with xfercommand001.py)

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 16:57:14 -05:00
Dan McGee 1086950c82 memleak fix: ensure backup fname isn't lost if unused
The _alpm_backup_split function always alloced memory for the fname, and we
let it disappear in a specific case (upgrade026.py). Fix the issue.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 16:55:52 -05:00
Dan McGee 7995a25d0e strsplit(): memleak fix
We dup-ed the string but then duped it again. Fix it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 16:55:03 -05:00
Dan McGee bf86700369 Switch pmgrp_t to dynamic allocation, general group cleanup
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 14:51:51 -05:00
Dan McGee 90a48c771d Add -q (quiet) option to valgrind call in pactest
This gets rid of a lot of the unnecessary verbosity in the --valgrind output
when running all the tests. It should also make diff-ing output between test
runs a lot easier.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 14:25:38 -05:00
Dan McGee f7f43dbb48 Update database mtime after it has been extracted
This will reduce the need for running an -Syy if the DB was only
half-extracted, as the mtime won't get updated until the new database is
completely in place.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 14:08:31 -05:00
Chantry Xavier 3d10d460df Add new CleanMethod option.
As it was already mentioned several times, the new -Sc behavior in 3.1 is
great, but only when the package cache is not shared.

This option has two possible values : KeepInstalled and KeepCurrent
With KeepCurrent, -Sc will clean packages that are no longer available in
any sync db, rather than packages that are no longer in the local db. The
resulting behavior should be better for shared cache.

Ref :
http://www.archlinux.org/pipermail/pacman-dev/2008-February/011140.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 13:38:23 -05:00
Chantry Xavier 5af076f09f Kill the dependsonly option.
From the man page :
"This is pretty useless and we're not sure why it even exists."

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-22 18:39:15 +01:00
Dan McGee 2f8fb80ee6 Merge branch 'maint' 2008-03-22 11:11:22 -05:00
Chantry Xavier 7d451b6e6b PKGBUILD.vim: add keepend keyword for sha1/md5 fields
in PKGBUILD.proto, we have the following line
md5sums=() #generate with 'makepkg -g'

if we add a md5sum inside quotes, or even just the quotes :
md5sums=('') #generate with 'makepkg -g'
the highlighting will be totally messed up.

Adding the keepend keyword fixes this.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-22 11:08:23 -05:00
甘露(Lu.Gan) d07001f3ab Updates to Simplified Chinese translation
A little fine tuning, delete some unnecessary space before or after
English word.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-22 11:07:14 -05:00
Chantry Xavier e7a2232934 Kill PM_TRANS_TYPE_ADD.
This was totally useless.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-17 21:01:22 -05:00
Chantry Xavier 73ab153c44 Kill some obsolete references to -A option.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-17 21:00:09 -05:00
Chantry Xavier b3e6cf652c Drop case insensitive comparisons in the config parsing.
These case insensitive comparisons didn't work in some locales, like tr_TR
where upper(i) != I. So a second case sensitive comparison had to be made
for each directive.
Only keeping case sensitive comparisons make the code cleaner and treat all
locales equally.

Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011445.html

Also fix pactests to use the correct case.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-17 20:58:28 -05:00
Chantry Xavier dae3f9deef Add zipman makepkg option.
All other steps in tidy_install function were already controlled by an
option in makepkg.conf, so this patch adds an option for the man page
compression step too.
This will allow to keep man pages uncompressed, which is required for some
special meta man page, like the zshall one (see FS#4580).

Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011472.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-16 23:22:17 +01:00
Nagy Gabor 1f30845e41 Show options in pacman.conf (commented out)
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
2008-03-10 19:39:48 -05:00
Nagy Gabor 35135c0a0c Add -Rss option
* -Rss removes all dependencies (including explicitly installed ones).
* updated documentation
* two pactest files added to test the difference between -Rs and -Rss

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
2008-03-10 19:16:01 -05:00
甘露(Lu.Gan) 6e4b020654 po/zh_CN.po: Chinese Simplified translation update
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-10 19:13:13 -05:00
Chantry Xavier 6820be9ba1 PKGBUILD.vim: improve invalid arch/license detection.
If we had :
arch=(fake)
The fake string would be highlighted because it's invalid.
But if we had :
arch=('fake')
it didn't work.

Fix this for both arch and license arrays.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-10 19:12:20 -05:00
Chantry Xavier 804ab37ea6 Clarify the NoUpgrade and NoExtract behavior.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-10 19:11:38 -05:00
Nagy Gabor d060e31be3 Remove trans->targets
Its implementation was quite broken:
* add_loadtarget() might have silently filtered out some targets when
  replacing an older version.
* This was used in sync.c to determine whether a target is implicit or not,
  which is incorrect behavior. Before this patch we silently removed user
  confirmed replacements; now we always warn on a replacement.
* remove001.py behavior was quite odd in adding same target 5 times to the
  target list, we can change this behavior to be a failure.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
[Xav: changed remove001 pactest accordingly]
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: rewrote commit message]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-10 18:57:36 -05:00
Roman Kyrylych f56f7ff391 makepkg: Support for resuming source downloads
Download to *.part and remove the suffix if successful, thus md5sums will be
checked only for complete files, and next time makepkg will resume
downloading of partial file instead of complaining about invalid md5sums.

Old DLAGENTS format is still supported.

Late fix: Do not try to download %u first

The output of grep was not suppressed, thus the output of get_downloadcmd
was wrong because of extra line at the beginning that contained an
unsubstituted (with %o and %u) entry from DLAGENTS.

Signed-off-by: Roman Kyrylych <roman@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-10 18:45:58 -05:00
Dan McGee 91b7f288fe Merge branch 'maint'
Conflicts:

	configure.ac
2008-03-09 12:03:54 -05:00
Chantry Xavier fc48dc3118 Refactoring of the download code.
This should be the main step in the download refactoring initiated by commit
81a2a06818.
The stub functions introduced by that commit were implemented.

The big download code was mostly composed of two steps, and so it has been
naturally splitted in two functions :  download_external and download_internal

file:/// urls are now handled manually, instead of forcing the use of the
internal downloader.

Thanks to Dan for fixing the remaining issues and cleaning up the patch :)

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-09 12:03:22 -05:00
Chantry Xavier 51e0303e84 Use sigaction instead of signal.
From signal man page :
"The behavior of signal() varies across Unix versions, and has also varied
historically across different versions of Linux. Avoid its use: use
sigaction(2) instead. See Portability below."

The code was taken from there :
http://www.gnu.org/software/libtool/manual/libc/Sigaction-Function-Example.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-09 11:35:01 -05:00
Chantry Xavier 2f9f48eddd src/pacman/pacman.c : split cleanup function.
This function was used in two different ways :
- as a signal handler : the argument was the signal number
- called manually for freeing the resources : the argument was the return
  value
So the first part is now handler(int), and the second cleanup(int).
Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011388.html

Remaining problems :
- the return values are messy. for example, 2 can mean both that it was
  interrupted (SIGINT == 2), or that --help or -V was used (returned by
  parseargs).
- apparently signal is not portable and sigaction should be used instead

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-09 11:30:59 -05:00
Nagy Gabor 1dfcf1495b Remove a bogus comment from libalpm/remove.c
We do the opposite.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
2008-03-09 11:30:01 -05:00
Chantry Xavier 724ed34ac5 rename vimproject to vimprojects and update it.
There is no need to put the list of files in there, which will get outdated
sooner or later. It's possible to generate the filelist in the plugin itself
using \r.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: add scripts/ directory]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-08 21:00:56 -06:00
Dan McGee 74c5bd70cf Remove useless TESTS file
This hasn't been updated in forever, and a simple python program could
regenerate it anyway. Or even grep.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-08 14:37:19 -06:00