Commit Graph

962 Commits

Author SHA1 Message Date
Dan McGee ca1a187131 More cleanup to alpm_list
* Remove some #include statements that are not strictly necessary
* Remove node_new function that is really just a one-liner

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-24 18:07:44 -06:00
Nagy Gabor 8cfccf68c1 alpm_list.c clean-up
* Introduces 'list == NULL' convention for empty list. That means
alpm_list_new isn't needed anymore, so kill it

* Small straightforward fixes in alpm_list.c

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-25 00:52:58 +01:00
Chantry Xavier d5857ee15b libalpm/sync.c : fix poorly worded debug message.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-25 00:30:21 +01:00
Dan McGee 3ad3077d8d Merge branch 'maint'
Conflicts:

	src/pacman/callback.c
2008-02-24 01:22:07 -06:00
Sergey Tereschenko 105e01c8ef Update Russian translation
Some corrections from the previous translation.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-24 00:44:35 -06:00
甘露(Lu.Gan) 731a774319 Add new Simplified Chinese translation
Thanks a lot! Now we get to fix the breakage this causes in output messages.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-22 08:24:08 -06:00
Dan McGee 4bd52f3fe4 Merge branch 'maint'
Remove gettext() function addition from gensync and updatesync in master as
gettext is no longer used in them anyway.
2008-02-20 18:58:04 -06:00
Mateusz Herych 5676dbae4d Final updates to Polish translation
Good job on the group effort guys, thanks for getting this one complete.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-19 08:41:05 -06:00
Sergey Tereschenko 848edb2f38 Update libalpm russian translation.
Cleaned up by Oleg Finkelshteyn.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-18 12:53:30 -06:00
Allan McRae b091ccc400 Do not warn about up to date package when downloading only
Stops the "<pkg> is up to date -- reinstalling" message when using the
download only flag.
Ref: http://archlinux.org/pipermail/pacman-dev/2008-January/010952.html

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-18 00:18:43 -06:00
Dan McGee 92ab7c33fb Move pmgraph_t struct and functions to their own header file
This will allow us to utilize this helpful type and functions in places
besides dependency calculations. In addition, remove the public declaration
of pmgraph_t in alpm.h- there is zero need to expose this internal type.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-16 11:58:49 -06:00
Dan McGee 6b07b5d345 Merge branch 'maint'
Conflicts:

	lib/libalpm/be_files.c
	lib/libalpm/package.c
2008-02-15 19:40:22 -06:00
Matthias Gorissen be95e4d8a0 More small updates to German translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-15 16:07:28 -06:00
Dan McGee 59a6b519da Merge branch 'translations' into maint 2008-02-14 21:22:27 -06:00
Dan McGee b206aaee88 Ensure DESC infolevel is loaded before checking pkg->filename
This is the first step of fixing FS#9547. This should not break any existing
code that may rely on this function behaving the way it did, and should be
good for inclusion in a maint release.

In addition, update pactest so it fills the FILENAME field in the DB entries
it creates so we can move forward with a real fix to this issue.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-13 22:52:53 -06:00
Vojtěch Gondžala 706c690b64 Updated Czech translation for 3.1.2 release
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-02-12 23:05:33 +01:00
Chantry Xavier 279fbc44b1 Update french translation.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-02-12 12:17:20 +01:00
Dan McGee 9bf487b2ff Move some translations to their generic language code
For our Czech, Polish, and Russian translations, they do not need to be at
the more specific 'lang_COUNTRY' code, but can live at just plain 'lang'.
This follows the pattern of most other translated programs out there as
Roman pointed out on IRC.

ru_RU: 2 (pacman and libalpm)
ru: 128 for him, 131 for me (everything else)

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-11 20:40:44 -06:00
Dan McGee fbf3beb8d2 ensure chk_fileconflicts reads entire file list
If the end of the pB list was reached before the end of pA, we failed to
read any remaining files from the pA list. Add an additional loop to ensure
all entries of pA are added to the return list regardless of whether we have
reached the end of pB.

