Commit Graph

2487 Commits

Author SHA1 Message Date
Dan McGee 04c2b9d4ed Merge branch 'maint' 2009-02-08 11:43:08 -06:00
Sebastian Nowicki ea84819bbb makepkg: Make stripping debug symbols cross-platform
The Linux and BSD versions of strip have the --strip-debug option (as
well as the -S option), however Mac OS X only has -S.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-02-08 11:33:33 -06:00
Xavier Chantry 34e1413d75 Delay the creation of local and sync db dir.
We don't need to create the directories when local or sync dbs are
registered. For example, if a sync db does not exist, we cannot even do
"pacman -Q" as an user.

Instead, we can create the local db if needed during the db_prepare
operation, and sync dbs on db_update.

Also remove some more useless abstractions in db_update and switch to a much
more efficient way to remove a sync db : rm -rf.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-01-20 14:07:15 +01:00
Xavier Chantry 14230869e6 Remove some db abstraction crap.
These db_open and db_close looked quite useless. And they caused the db
directory to be opened on a simple registering of a database. This is
totally unneeded, this opening can be delayed to when we actually need it.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-01-20 14:04:54 +01:00
Xavier Chantry eab9684837 alpm_unpack : change prefix handling to workaround FS#12148.
Instead of appending the prefix to each entry name, we can chdir to the
prefix before extracting, and restoring when it is done.
This seems to work better with the strange and special case of FS#12148
where an archive contained the "./" entry.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-01-20 14:03:46 +01:00
Dan McGee c794661f1e Merge branch 'maint' 2009-01-18 13:48:48 -06:00
Dan McGee 8929769902 makepkg: test fixes, part 2
The goal of this fix was empty string comparisons:
-  if [ "$pkgname" != "" ]; then
+  if [ -n "$pkgname" ]; then

Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-18 13:48:31 -06:00
Dan McGee 350c3eb6ec makepkg: clean up test usage
In a lot of places, we had the following construct:
  [ "$foobar" = "0" ]
which is better represented by using the integer tests:
  [ $foobar -eq 0 ]

Attempt to unify makepkg to use the latter rather than the former in all
places. From here on out we should ensure anything that is set to 0, 1, etc.
uses the -eq format rather than =.

In addition, fix a few other test anomalies including usage of double
equals.

Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-18 13:46:23 -06:00
Nagy Gabor 472e51b975 Use archive_entry_set_perm instead of archive_entry_set_mode
This patch fixes FS#12148 ('unstable' regular file).
I also changed the other archive_entry_set_mode usage in add.c to
archive_entry_set_perm.

Since I cannot find any relevant info in libarchive manual, I quote
Tim Kientzle (the author of libarchive) here, and I say thank you for
his help.

*** Tim Kientzle wrote *************************************

This is the problem in libalpm/util.c:

323    if(S_ISREG(st->st_mode)) {
324            archive_entry_set_mode(entry, 0644);
325    } else if(S_ISDIR(st->st_mode)) {
326            archive_entry_set_mode(entry, 0755);
327    }

Your example unstable.db.tar.gz is not empty.  It has
one entry in it, called "./".  That entry is marked
as a directory.  But, when you call archive_entry_set_mode(),
you are changing the file type!  archive_read_extract()
then creates the file /var/unstable as you requested.
(archive_read_extract() will replace an empty directory
with a file.)

You should either set the mode value correctly:

323    if(S_ISREG(st->st_mode)) {
324            archive_entry_set_mode(entry, IFREG | 0644);
325    } else if(S_ISDIR(st->st_mode)) {
326            archive_entry_set_mode(entry, IFDIR | 0755);
327    }

Or use archive_entry_set_perm(), which does not change
the file type:

323    if(S_ISREG(st->st_mode)) {
324            archive_entry_set_perm(entry, 0644);
325    } else if(S_ISDIR(st->st_mode)) {
326            archive_entry_set_perm(entry, 0755);
327    }

