Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
We dup-ed the string but then duped it again. Fix it.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|
|
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>
|
|
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>
|
|
* -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>
|
|
Conflicts:
configure.ac
|
|
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>
|
|
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>
|
|
Change the pacman_upgrade stub function to do what pacman_add used to do so
we can eliminate pacman_add. Move the code to the more-descriptive name of
upgrade.c.
Note that we have made no changes to the backend libalpm, where an ADD type
transaction could still be supported.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
There is still a lot of code that could be cleaned up internally.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Now pacman frontend uses this function instead of the compile-time libalpm
version number.
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
[Dan: fix one more spot where LIB_VERSION was used]
Signed-off-by: Dan McGee <dan@archlinux.org>
(cherry picked from commit 49197b7492d61bf1fc6bef59a708f4f586f32edb)
|
|
Now pacman frontend uses this function instead of the compile-time libalpm
version number.
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
[Dan: fix one more spot where LIB_VERSION was used]
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
* mainly code cosmetics (indent fixes)
* remove debug message "spam"
* print also user friendly result
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
[Dan: a few more whitespace/linebreak cleanups added]
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
test_delta_md5sum and test_pkg_md5sum were simple wrappers to test_md5sum,
and only used once, so not very useful. I removed them.
Also, test_md5sum and alpm_pkg_checkmd5sum functions were a bit duplicated,
so I refactored them with a new _alpm_test_md5sum function in libalpm/util.c
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
I screwed up originally when I accepted the TotalDownload patch,
8ec27835f40e3df1ce409bc3d913587c474a30c3. I didn't realize how deeply it
modified libalpm and I probably shouldn't have let it do what it did. This
commit reverts much of what that patch added in order to clean up our
internal function calls. We can find another way to do it right down the
road here but for now it has to go.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Also bump the devel version on the master branch to 3.2.0devel.
|
|
This change is similar to the one made in
3017b71cb5cde3aef7e0efb5f49843cccf759956.
We had a "loading package data..." message, followed by either "failed" or
"done", but it didn't take into account that other warnings / questions
could be displayed between.
Ref: http://archlinux.org/pipermail/pacman-dev/2008-January/010971.html
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
Add a preset paramater to yesno function saying which answer should be the
default. Ref:
http://www.archlinux.org/pipermail/pacman-dev/2007-June/008470.html
This allows us to answer no by default to some questions, like the -Scc one
mentioned in the above thread, and implemented by this patch.
Another advantage is that we don't have to repeat the [Y/n] in every
questions. It's only put once in yesno function. This highly reduces the
chances that YES and NO strings are translated, but not some questions,
which lead to obvious confusions.
Finally, the noconfirm variable only needs to be used in that yesno
function. So all other usages of it were removed.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
Conflicts:
src/pacman/callback.c
|
|
After a merge with master where some strings we print (such as descriptions)
could be NULL, a few segfaults popped up due to strlen() calls on null
pointers. Fix this by doing some preemptive checks and returning from
functions early if the string was null.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Both alpm_logaction() and yesno() are vararg functions, so we might as well
use this functionality and take advantage of it. Remove all of the
snprintf() calls and the LOG_STR_LEN constant that never seemed quite right.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Fix up the indentprint and list printing functions so they work properly.
This output can be seen in places such as -Ss, -Si, -Qs, and -Qi.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Due to the addition of the Chinese translation, our column widths were all
messed up as mentioned in the download progress commit fixing this same
problem there. This is a port of the code and ideas from that fix to the
installation progress bars. Once again, a handful of examples were tested to
ensure we work in all locales and with varying byte and char widths.
English (before & after):
(1/1) checking for file conflicts [-----------------] 100%
(1/1) upgrading man-pages [-----------------] 100%
German (before & after):
(1/1) Prüfe auf Dateikonflikte [-----------------] 100%
(1/1) Aktualisiere man-pages [-----------------] 100%
Chinese (before):
(1/1) 正在检查文件冲突 [-----------------] 100%
(1/1) 生在升级 man-pages [c o o o o o ] (1/1) 生在升级 man-pages [----------C o o ] (1/1) 生在升级 man-pages [-----------------] 100%
Chinese (after):
(1/1) 正在检查文件冲突 [-----------------] 100%
(1/1) 生在升级 man-pages [-----------------] 100%
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Now that we have a Chinese translation, all of the problems with new
character sets crop up. Assumptions were made in the past that all
characters occupied one column, which is not true with a Chinese character
set. In addition, the download code even failed on such things as 'ö', which
is two bytes wide but only 1 column.
This code will need to also be ported to the add/remove/upgrade/conflicts
progress printouts.
Note that the tests below try to incorporate a number of things:
1. download filenames too long to fit
2. download filenames cut off in the middle of a multibyte sequence
3. download filenames incorporating multicolumn chars
4. download filenames incorporating multibyte, single-column chars
5. 'plain' download filenames that have always worked
Before:
:: 正在同步软件包数据库……
正在解决倚赖��... 0.0K 199.8K/s 00:00:00 [-----------------] 100%
错误:无法升级正在解决倚赖关系junköëjunköëjunköëäää (未预计的系统错误)
正在解决倚赖��... 0.0K 308.4K/s 00:00:00 [-----------------] 100%
错误:无法升级正在解决倚赖关系 (未预计的系统错误)
junköëä 0.0K 390.6K/s 00:00:00 [-----------------] 100%
错误:无法升级junköëä (未预计的系统错误)
pacman-git 0.5K 4.3M/s 00:00:00 [-----------------] 100%
本地数据库已是最新的
After:
:: 正在同步软件包数据库……
正在解决倚赖关系jun... 0.0K 89.7K/s 00:00:00 [-----------------] 100%
错误:无法升级正在解决倚赖关系junköëjunköëjunköëäää (未预计的系统错误)
正在解决倚赖关系 0.0K 147.7K/s 00:00:00 [-----------------] 100%
错误:无法升级正在解决倚赖关系 (未预计的系统错误)
junköëä 0.0K 156.9K/s 00:00:00 [-----------------] 100%
错误:无法升级junköëä (未预计的系统错误)
pacman-git 0.5K 1515.9K/s 00:00:00 [-----------------] 100%
本地数据库已是最新的
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This allows us to remove the sync_only flag, and also do the following
steps in the future :
1) refresh the database (if asked)
2) do other stuff (eg checking if a newer pacman version is available)
3) start the actual transaction
Currently when we detect a newer pacman version, we have to release the
current transaction and start a new one.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
Remove gettext() function addition from gensync and updatesync in master as
gettext is no longer used in them anyway.
|
|
This partly fixes FS#9609.
Weird things could happen when running -Sc while another instance was
already running. The cleancache function could delete packages that were
just being downloaded.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
Factorize these two functions to avoid code duplication, especially since
they could be used for locking the database during -Sc and -Sy operation
too.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
FS#9609 brought up an interesting issue where a user was prompted to remove
db.lck when running a -Sc operation concurrently with an -Syu operation
during a long download. Although there are other problems here, this fixes
the issue where files other than directories could be considered to be
databases. Fix this.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This fixes FS#6437. Dan already explained the problem in that bug report.
Instead of letting printf deal with the length of utf8 strings, we can
handle it more explicitly in the case of conflict progress bar, just like we
do for add/remove progress bars. We compute the remaining space left for
displaying the pkgname in case of add/remove, and an empty string in case of
conflict.
Before :
(1/1) Prüfe auf Dateikonflikte [###################] 100%
(1/1) Aktualisiere rxvt-unicode [###################] 100%
After :
(1/1) Prüfe auf Dateikonflikte [###################] 100%
(1/1) Aktualisiere rxvt-unicode [###################] 100%
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Noticed-by: Vojtěch Gondžala <vogo@seznam.cz>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Conflicts:
lib/libalpm/be_files.c
lib/libalpm/package.c
|
|
For some reason, we set our dbpath to the logfile path, which was completely
broken, and we didn't even check the return value coming back (which of
course was -1 meaning the set failed). Add some comments so people can
understand what is going on here now too.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|
|
Conflicts:
contrib/gensync
contrib/updatesync
|
|
Fixes FS#9473 and the issue reported there :
http://www.archlinux.org/pipermail/pacman-dev/2008-February/011061.html
Only the dirname should be resolved, not the basename.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This function mirrors mbasename and will be used by the 'owns' machinery.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Keeping this hack around where installed size is only shown if it is
greater than total download size encourages broken repository databases.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Make the error message printed when addtarget fails consistent between
add.c, remove.c and sync.c.
The main problem was that the "failed to add target" in case of a removal
operation could sound confusing. There was also a little output problem
with -U ("failed" was missing).
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|
|
|
|
Fixes FS#9295.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: 'new pacman' -> 'new pacman version']
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Testdb will now scan the local database to check there are no conflicts.
I'm not sure how it's possible to get this situation. At least pacman
doesn't allow installing a package that conflicts with a local one, without
removing the local one. But maybe in a very weird situation, or because of
a bug, it could be possible. But anyway, this only requires 5 lines of
code.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
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>
|
|
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>
|
|
* added a newline to a conflict message in add.c
* removed the trailing dot in a replace message in callback.c.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|