This new loop also eliminates the now-unnecessary check for a null pB, as we
need to ensure we are excluding directories in the resulting output anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-11 20:40:43 -06:00
Dan McGee bfc024eab3 Merge branch 'maint' 2008-02-07 20:16:16 -06:00
Nagy Gabor 77c3cf9790 Remove alpm_sync_get_newversion function
sync->newversion shouldn't be public at all, and internally we access it directly.
(Before pmsyncpkg_t clean-up the analogue of this field [type] was needed in replaces computation.)

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-07 20:15:30 -06:00
Nagy Gabor 7dc37109b0 alpm_sync_sysupgrade split
This patch indroduces a new public alpm_sync_newversion, which scans for new
version of a package in sync repos.
Hopefully this will reduce code duplication in the future:
* check-for-pacman-new-version from front-end can be easier
* -Qu refactoring

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-07 20:15:23 -06:00
Chantry Xavier 0c2206f542 libalpm/add.c : safety check for fixing FS#9235.
Fixes FS#9235.

We already had the following case in extract_single_file :
/* cases 1,2,3: couldn't stat an existing file, skip all backup checks */

But we actually only did a lstat here. And if lstat worked, we did a stat
without checking.
When lstat works and stat fails, it means we have a broken symlink, like in
FS#9235. We can actually treat this case like a non-existing file.
The broken symlink will then be simply overwritten.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-07 14:58:23 +01:00
Nagy Gabor 05d5634958 libalpm/package.c : add _alpm_pkgname_pkg_cmp function.
_alpm_pkgname_pkg_cmp(pkgname, pkg) returns true iff pkg's name is pkgname.
This is useful if you want to remove a package from pmpkg_t* list, and you
want to search for package name.