************************************************************

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-18 13:35:17 -06:00
Allan McRae fba5771fa4 makepkg: repackage rework with package functions
When using the optional package() function or split packages, the
entire packaging step is rerun instead of just final package
creation step.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-17 09:19:35 -06:00
Bryan Ischo 5bc23bc05d Fixed some inconsistencies and errors in the pactest documentation.
Signed-off-by: Bryan Ischo <bryan@ischo.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-16 20:22:58 -06:00
Dan McGee 3d49d88009 Merge branch 'am/splitpkg'
* am/splitpkg:
  makepkg: implement creation of split packages
  makepkg: Optional argument for run_package and create_package
  makepkg: hack around tee in run_package function
  makepkg: add functions for backup and restore of package fields
  makepkg: add optional package function
  makepkg: Add PKGBUILD-split.proto
2009-01-16 19:45:02 -06:00
Allan McRae e946ee7745 makepkg: implement creation of split packages
Adds the ability to create multiple packages from one PKGBUILD

Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-16 22:32:05 +10:00
Allan McRae 21b8a5418d makepkg: Optional argument for run_package and create_package
Generalize run_package to allow the passing of a package name
directing the use of an alternative package function. A similar
adjustment to create_package to prepare split packages.

Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-16 22:26:52 +10:00
Allan McRae 708ce1480f makepkg: hack around tee in run_package function
Piping the package function through tee to log the outut also
clears any variables set in the package function.  This is a
problem in split packages as package variable overrides are done
in the package function.  This is fixed by creating a node which
the output is piped through and duplicated using the tee function.

Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-16 22:24:21 +10:00
Allan McRae 9804911c5f makepkg: add functions for backup and restore of package fields
Adds functions for the backup and restoration of package variables
that can be over-ridden during package splitting.  Variables which
can be overridden are given in the splitpkg_overrides variable.

Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-16 22:22:04 +10:00
Allan McRae 08034ceb17 makepkg: add optional package function
This patch allows us to split the building and packaging stages of
a PKGBUILD and minimize fakeroot usage. This can be done with less
code duplication (run_build and run_package look quite similiar) but
the run_package function will be where the package splitting logic
is implemented in the future.

Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-16 22:20:05 +10:00
Allan McRae 219cb2eaac makepkg: Add PKGBUILD-split.proto
Prototype PKGBUILD for package splitting in makepkg

Signed-off-by: Allan McRae <allan@archlinux.org>
2009-01-16 22:16:18 +10:00
Aaron Griffin a9f030e84c Make the repo-add quiet flag less quiet
Considering one can easily run:
   repo-add .... >/dev/null
to get only warnings and errors, the -q flag is mostly useless.

Make the -q flag silence only level 2 messages.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-14 19:18:08 -06:00
Dan McGee 7a3a718c7a makepkg: fix my own stupid mistake
We don't want to bail if a certain integrity check wasn't even provided.
Whoops.

Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-13 20:13:31 -06:00
Aaron Schaefer e3a06961f6 makepkg: use INTEGRITY_CHECK only for generation of checksums
Signed-off-by: Aaron Schaefer <aaron@elasticdog.com>
[Dan: fail if checksum array is incorrectly sized]
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-13 19:50:38 -06:00
Dan McGee d7345da5ba doc: Consistency and formatting cleanups (for master)
Bring master in line with some things we just did on maint.

Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-13 00:11:17 -06:00
Dan McGee b369f71fd6 Merge branch 'maint'
Conflicts:
	doc/makepkg.conf.5.txt
2009-01-13 00:10:36 -06:00
Dan McGee 1191303f8b doc: Consistency and formatting cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-13 00:06:58 -06:00
Dan McGee e9ca40b56e doc: fix some more asciidoc fallout
They keep changing things on us. This gets rid of the '.ft C' text sprinkled
around our listing blocks.

Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-13 00:00:35 -06:00
Dan McGee 3d6da93093 doc: remove BUILDSCRIPT from makepkg.conf docs
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-12 23:59:44 -06:00
Nagy Gabor cb7337eb64 db->pkgcache_loaded and db->grpcache_loaded
Clearly the old code was more elegant (NULL cache indicated "not loaded"),
but it had some drawbacks, so from now on we indicate the state of caches
explicitly.

