Commit Graph

1315 Commits

Author SHA1 Message Date
Dan McGee 30f53cfe8d Fix double read issue in maint releases
This is essentially a backport/cherry-pick of commit 33240e87b9 from
master, but has to be done by hand because the DB format has diverged. Read
more in the commit message used there, which follows.

Due to the way we funk around with package data loading, we had a condition
where the filelist got doubled up because it was loaded twice.

Packages are originally loaded with INFRQ_BASE. In an upgrade/sync, the
package is checked for file conflicts next, leaving us in an "INFRQ_BASE |
INFRQ_FILES" state. Later, when committing a single package, we have an
explicit call to _alpm_local_db_read() with INFRQ_ALL as the level. Because
the package's level did not match this, we skipped over our previous "does
the incoming level match where I'm at" shortcut, and continued to load
things again, because of a lack of fine-grained checking for each of DESC,
FILES, and INSTALL.

The end result is we loaded the filelist twice, causing our remove logic to
iterate twice over the installed files, spewing a bunch of "cannot find file
X" messages.

Fix the problem by doing a bit more bitmasking logic throughout the load
method, and also fix the sanity check at the beginning of the function- this
should *only* be used for local packages as opposed to the "not a package"
check that was there before.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-12 09:17:22 -06:00
Dan McGee 9e8af82c97 Back out anticipated epoch changes
After all the debate as to what to do on maint, we are going to end up just
incorporating epoch into the version string, so we don't need this separate
field at all. Revert commit 5c8083baa4 and also kill the force flag we were
recording here as well.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-11 23:15:44 -06:00
Jakob Gruber 6ddc115c7f Respect Ignore{Pkg,Group} for group members
Fixes FS#19854.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-30 09:35:03 -06:00
Jakob Gruber df360b791d Move group code to separate function
This makes the following commits more readable.
No logic was changed in this commit.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-30 09:35:03 -06:00
Xavier Chantry 5c8083baa4 be_files: write EPOCH instead of FORCE
This patch is only meant for 3.4.x. It prepares the place for the future
epoch-aware release.

All force packages that get reinstalled or upgraded will get an EPOCH
entry in the local database, and thus the new pacman with epoch won't
reinstall them by mistake on the first -Su.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12 19:45:04 -06:00
Dan McGee eedf4f4e63 Fix possible null pointer deref in check_arch
If we have a corrupted database, a package can come through without an arch,
causing the code to blow up when making strcmp() calls. It might even be
possible with perfectly valid database entries lacking an 'arch =' line.
This behavior was seen as at least one of the problems in FS#21668.

Ensure pkgarch is not null before doing anything further.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-10 19:45:14 -06:00
Xavier Chantry 30734c9a4a alpm/sync: very small memleak fix
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-18 16:50:32 -05:00
Xavier Chantry a2d7f6f206 libalpm/remove: fix funny progress bar problem with empty packages
$ pacman -Rd kde-meta

Remove (15): kde-meta-kdewebdev-4.5-1 [0.00 MB]  kde-meta-kdeutils-4.5-1 [0.00 MB]
             kde-meta-kdetoys-4.5-1 [0.00 MB]  kde-meta-kdesdk-4.5-1 [0.00 MB]
             kde-meta-kdeplasma-addons-4.5-1 [0.00 MB]  kde-meta-kdepim-4.5-1 [0.00 MB]
             kde-meta-kdenetwork-4.5-1 [0.00 MB]  kde-meta-kdemultimedia-4.5-1 [0.00 MB]
             kde-meta-kdegraphics-4.5-1 [0.00 MB]  kde-meta-kdegames-4.5-1 [0.00 MB]
             kde-meta-kdeedu-4.5-1 [0.00 MB]  kde-meta-kdebase-4.5-1 [0.00 MB]
             kde-meta-kdeartwork-4.5-1 [0.00 MB]  kde-meta-kdeadmin-4.5-1 [0.00 MB]
             kde-meta-kdeaccessibility-4.5-1 [0.00 MB]