This allows cleaning the -Ru code a bit, by removing the need of a dummy
pkg.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-06 08:46:15 +01:00
Nagy Gabor e63366ae5e New remove option : -u / --unneeded (FS#6505).
With --unneeded option 'pacman -R' doesn't stop in case of dependency error;
it removes the needed-dependency targets from the target-list instead.  See
also: http://archlinux.org/pipermail/pacman-dev/2007-October/009653.html .

The patch also adds a new causingpkg field to pmdepmissing_t which indicates
the to-be-removed package which would cause a dependency break. This is
needed, because miss->depend.name may be a provision. miss->causingpkg will
be useful in -R dependency error messages too.

[Xavier: renamed inducer to causingpkg, removed the _alpm_pkgname_pkg_cmp
helper function as requested by Aaron. This might be added by a further
commit.  Other small cleanups, updated manpage and bash completion.]

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-06 08:46:15 +01:00
Nagy Gabor 1fc83f4af6 pmsyncpkg_t cleanup
Fix for sync044.py and reason001.py.
Rename sync->data to sync->removes (alpm_list_t *)
Replace pmsynctype_t sync->type by pmpkgreason_t sync->newreason

The type field was set to UPGRADE or DEPEND or REPLACE.
Instead of using type = UPGRADE or DEPEND, we now rather use a
"pmpkgreason_t newreason" field directly (= explicit or depend) which allows
a better handling of the install reason.
And the REPLACE type is now deduced implicitly when the sync->removes list
is not empty.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-27 12:05:33 -06:00
Nagy Gabor 9bfbd73917 Fix PM_ERR_CONFLICTING_DEPS handling in sync.c
* eliminate asymmetry (innerconflict vs. outerconflict)
* fix a memleak (in case of PM_ERR_MEMORY deps wasn't freed)
* fix wrong pmconflict_t duplication (*retconflict = *conflict)

Note: the new code introduces some code duplication which shall disappear by
fixing FS#7524.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-27 11:54:35 -06:00
Nagy Gabor ea828b5693 New _alpm_conflict_dup function
Added function to cleanly duplicate a conflict.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-27 11:54:25 -06:00
Nagy Gabor f432ce41e0 small sync.c code clean-up
Remove unnecessary synclist_free function, and use our standard way
(alpm_list_free_inner + alpm_list_free) instead.
This slightly reduces code duplication.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-27 11:52:46 -06:00
Chantry Xavier 88cbee3c24 libalpm/sync.c : conflicts resolving cleanup.
The original patch from Nagy tried to resolve target vs target conflicts,
and so broke the following pactests : sync040, sync041 and sync990

Nagy's proposal to solve this situation was to choose the interactive way,
ask the user how to deal with it: either remove pkg1 or remove pkg2 or stop
here.  So he left this as a TODO.

But instead of trying to resolve these conflicts or asking the user, I
tried to find a more conservative way, looking at what the current pactests
expected:
If between the two conflicting packages, one provides the other, pacman
will keep that one and remove the other from the target list.  That breaks
sync893 and sync897. But Dan agreed these two looked weird and should be
changed.

This commit should close FS#8897, FS#8899 and FS#9024.

Reference:
http://www.archlinux.org/pipermail/pacman-dev/2007-October/009745.html
http://www.archlinux.org/pipermail/pacman-dev/2007-December/010393.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-23 20:13:01 -06:00
Dan McGee 69c6d59bb6 Fix flip-flopped parameters to CALLOC macro
The mixup causes a fail in the build using --enable-debug on x86_64 but not
i686, so none of us caught this right away. Fix it. FS#9297.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-23 20:13:01 -06:00
Chantry Xavier 8240da6cb3 libalpm/cache.c : don't duplicate packages in pkgcache.
Edit _alpm_db_add_pkgincache to not duplicate packages, because this is not
needed, is slower, and uses more memory. This made the max memory usage
during base reinstall go from 10.4MB to 9.7MB.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-23 20:13:01 -06:00
Chantry Xavier 22c900e7d5 Add new public alpm_checkdbconflicts function.
This function has a limited purpose, but might be interesting to do a
sanity check from a frontend (eg testdb).

Also removed the private _alpm_checkconflicts function to avoid confusion.
This function was used only once in libalpm, in sync.c, and was just a
single line anyway. Having to do it manually makes it explicit that we are
looking for two kind of conflicts (targ vs targ and db vs targ).

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-23 20:12:41 -06:00
Chantry Xavier 6b8f404a33 small memleak fix in sync.c.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-23 19:52:16 -06:00
Dan McGee 9247ddbe8a conflict.c: move debug message out of inner loop
We have a debug message in the target vs. target file conflict check, and
this is a bit rediculous when it comes to watching output from something
like smoke001.py. Instead, put the output outside this inner loop so we only
see it at most once per target, which is much more reasonable.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-21 19:44:10 -06:00
Dan McGee 36264a3ab9 Fix memleak found by add004.py
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-21 19:44:02 -06:00
Nagy Gabor 2a7101c049 New --asexplicit option
This is the symmetric of --asdeps, install packages explicitly.
Documentation and completion files were updated accordingly.
Added sync301.py and upgrade032.py pactest files to test this.

I also made a little modification in ALLDEPS handling too.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-21 19:39:26 -06:00
Chantry Xavier b2914bf0af Move the deptest code from frontend to backend.
The deptest code (pacman -T) used by makepkg was mostly in the frontend.
There were 2 drawbacks:
1) the public splitdep function returns a pmdepend_t struct, but the
_alpm_dep_free function for freeing it is private. So there was a memleak.
2) there is a helper in the backend (satisfycmp in deps.c) which makes this
function much easier.

So this adds a new public alpm_deptest in libalpm/deps.c, which cleans
pacman_deptest in pacman/deptest.c a lot.
Besides, alpm_splitdep was made private, because the frontend no longer
requires it, and _alpm_dep_free is also private.
Finally the deptest001 pactest was extended.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-21 19:35:43 -06:00
Dan McGee 927af790ee Convert deltas to dynamic allocation
Another elimination of a static length structure in libalpm. Should result
in a little more memory saved during execution of packages with lots of
deltas attached.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-21 19:33:32 -06:00
Dan McGee f6785dcb89 Merge branch 'maint' 2008-01-18 19:33:25 -06:00
João Felipe Santos f374ead66a Portuguese Brazilian translation update for pacman 3.1.1
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-01-19 00:00:50 +01:00
Matthias Gorissen 8343121f87 Corrections of German translation
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-01-18 00:16:09 +01:00
Juan Pablo Gonzalez 6f181c22d2 Spanish translation update for pacman 3.1.1
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-01-16 23:54:34 +01:00
Vojtěch Gondžala de5e49f4be Czech translation update for pacman 3.1.1
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-01-16 17:19:50 +01:00
Jeff Bailes 601f6a8a29 English (British) translation update for pacman 3.1.1
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-01-16 17:14:50 +01:00
Nagy Gabor d9a9ffd77d Hungarian translation update for pacman 3.1.1
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-01-16 17:11:44 +01:00
Dan McGee db557e0563 Update message files for 3.1.1 release
We are in string freeze for the 3.1.1 release. This commit updates all the
message files to the latest code, and all translation updates should be
based off of these po-files. Please attempt to keep the line number changes
to a minimum- there should be no reason to update these po files with just
new line numbers. That way we can more easily see exactly which translations
were updated.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-14 23:16:16 -06:00
Dan McGee 38e981fab3 Merge branch 'maint' 2008-01-14 22:58:44 -06:00
Chantry Xavier 0c5b68877b Change the versioned provision format.
Change the 'provname provver' format to 'provname=provver'.
In .PKGINFO, the provisions are copied from the PKGBUILD without quotes. So
the provision version was actually handled as a different provision...

