When a SyncFirst transaction kicks in, no flags like '--force' are honored.
This is for good reason, as honoring something like '--asdeps' could be
quite unintentional. Document this fact and a possible workaround.
Signed-off-by: Dan McGee <dan@archlinux.org>
fetchIO_read returns -1 in case of error, and the return type is
ssize_t, not size_t ! So we converted -1 to an unsigned, which led to
huge file write.
The rest is just changing the error return a bit.
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
-f/--force has been dead for a while, so kill it off. In addition, the
check for > 2 args is pretty useless when you do something like:
repo-add -q -q
or a more legit:
repo-add -q /path/to/mine.db.tar.gz
So instead make repo-add just return 1 when it doesn't do anything with
the database which seems to make more sense.
Signed-off-by: Dan McGee <dan@archlinux.org>
Rather than creating no database at all, create an empty zipped tar archive
in its place. This keeps the download side of repositories a bit more sane
as a DB will always exist, and pacman handles this empty case just fine.
For this to be fully transparent, we also need to make sure repo-add and
repo-remove accept an empty "DB" as an argument, which in reality is a
completely void of files .tar.{gz,bz2,xz} archive.
Signed-off-by: Dan McGee <dan@archlinux.org>
If the package we were adding was a symlink, we stuck the symlink size in
the database rather than the size of the file it referred to. Whoops!
Signed-off-by: Dan McGee <dan@archlinux.org>
Various tidying to the usage output
- change "--config <config>" to "--config <file>" to prevent wrapping in a 80 character wide terminal
- re-alphabetise options, including moving all long only opts to the end
- use same indentation for additional pacman options
- remove useless comment
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
Yes, it was that bad :P
We still have memleaks left because we cannot free the error data returned
by libalpm, but pacman has the same issue.
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Get them a bit more standardized across the board, as they were quite a
mess. Also note the two new translations we received for 3.3.1.
Signed-off-by: Dan McGee <dan@archlinux.org>
This is for 3.3.0, not for 3.3.1. But since there are only like 10 messages
missing, it seems worth including now.
Signed-off-by: Christian Larsson <congacx@gmail.com>
Signed-off-by: Laszlo Papp <djszapi2@archlinux.us>
[Dan: fix some busted translation strings]
Signed-off-by: Dan McGee <dan@archlinux.org>
Previously we only looked at the first cache directory returned by the
library. This allows us to look at all cache directories for cleaning.
In addition, change the way we do a full (-Scc) cache cleaning operation.
Instead of removing the parent directory, remove each package one-by-one as
in the -Sc case. This would be ideal for someone mounting a cache directory
over NFS, as it ensures we don't wipe out the mountpoint from underneath the
directory.
Signed-off-by: Dan McGee <dan@archlinux.org>
We didn't look at the return status of sync_cleandb() in sync_cleandb_all().
Make it do so and return it up the call chain.
Signed-off-by: Dan McGee <dan@archlinux.org>
Commit 34e1413d75 attempted to implement lazy loading of package databases.
Although it took care of my main complaint (creating the database directory
if it didn't exist), it didn't allow sync repos to be registered before
alpm_option_set_dbpath() had been called.
With this patch, we no longer compute the individual repository DB paths
until necessary, allowing full lazy loading to work as intended, and
allowing us to drop the extra setlibpath() calls from the frontend. This
allows the changes introduced in a2cd48960 (but later reverted) to be added
back in again.
Signed-off-by: Dan McGee <dan@archlinux.org>
After commit 0da96abc, pacman always asks user confirmation for -U, so it is
more coherent to doing that for -R, too.
Btw, most users use -Rs always, so they won't notice any change. In the old
code the -Ru operation was forgotten: Though it is a not "dangerous" operation,
but the target list can be changed by that, too.
Non-interactive scripts should always use --noconfirm (unexpected questions can
be asked by all transactions). [That's why we should always default to the
safest answers.]
I've also added a pkglist != NULL sanity check (because -Ru can empty target
list in trans_prepare part).
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
It was probably a bad idea to modify the target directly in case of
repo/pkg syntax.
Duplicating it also allows us to keep the original target string, which
is more informative when printing errors.
Also remove a duplicated error message from libalpm, and improve the
message already returned to the frontend.
$ pacman -S foo/bar
before
error: repository 'foo' not found
error: 'bar': no such repository
after
error: 'foo/bar': could not find repository for target
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
./src/pacman/package.c:
- small typo fix
./src/pacman/pacman.c:
- strdup is changed to strndup, because it's safer like in
case of config option
Signed-off-by: Laszlo Papp <djszapi2@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Add more untranslated strings, improve consistency, etc.
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
After commit 774c252 the --debug output shows 5-6 "syntax error..." lines
for each package. After this patch pacman recognizes makepkgopt as a valid
key, but doesn't do anything.
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
This doesn't quite work, as can be seen by the pactest results:
Total = 179
Pass = 108 ( 60.34%)
Expected Fail = 5 ( 2.79%)
Unexpected Pass = 0 ( 0.00%)
Fail = 66 ( 36.87%)
If you peek inside '_alpm_db_new' when it gets called for the sync
databases, the base dbpath is still at the default value, causing things
like pactest to fail miserably. We need some further work to do fully lazy
loading, and that belongs on master, not maint.
This reverts commit a2cd48960e.
Signed-off-by: Dan McGee <dan@archlinux.org>
-int alpm_trans_sysupgrade(int enable_downgrade);
-int alpm_trans_sync(char *target);
-int alpm_trans_add(char *target);
-int alpm_trans_remove(char *target);
+int alpm_sync_sysupgrade(int enable_downgrade);
+int alpm_sync_target(char *target);
+int alpm_sync_dbtarget(char *db, char *target);
+int alpm_add_target(char *target);
+int alpm_remove_target(char *target);
* functions renaming
* add new sync_dbtarget which allows to specify the db
* repo/ syntax handling is moved to frontend
( should implement FS#15141)
* group handling is moved to backend
( see http://www.archlinux.org/pipermail/pacman-dev/2009-June/008847.html )
With the help of --ask switch it is possible to test remove_unresolvable
feature, so I reverted the change of commit f2061c5f on ignore005.py with
--ask=32 added.
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>