1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00
Commit Graph

2799 Commits

Author SHA1 Message Date
Allan McRae
3758ccbb52 makepkg: fix testing for built package presence
Commit c7e4d10d introduced a small error in the testing of whether
a package is already built.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-20 23:32:50 -05:00
Dan McGee
6c635d76a0 Merge branch 'maint' 2009-10-20 22:29:20 -05:00
Allan McRae
c7e4d10df3 makepkg: allow overriding arch in split packages
This allows building a mixture of binary and arch=any packages.
Fixes FS#15955.

The value of CARCH is no longer overridden to "any" in when arch=any
is used and the assigning of the "any" arch is delayed to during the
packaging stage. Adjustments were required to fix installing and
checking for pre-built packages of varing arches.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-20 22:29:08 -05:00
Allan McRae
2020e6297b makepkg: allow overriding pkgver and pkgrel in split packages
Fixing a single package within a split package requires the overriding
or pkgrel.  In very rare (but existing) cases, it is useful to
override pkgver.  Partial fix for FS#15955.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-20 22:29:02 -05:00
Xavier Chantry
2c2596177d dload.c : clear sigaction flag to make valgrind happy
This fixes the following valgrind warning :

==26831== Syscall param rt_sigaction(act->sa_flags) points to uninitialised
byte(s)
==26831==    at 0x4282547: __libc_sigaction (in /lib/libc-2.10.1.so)
==26831==    by 0x403C693: download_internal (dload.c:152)
==26831==    by 0x403D0E4: _alpm_download_single_file (dload.c:311)
==26831==    by 0x4033B72: alpm_db_update (be_files.c:319)
==26831==    by 0x805205E: pacman_sync (sync.c:257)
==26831==    by 0x804EE54: main (pacman.c:1120)
==26831==  Address 0xbec6cc04 is on thread 1's stack
==26831==
==26831== Syscall param rt_sigaction(act->sa_restorer) points to
uninitialised byte(s)
==26831==    at 0x4282547: __libc_sigaction (in /lib/libc-2.10.1.so)
==26831==    by 0x403C693: download_internal (dload.c:152)
==26831==    by 0x403D0E4: _alpm_download_single_file (dload.c:311)
==26831==    by 0x4033B72: alpm_db_update (be_files.c:319)
==26831==    by 0x805205E: pacman_sync (sync.c:257)
==26831==    by 0x804EE54: main (pacman.c:1120)
==26831==  Address 0xbec6cc08 is on thread 1's stack
==26831==

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-20 22:25:39 -05:00
Cedric Staniewski
3d67d9b16c makepkg, repo-add: replace external commands with bash substitutions where possible
This also removes the awk dependency from makepkg and repo-add.

Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-20 22:24:36 -05:00
Gan Lu
5ffc1ad3cd fix for zh_CN
bash is not able to handle positional parameters

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-20 22:22:05 -05:00
Laszlo Papp
4281a1a7f2 Size handling was changed in fgets() functions
Pacman's fgets function in the API used hardcoded numbers to identify the size.
This is not good practice, so replace them with sizeof handling.

Signed-off-by: Laszlo Papp <djszapi@archlinux.us>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-19 07:37:53 -05:00
Laszlo Papp
f9582c7df2 Replace hardcoded option numbers with enumeration
Pacman's long option parsing used hardcoded numbers to identify them.
This is not good practice, so replace them with enumeration constants.

Signed-off-by: Laszlo Papp <djszapi@archlinux.us>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-12 23:42:36 -05:00
Cedric Staniewski
2cabe336eb Introduce new PKGBUILD variable changelog
Currently, a changelog is added to a package if a specific file with a
hardcoded name exists in the PKGBUILD's directory. This approach is not
pretty and also inconsistent with the handling of install files, but it
works.

With the introduction of split PKGBUILDs, however, a drawback in this
old behavior has arisen: you only have the possibility to include one
specific changelog file in either every package defined in the PKGBUILD
or in none.

The use of an additional variable, `changelog`, works around this issue
and makes it possible to include a changelog in only some of the
packages, and besides, each package of the PKGBUILD can have its own
changelog file.

Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 22:35:20 -05:00
Allan McRae
da5fb3ee4f Fix Greek short Y/N translation
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 22:34:43 -05:00
solsTiCe d'Hiver
e3ac806262 use bitwise shift operator in enum "bit field"
This offers a cleaner way to deal with constant in enum and allow easy
maintainance