See FS#9171.

Dan: Unfortunately we have to change our original specification for
versioned provisions with this patch, but it ends up being the simpler and
cleaner solution in the long run, and if there is any time to change it the
time is now before many packages have been built. Keeping the ' ' based
format would have required us to do special parsing in repo-add, as well as
being susceptible to users not using quotes in their provides array.

Hopefully this will resolve the issues we had with our initial plan. Sorry
for the confusion.

Acked-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-14 22:03:03 -06:00
Jaroslaw Swierczynski 801a268056 FS#9183 : force correct permissions on tmp/.
[Xav: removed unneeded makepath_internal function, and fixed the permission
value : 1777 -> 01777]
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-13 18:42:26 -06:00
Chantry Xavier 8186dc11a9 Ensure correct dir permissions in the database.
Fix for FS#9176.
A previous commit (6e8daa553b) already forced all database files to 644.
Now the directories are also forced to 755.

Additionally, repo-add now sets the umask to 022, just like makepkg does, to
fix the problem at its root.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-13 12:51:37 -06:00
Dan McGee 521de7ceed Merge branch 'maint' 2008-01-13 12:27:17 -06:00
Chantry Xavier ab506f77c0 util.c : fix segfault when the cachedir isn't usable.
For example, if the cachedir is a broken symlink or a non writable
directory, pacman fallbacks to /tmp/. Just before doing that, it freed the
handle->cachedirs list twice !
once in _alpm_filecache_setup, and once in alpm_option_set_cachedirs. So the
first one was removed.

Fixes FS#9186.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-13 12:21:21 -06:00
Dan McGee 4f26701793 memleak fix with new dynamic depend structure
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-12 20:18:20 -06:00
Chantry Xavier 435ec29bc7 libalpm/sync.c: don't duplicate packages for the sync->data field.
Packages put in the sync->data field were always duplicated with pkg_dup,
and then freed, This is not needed.
Killing this duplication of packages made the memory usage during base
reinstall go from 10.4 MB to 8.1 MB.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-12 17:51:29 -06:00
Nagy Gabor 633dbeac88 small checkdeps speed-up
In the old code 'alpm_list_diff(_alpm_db_get_pkgcache(db), dblist,
_alpm_pkg_cmp);' was slow.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>

[Xav: In my opinion, computing both dblist and modified in one for loop also makes
the code clearer, besides being more efficient.
Also renamed joined to targets since I also find that clearer.]

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-12 11:05:52 -06:00
Chantry Xavier e654236db6 don't send CHECKDEPS_DONE event when NODEPS is set.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-12 10:45:45 -06:00
Aaron Griffin 26f4993e1d Store replaces in the local DB too
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
[Dan: might as well store 'force' too]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-12 01:33:57 -06:00
Dan McGee 2630556bde Merge branch 'maint' 2008-01-11 23:19:52 -06:00
Dan McGee 3e133524a5 Add functions to manipulate pmdepend_t objects
We didn't have a free function before, causing some memory leaks. We also
need a dup function now that strings are not in the structure but are
dynamically allocated.

Also adapt pmdepmissing_t to use a pointer to a depend struct instead of an
inclusive one so we can use the functions we created here.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-11 22:58:05 -06:00
Allan McRae 8372a9e8c7 Only notify of dependency check in removal if performed
Moves "checking dependencies..." notification into code block where
dependency checking is performed to stop spurious notification.
Reference: http://archlinux.org/pipermail/pacman-dev/2008-January/010714.html

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-11 19:29:49 -06:00
Dan McGee f9a7d8cba4 Fix library interface
Two functions defined in alpm.h were not marked with SYMEXPORT, causing
linking errors if they were used.