Old drawbacks:
When we had an empty database (unstable), libalpm called db_populate after
every pkgcache access, because NULL pkgcache indicated "not loaded" state.
This is not a common case, but the same situation can happen with grpcache,
which is more problematic: If the user had a custom repo with no groups,
grpcache was always NULL. (grpcache is also loaded per database.) Thus
every get_grpcache call induced a load_grpcache operation, so the benefits
of grpcache was completely lost.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-12 23:59:37 -06:00
Nagy Gabor 4da70d800a Rename alpm_get_md5sum to alpm_compute_md5sum and alpm_dep_get_string to alpm_dep_compute_string
This patch introduces the following function name convention:
_compute_ in function name: the return value must be freed.
_get_ in function name: the return value must not be freed.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-12 23:59:30 -06:00
Nagy Gabor a888f377a5 HoldPkg rework
The HoldPkg feature is even more important when the packages to be held are
pulled automatically by pacman, in a -Rc and -Rs operation. Before, it only
applied when the packages were explicitly requested by the user to be
removed. This patch extends holdpkg to -Rc and -Rs by doing the HoldPkg
check just before trans_commit.

Additionally, the whole HoldPkg stuff was moved to the front-end.

I changed the default behavior to "don't remove", so I modified remove030.py
pactest as well.

See also: FS#9173.

Original-work-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-12 22:44:00 -06:00
Xavier Chantry 8017b0bb8e Remove libdownload support and fix libfetch one.
Aaron said to consider libdownload a dead project so libdownload support was
removed to more easily fix libfetch one (otherwise many ifdef needed).

There was no direct replacement for ferror to detect an error while
downloading. So instead, I added a check at the end to see if the file was
fully downloaded, which is just a small chunk of code taken from here:
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/net/libfetch/files/fetch.c?only_with_tag=MAIN

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-12 22:40:15 -06:00
Xavier Chantry 4ec846f5ac makepkg : fix a lot of breakages caused by Allan
This patch started as a simple typo fix (pugre instead of purge in two
places), as well as a fix of a test which was using PURGE_TARGETS instead of
$PURGE_TARGETS.

It evolved in a slight handling change of the OPTIONS which have a variable
affecting their behavior (strip STRIP_DIRS, docs DOC_DIRS, zipman MAN_DIRS
and purge PURGE_TARGETS), as well as a clarification in makepkg.conf. Now
when a variable is undefined or empty, the corresponding option will have no
effect. It looked weird to have a fallback when a option is defined but
empty, it seems more natural to not have any fallbacks.

Also re-enable docs by default. It seems arbitrary to delete files from
packages by default, and it would be more vanilla and distro agnostic to
keep them. docs was also the only negated option.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-12 22:28:10 -06:00
Dan McGee 94c2830572 Fix linkman macro to work with asciidoc > 8.3.0
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-11 22:09:40 -06:00
Dan McGee 0501d340cd Merge branch 'maint' 2009-01-06 20:22:15 -06:00
Vojtěch Gondžala c6bcdf4dc7 Update Czech translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-05 19:06:39 -06:00
Hugo Doria 9f5e1dc8cd Update Portuguese (Brazil) translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-05 07:05:40 -06:00
Dan McGee cebe36c42c Update configure.ac for 3.2.2 release
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-04 11:34:47 -06:00
Dan McGee 301fe17f57 Update NEWS for 3.2.2
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-04 11:27:03 -06:00
Dan McGee 6f9539aefb Merge branch 'maint'
Conflicts:
	po/it.po
2009-01-04 11:12:28 -06:00
Mateusz Herych 997a611fa4 Update Polish translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03 19:07:44 -06:00
Sergey Tereschenko 162e77ffdc Update Russian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03 19:05:19 -06:00
Samed Beyribey a2cbccb8c7 Update Turkish translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03 09:25:24 -06:00
Sergey Tereschenko c850786e43 Update Russian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03 09:24:07 -06:00
Roman Kyrylych 3acc265f9d Update Unkranian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03 09:20:41 -06:00
Giovanni Scafora 03a63e01a5 Update Italian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03 09:17:50 -06:00
Matthias Gorissen 024012649f Update German translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03 09:14:35 -06:00
Nagy Gabor 93d47ebbc0 Update Hungarian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03 09:11:56 -06:00
甘露(Gan Lu) c2dc05c065 Update Chinese translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03 09:10:08 -06:00
Xavier Chantry fb18679a00 Update French translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-01-03 11:49:06 +01:00
Juan Pablo González Tognarelli 792ee97645 Update Spanish translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-03 00:30:09 -06:00
Dan McGee a30bf868ca Merge branch 'maint' 2009-01-03 00:18:22 -06:00