Signed-off-by: solsTiCe d'Hiver <solstice.dhiver@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 22:13:49 -05:00
Cedric Staniewski
c7d8601e12 Fix stderr redirection
When redirecting both stderr and stdout and using the 2>&1 construct,
you have to redirect stdout first. Otherwise stderr will be redirected to
the 'old' stdout and not to the new resource.

Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 16:34:47 -05:00
Laszlo Papp
ab3c6f01f5 Remove makepath function from frontend
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 15:52:12 -05:00
Nagy Gabor
72bc947cbb Fix "-Sd conflict_pkg" bug
If the -d switch was invoked with -S (or -U), the removes list was simply
lost, because trans->remove was computed in an
"if(!(trans->flags & PM_TRANS_FLAG_NODEPS))" block.

I've added a new pactest file, sync045.py (derived from sync043.py) to test
this.

Additionally, I did some other minor cleanups in sync_prepare:
 * preferred list is not needed anymore
 * I removed a needless alpm_list_remove_dupes line (the target list should
   not contain dupes at all)
 * I moved alpm_list_free(remove); to cleanup part to eliminate a possible
   memleak

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 15:30:52 -05:00
Xavier Chantry
3dc87851cc alpm_list : add new alpm_list_diff_sorted function
This is more efficient than alpm_list_diff since it assumes the two lists
are sorted. And also we get the two sides of the diff.

Even sorting should more efficient than the current list_diff. Sorting the
two lists should be O(n*log(n)+m*log(m)) while the current list_diff is
O(n*m). So I also reimplemented list_diff using list_diff_sorted.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 15:28:10 -05:00
Xavier Chantry
14ab02e289 Rework the alpm_unpack functions
Add support to extract a list of entries

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 15:18:47 -05:00
Xavier Chantry
471b1fa543 update sync200 pactest
update download -> fetch

This just meant that we used XferCommand even if internal download was
available, no big deal.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 15:12:44 -05:00
Xavier Chantry
caea098c21 cygwin fix : use unsigned char for ctype function
See http://www.nabble.com/-PATCH-RFA--Distinguish-between-EOF-and-character-with-value-0xff-td23161772.html#a23188494

cygwin 1.7 actually displays a warning when using signed char with the ctype
function, so that compilation fails when using -Wall -Werror.

So we just cast all arguments to unsigned char.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 15:12:20 -05:00
Xavier Chantry
35bbc96b99 replace rankmirrors by bash clone
This removes python optdepends in pacman package

This bash clone is a courtesy of
Matthew Bruenig <matthewbruenig@gmail.com>

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-10-11 15:08:06 -05:00
Dan McGee
302310c5aa Minor scope/typing cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 14:42:04 -05:00
Dan McGee
4828d9ef7c libalpm: clean up lock function
We were doing a lot of manual work; leverage the standard library a bit to
do more for us.

Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 14:42:04 -05:00
Dan McGee
6e312220ec Reduce calls to list_count() in removing package
We don't need to count the number of packages left once per file when
removing; we only need to do it once per package. Also move a variable into
the correct scope.

Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 14:42:04 -05:00
Dan McGee
3bc8c28ce3 Add missing get_usedelta() method
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 14:42:04 -05:00
Dan McGee
145103aacc typing: a few more fixes for special int types
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 14:41:59 -05:00
Dan McGee
35dc9b0314 int typing: s/unsigned short/int/ in libalpm
After our recent screwup with size_t and ssize_t in the download code, I
found the `-Wsign-conversion` flag to GCC to see if we were doing anything
else boneheaded. I didn't find anything quite as bad, but we did have some
goofups- most of our public unsigned methods would return -1 on error, which
is a bit odd in an unsigned context.

Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 13:51:47 -05:00
Dan McGee
cf0d619670 Merge branch 'maint' 2009-10-11 12:57:57 -05:00
Xavier Chantry
5e03941ee5 alpm_list : fix a bug in alpm_list_remove
A NULL list element triggered an infinite loop. Not cool :)

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 12:55:55 -05:00
Christos Nouskas
f15c8d4616 Minor fix to Greek translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 12:55:33 -05:00
甘露(Lu.Gan)
aea22ac2fd Update Chinese translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-11 12:55:17 -05:00
Christian Larsson
9282a4a909 Update Swedish translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-07 18:12:26 -05:00
甘露(Lu.Gan)
f77d73af4b Update chinese translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-07 18:12:26 -05:00
Xavier Chantry
ba14bd7728 New Greek translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-07 18:12:26 -05:00
Xavier Chantry
8db120c260 Update translations
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-07 18:12:26 -05:00
Xavier Chantry
a0acf8b509 Update all pot and po files for 3.3.2 release
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-07 18:12:26 -05:00
Dan McGee
a131c468f7 3.2.2 release changes
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-04 16:59:48 -05:00
Dan McGee
d7a20d9c41 doc: Add HACKING to html target
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-04 16:56:25 -05:00
Dan McGee
42042723a8 doc: ensure SyncFirst behavior with flags is clear
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>
2009-10-04 09:48:56 -05:00
Xavier Chantry
44a57c890b callback.c : fallback to normal download with bogus size
When using totaldownload, we might get into some weird situations where
xfered>total because of bogus CSIZE database entries.