In addition, remove the incorrect use of the 'alpm_' prefix from an internal
function and replace it with '_alpm_'.

Fixes FS#9155.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-11 08:43:10 -06:00
Dan McGee ccc1c73152 Use dynamic string allocation in package structures
This also affects all structures with static strings, such as depmiss,
conflict, etc. This should help a lot with memory usage, and hopefully make
things a bit more "idiot proof".

Currently our pactest pass/fail rate is identical before and after this
patch. This is not to say it is a perfect patch- I have yet to pull valgrind
out. However, this should be quite safe to use in all situations from here
on out, and we can start plugging the memleaks.

Original-work-by: Aaron Griffin <aaronmgriffin@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-11 00:01:58 -06:00
Chantry Xavier 47761d5aec Move the fallback on providers from backend to frontend.
This reverts commit e28973169d.
This code might fit better in the frontend than in the backend finally.
Ref: http://www.archlinux.org/pipermail/pacman-dev/2007-November/010150.html

I also changed it for fixing FS#8763 :
if there is exactly one provider, pacman will pull it and print a warning.
if there are several providers, pacman will list them and fail. It's up to
the user to pick one. Add sync501 pactest to reflect that.
2008-01-09 18:33:11 -06:00
Dan McGee 9dd016001e Remove upgradedelay and all code associated with it
It wasn't even implemented correctly, and it really doesn't have a use if
packagers just do their job correctly anyway for a distro. Let's not try to
solve a problem with the wrong solution now.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-08 15:49:52 -06:00
Dan McGee a24c323aba Remove unused date element from pmpkg_t struct
We had an unused date element in the pmpkg_t struct (not builddate or
installdate). Kill it off and fix the one function that was using it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-08 13:29:41 -06:00
Chantry Xavier a71f4c4c6a conflict.c : fix for FS#8156, detect conflict between symlink and dir.
The previous fileconflict check (package vs filesystem) skipped the conflict
when the file on the filesystem was a directory or a symlink to a directory,
no matter what the file in the package was.
Now, the conflict will only be skipped if the file in the package is a
directory (so compatible with a dir or a dir symlink on the filesystem).

So in the case of 8156 (new fileconflict003 pactest for this case), instead
of silently ignoring the extraction of the test symlink, pacman will now
fail because of a file conflict between the test symlink in the pkg2 package
and the test directory on the filesystem.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-06 10:59:41 +01:00
Dan McGee 1a0aaa20df Don't stat cachedir immediately
By attempting to stat the cachedir when we load the pacman config, pacman
bails out if it is a non-existant directory, even if it will never be
needed. This is unfortunate as it is only used for sync transactions anyway.
Instead, wait until we need it in _alpm_filecache_setup to actually do
anything.

Reported as FS#9096.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-05 17:39:38 -06:00
Dan McGee 5aa873edb6 sync.c: add sanity check so we don't dereference a null pointer
Originally noticed in FS#9024, but was fixed in previous changes anyway.
However, it doesn't hurt to still check it.

Also add a pactest from Chantry Xavier for the original problem to ensure
we can't reproduce it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-05 17:35:43 -06:00
Chantry Xavier 85a8b150ed conflict.c : fix for upgrade042.
Thanks to the proactive backup handling, we don't need to add the moving
file to the skip_add list.
The backup handling will make sure nothing gets overwritten.

Ref: http://www.archlinux.org/pipermail/pacman-dev/2007-December/010610.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-05 16:49:09 -06:00
Chantry Xavier 601a85082d add.c : fix upgrade026 pactest.
This was the case of the bash packaging error where a file was removed from
the package but not the backup array.
I just added a sanity check so that only the files from the backup array
that are also in the filelist are used.