Total Removed Size:   0.06 MB

Do you want to remove these packages? [Y/n]
( 1/15) removing kde-meta-kdewebdev      [------------------------] 100%
$ it stopped here..

On one side, libalpm did not initialize the progress bar at 0 percent.
So with meta-packages that have 0 files, there was only one progress bar
call with percent == 100.

On the other side, pacman callback kept track of the last percent that
it received. When there are only meta-packages, we always received only
100, so pacman believed the progress bar needed not update. Thus only
the first package was actually displayed.

A proper fix for the callback would be to keep track of last package
name to make sure the recorded prev percent applies.

But since we now specify that both Add and Remove should at least send
percent=0 at beginning and percent=100 at the end, there is no need
for that.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-18 16:46:41 -05:00
Dan McGee 3a06a9fa9f Read 'force' entry from packages
We weren't reading this in from our packages, thus causing us not to write
it out to our local database. Adding this now will help ease the upgrade
path for epoch later and not require reinstallation of all force packages.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11 17:48:11 -05:00
Baurzhan Muftakhidinov e29dde9157 Update Kazakh translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-15 07:19:51 -05:00
Dan McGee 6d41da4086 Minor translation file updates after `make distcheck`
It touched up these a bit after it ran, so might as well check the changes
in so we don't have to deal with them again later.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-03 20:10:10 -05:00
Tobias Eriksson 3739e2c10c libalpm Swedish translation update
Signed-off by: Tobias Eriksson <tobier@tobier.se>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-03 19:55:22 -05:00
Gaspar Santos a7c4159b16 Add new European Portuguese translation
This is being checked in as 'pt' rather than 'pt_PT' as that is what
Transifex seems to want, and it is also the dominant choice of packages
already installed on my system when doing a count of the files located in
the /usr/share/locale translation directories.

Thanks for the new translation!

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-01 21:15:07 -05:00
Jozef Riha 0478dfa1a5 Add Slovak translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-23 21:45:54 -05:00
Mateusz Herych c3f5375380 Updates for Polish translations
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-18 13:11:28 -05:00
Baurzhan Muftakhidinov 0d6efb35ce Small fix to Kazakh translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-27 10:14:35 -05:00
Dan McGee fa4f25626c Mark sync_pkg and sync_target as static functions
We no longer use these anywhere outside of sync.c, so do the rename and add
static to their definition to meet our coding standards.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-27 10:10:55 -05:00
Dan McGee f8d7cd6b26 Maintain a list of seen packages when installing a group
As reported in FS#20221, we don't always do the right thing when installing
a group and using the --needed option. This was due to the code pulling
packages based on what was already in the transaction's add list, but
completely ignoring the fact that we may have already seen and skipped this
same package in an earlier repository.

Add a list to the private _alpm_sync_pkg() function that allows us to have
this extra information so we don't mistakenly downgrade a package when using
--needed.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-27 10:10:55 -05:00
Dan McGee 6c00ca8f23 Handle sync target + ignore properly
Rather than say we can't find the target after saying "No, I guess I don't
want to install this", we should make sure the ignored status gets passed
all the way through. This fixes FS#19866.

Pactest is also included that failed before due to the fact that we normally
treat an unfound package as a reason to exit with a non-zero status.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-20 15:19:19 -05:00
Ionuț Bîru c355d2a3b7 Update Romanian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-14 12:18:01 -05:00
Leandro Inácio 6e31ddf42e Revise Portuguese (Brazil) translation
Fix the '\t' characters that got introduced by the last update of this
translation that should not have been there.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-14 12:08:28 -05:00
Manuel Tortosa 8fbc91e693 Updating Catalan translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-14 12:02:07 -05:00
Juan Pablo González T fe7b77cd8a Update Spanish translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-14 11:00:20 -05:00
Roman Kyrylych ea7696b441 Update Ukrainian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-14 10:29:57 -05:00
Leandro Inácio 6297248087 Update Portuguese (Brazil) translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-11 19:01:46 -05:00
Dan McGee 5f5b6f16af translations: rename Norwegian translation from nb_NO to nb
This puts us more in line with other projects that don't attach the country
code to the language code.