This code adds a sanity check and fallbacks to normal download progress if
needed.

Here is an example using totaldownload on a database with wrong CSIZE, for a
total download of ~26 MB.

Before :

 gnome-desktop-2.28....  1144,3K  678,3K/s 00:00:02 [#################]   4%
 gnome-panel-2.28.0-...     4,2M  887,7K/s 00:00:05 [#################]  16%
 gnome-applets-2.28....    13,6M 1083,0K/s 00:00:13 [#################]  52%
 gnome-backgrounds-2...    22,9M  964,0K/s 00:00:24 [#################]  87%
 gnome-settings-daem...    23,6M  938,5K/s 00:00:26 [#################]  90%
 gnome-control-cente...    26,1M  946,1K/s 00:00:28 [#################] 100%
 gnome-icon-theme-2....    27,7M 1465,0K/s 1193046:28:15 [#######----------] gnome-icon-theme-2....    28,0M 1502,2K/s 1193046:28:15 [########---------] gnome-icon-theme-2....    28,4M 1582,2K/s 1193046:28:15 [##########-------] gnome-icon-theme-2....    28,7M 1603,4K/s 1193046:28:15 [############-----] gnome-icon-theme-2....    29,0M 1604,5K/s 1193046:28:15 [##############---] gnome-icon-theme-2....    29,3M 1621,0K/s 1193046:28:14 [################-] gnome-icon-theme-2....    29,6M 1434,8K/s 1193046:28:14 [#################] gnome-icon-theme-2....    29,6M  974,2K/s 00:00:31 [#################] 113%

After :

 gnome-desktop-2.28....  1144,3K 1038,7K/s 00:00:01 [#################]   4%
 gnome-panel-2.28.0-...     4,2M  988,4K/s 00:00:04 [#################]  16%
 gnome-applets-2.28....    13,6M 1190,4K/s 00:00:12 [#################]  52%
 gnome-backgrounds-2...    22,9M 1242,9K/s 00:00:19 [#################]  87%
 gnome-settings-daem...    23,6M 1193,9K/s 00:00:20 [#################]  90%
 gnome-control-cente...     2,5M 1347,4K/s 00:00:02 [#################] 100%
 gnome-icon-theme-2....     3,5M 1205,4K/s 00:00:03 [#################] 100%

Note that gnome-control-center resetted to normal progress mode
(2,5M is the package size, not the total size)

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-04 09:32:02 -05:00
Dan McGee
8e7652f1af Merge branch 'maint'
Conflicts:
	lib/libalpm/dload.c
2009-09-29 21:08:06 -05:00
Xavier Chantry
20392c0a02 dload : fix infinite download (big type mistake)
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>
2009-09-29 20:52:56 -05:00
Dan McGee
2071286770 repo-add: clean up options parsing
-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>
2009-09-23 22:46:38 -05:00
Dan McGee
7f14f185a2 repo-remove: create empty DB when all packages are removed
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>
2009-09-23 21:15:53 -05:00
Dan McGee
20aa17c276 repo-add: make sure we get size of target file
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>
2009-09-23 19:11:34 -05:00
Dan McGee
86d4b8a3aa Merge branch 'maint' 2009-09-22 21:38:16 -05:00
Dan McGee
7cead800c5 Update index.txt with new release
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-09-22 21:37:05 -05:00
Allan McRae
5bea2c08a3 makepkg: tidy usage output
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>
2009-09-22 19:01:05 -05:00
Xavier Chantry
0f834c93c7 testdb : fix many memleaks
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>
2009-09-22 18:46:32 -05:00
Dan McGee
e76b3374d8 Clean up translation file headers
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>
2009-09-22 18:28:42 -05:00
Laszlo Papp
802b1a6f2f Add Swedish translation
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>
2009-09-22 18:09:55 -05:00