I had to edit upgrade026 pactest slightly : it required the file to be
copied to .pacsave instead of moved. But just moving it should be enough, as
we agreed on the ML :
http://www.archlinux.org/pipermail/pacman-dev/2007-December/010440.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-05 13:47:49 -06:00
Matthias Gorissen 04472f925a Update of German translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-05 13:47:35 -06:00
Dan McGee c18191ba5b Small code cleanups with indents/spaces
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-01 20:03:24 -06:00
Dan McGee 4abd710ec9 Remove gettext calls from debug-level messages
These used FUNCTION output level and not DEBUG, so I didn't catch them way
back when I removed those gettext calls. Remove them now (which exposed a
nice little memory access error elsewhere in the code). This should have a
slight speedup effect on the code too as we no longer have to make the
gettext call even when these messages aren't printed.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-01 20:03:24 -06:00
Dan McGee 553ce8323c Fix another usage of pkg_new in _alpm_sync_addtarget
Use _alpm_pkg_dup instead.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-01 20:03:24 -06:00
Dan McGee d18686a563 Switch pkg_new -> pkg_dup in find_replacements
Ugh, it was a pain to figure out why the Total Removed Size was showing up
wrong in the output of removed packages, but this was why- we used a stupid
_alpm_pkg_new call instead of just duping the package. Fix this. In the long
run, we really need to figure out better ways to not duplicate all this
package information.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-01 20:03:24 -06:00
Chantry Xavier ac0605b9c2 new upgade042 pactest + bugfix in chk_filedifference.
This adds a pactest for the relocation of a config file between two packages
(case of etc/profile moving from bash to filesystem).
While running this pactest, I found out that chk_filedifference didn't work
correctly with an empty list as second argument. So that's fixed now.

Ref: http://www.archlinux.org/pipermail/pacman-dev/2007-December/010610.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-01 20:03:18 -06:00
Dan McGee fbd88a8212 Remove .FILELIST generation from makepkg (and elsewhere)
This is something pacman can do on its own straight from the archive, and we
will reduce the chance of problems occurring becuase of inproper FILELIST
generation as we have had in the past with special characters in filenames.

Once we remove it from makepkg. we can remove any usage of it from all of
our other tools, including pacman, pactest, and contrib/ utilities.

Note that removing it from pacman uncovered a few other bugs anyway, so this
was probably a good move.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-29 11:58:23 -06:00
Chantry Xavier 01930400a5 add a new upgrade026 pactest for backup handling.
This is the bash case when the /etc/profile file was removed by error from
the package, but stayed in the backup array.

Ref:
http://www.archlinux.org/pipermail/arch-dev-public/2007-December/003556.html

Also fixed a little typo in add.c, but it's disabled code.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-12-29 11:17:20 -06:00
Chantry Xavier c913c53322 libalpm/add.c: disable buggy backup handling code that didn't do anything.
As I mentioned earlier on the ML :
http://www.archlinux.org/pipermail/pacman-dev/2007-December/010416.html
the first part of commit 843d368ef6 had no effect because of a bug.

So I fixed the bug, but since this would change backup handling behavior,
and possibly require other bigger changes to work right, I decided to just
disable that part temporarily, and left a TODO in the code.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-28 19:57:11 -06:00
Chantry Xavier 630541a72e french translation : one broken message caused a segfault.
pacman segfaulted on sync012 pactest because of one broken translation.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-12-28 19:56:14 -06:00
Chantry Xavier 457692b928 libalpm/remove.c : switch back to lstat usage.
commit b55abdce7a changed every instance of lstat to alpm_stat to remove an
eventual trailing /, but in remove.c, this is not wanted.