$ du -sh /usr/share/locale/nb*/LC_MESSAGES
3.5M    /usr/share/locale/nb/LC_MESSAGES
132K    /usr/share/locale/nb_NO/LC_MESSAGES

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-11 10:05:45 -05:00
Dan McGee f9c70d3140 translations: rename Swedish translation from sv_SE to sv
This puts us more in line with other projects that don't attach the country
code to the language code.

$ du -sh /usr/share/locale/sv*/LC_MESSAGES
7.2M    /usr/share/locale/sv/LC_MESSAGES
60K     /usr/share/locale/sv_SE/LC_MESSAGES

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-11 09:57:12 -05:00
Christos Nouskas d978039cf0 Revise Greek translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-09 15:16:59 -05:00
Dan McGee 8163beb622 Update English (British) translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-07 20:17:14 -05:00
Matthias Gorissen b00d911331 Update German translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-07 15:08:43 -05:00
Sergey Tereschenko 982018bf74 Update Russian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-07 12:24:48 -05:00
Dan McGee 93def410b8 Add note about XySSL/PolarSSL name change
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-07 10:35:08 -05:00
Baurzhan Muftakhidinov 9a56830164 Update Kazakh translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-07 09:30:39 -05:00
Xavier Chantry 3012c0e091 Update French translation
Thanks to CalimeroTeknik <calimeroteknik@free.fr> for providing many
corrections !

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-06 16:42:01 -05:00
Christos Nouskas b79193a37e Update Greek translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-06 16:41:35 -05:00
Vojtěch Gondžala d58f398312 Update Czech translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-05 11:40:42 -05:00
Nagy Gabor c80e04a151 Update Hungarian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-05 11:34:31 -05:00
Giovanni Scafora a3b1585b7b Update Italian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-05 11:30:51 -05:00
甘露(Gan Lu) a66f8dbbb1 Update Chinese translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-05 11:27:45 -05:00
Samed Beyribey 10aba2fd53 Update Turkish translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-04 19:44:33 -05:00
Dan McGee f60db581a7 translation: update pot/po files for libalpm in prep for release
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-04 13:36:38 -05:00
Jonathan Conder 9ab6bfad22 fix memory leak in _alpm_sync_commit
Signed-off-by: Jonathan Conder <j@skurvy.no-ip.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-18 11:51:31 -05:00
Nagy Gabor eada558e12 Partial fix for the phonon/qt issue
This patch fixes the phonon/qt issue, if all to-be-upgraded packages are
explicit targets (ie. only not-yet-installed packages are pulled by
resolvedeps). This condition covers the most common situations, for example
it should hold with every -Su operation.

After this patch sync405.py passes, but sync406.py doesn't.

The work is inspired by the patch of Henning Garus, thanks for his work:
http://mailman.archlinux.org/pipermail/pacman-dev/2010-February/010429.html
(I moved the alpm_list_diff computation to sync.c in order to compute it
only once.)

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-18 11:33:00 -05:00
Nagy Gabor 25cd6c2e8d Fix a serious bug in the download code
After commit df99495b82 pacman downloaded files from the first repo only,
and reported corrupted packages for all files from other repos.

The download_size was set to 0 for _all_ transaction packages after
downloading some files from the first repo. This code-block was moved to its
correct place.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-14 15:03:21 -05:00
Jonathan Conder df99495b82 Compute package download size outside _alpm_sync_prepare
And add a new info level for this piece of data.

Signed-off-by: Jonathan Conder <j@skurvy.no-ip.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-05 18:15:52 -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 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
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
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