Ref: http://www.archlinux.org/pipermail/pacman-dev/2007-December/010451.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-28 19:55:38 -06:00
Allan McRae 14d6832ef2 Allow NULL parameter in alpm_trans_commit
Fixes FS#7380: alpm crashes on passing NULL to alpm_trans_commit in
a sync operation.  Adds check that data parameter is not NULL in
several functions.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
[Dan: fix whitespace]
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-28 19:46:21 -06:00
Allan McRae cca4ec647e Add remove counterparts to alpm_option_add_* functions
Fixes FS#7428. Added functions to remove cachedir, noupgrade, noextract,
ignorepkg, holdpkg and ignoregrp.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
[Dan: fix whitespace]
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-28 19:43:59 -06:00
Nathan Jones 7fdb2ee48a Check ignored packages in _alpm_sync_addtarget().
This will allow someone to install a group but ignore individual
packages inside the group.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-21 11:09:24 -06:00
Nathan Jones b43301428e Fix memory leak in shortest_delta_path.
It is possible for the if statement to never succeed, causing path to
never be freed. It is also possible for the if statement to succeed more
than once per loop, which could have caused a segfault.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-21 11:08:05 -06:00
Vojtěch Gondžala 9a6582a8fd Add new Czech translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-21 11:05:44 -06:00
Chantry Xavier 020629a371 Finish french translation.
It's probably far from perfect, but at least I tried to translate
everything.
I noticed a missing newline at libalpm/trans.c , line 573 :
_alpm_log(PM_LOG_ERROR, _("call to popen failed (%s)"),

I don't think it's possible to fix it now (string freeze?), so I didn't.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-12-21 11:05:44 -06:00
Nagy Gabor c0845db8f7 Updated Hungarian translation
1 untranslated message translated and 1 message fixed

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-20 08:05:54 -06:00
Nagy Gabor 13dd2864ca PM_DEP_MOD_LT and PM_DEP_MOD_GT depmods added
You can use foo<2.0 and foo>2.0 as depend
add046.py and add047.py pactests were added to check this

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-19 14:48:05 -06:00
Nagy Gabor 47f4c5a480 Updated Hungarian translation
* Updated libalpm translation
* Regenerated hu.po files, because the 'call-for-translators version' was outdated

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-19 13:30:04 -06:00
Giovanni Scafora 16ed9ad19b Updated Italian Translation
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>

	modified:   lib/libalpm/po/it.po
	modified:   po/it.po
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-18 18:27:23 -06:00
Giovanni Scafora a11b2065af Updated Italian Translation for pacman 3.1
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-17 20:43:12 -06:00
Dan McGee ce424a356f Check for errors on descfile extraction
If /tmp was full during the early stages of package extraction, we were
unable to extract the package description file with the call to
archive_read_data_into_fd(archive, fd) becuase we never checked the return
code. Add a check to ensure the extraction was successful and print and
return an error if it was not instead of falling through to a possibly
untrue error message.

This should fix FS #8885.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-16 22:45:57 -06:00
Aaron Griffin 9558639d80 popen does NOT require /bin/sh in a subchroot
I appears that when chrooted, the /bin/sh used by popen is that of the parent
process. This is true until the process forks once chrooted, which we do not
want to do.

As such, this actually makes things nicer. We don't need a /bin/sh in a chroot
to run install scriptlets, and don't need to check for it in the root directory

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-10 23:03:16 -06:00
Aaron Griffin 565d2eeed5 Correct scriptlet usage pattern
The new pattern is as follows:
    . /path/to/scriptlet
    post_upgrade X Y

This requires less frameworking in the install scripts (the three lines that
shift and eval a function are nasty)

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-10 23:02:07 -06:00
Dan McGee 9781d0d637 Update GNU GPL boilerplate and copyright dates
Update the GPL boilerplate to direct people to the GNU website for a copy of
the license, as well as bump all of Judd's copyrights to 2007.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-10 22:55:39 -06:00
Dan McGee 7249c08bdf Improve changelog handling through addition of open/read/close functions
Thanks to Allan for inspiring all this work on what was one little TODO item
in the codebase. :)

Change changelog handling so we can now dump a changelog from both installed
packages and package files (fixes FS#7371). We do this by moving all of the
machinery to the backend where it should have been in the first place.

The changelog reading is now done through a open/read/close interface
similar to the fopen/fread/fclose functions (can you guess how it is done?).
It is buffered by the frontend, so programs using the library can read as
much or as little as they want at a time.

Unfortunately, I could not implement a changelog_feof function due to some
shortcomings of libarchive. However, I left the stub code in there,
commented out, in case it becomes possible later or anyone wants to take a
stab at it.

Original-work-by: Allan McRae <mcrae_allan@hotmail.com>
Improved-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-09 11:33:08 -06:00
Chantry Xavier 2ef78355fc _alpm_unpack: return 1 when the file is not found.
If _alpm_unpack has a specific file to extract (not NULL), but doesn't find
it, it'll now return 1, for indicating the failure.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-08 21:54:46 -06:00
Chantry Xavier 97fe3d3f5a libalpm/server.c : fix segfault when downloading failed.
The alpm_list_free(complete) needs to be done OUTSIDE the loop walking
through the server list.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-07 09:45:20 -06:00