[pacman-dev] [PATCH 3/4] copy assumeinstalled options

2015-07-16 Thread Andrew Gregory
All other option setters copy their input. Signed-off-by: Andrew Gregory --- lib/libalpm/handle.c | 11 +-- src/pacman/conf.c| 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 15c60cd..02af2dc 100644 --- a/lib

Re: [pacman-dev] [PATCH 03/12] Allow frontends to specify the sync database extension

2015-07-14 Thread Andrew Gregory
On 07/14/15 at 10:31pm, Allan McRae wrote: > This allows frontends to select between the .db and .files databases > currently supplied by repo-add or any other compatible database. > > Signed-off-by: Allan McRae > --- > lib/libalpm/alpm.c| 4 > lib/libalpm/alpm.h| 3 +++ > lib/lib

Re: [pacman-dev] Version bounds for IgnorePkg

2015-07-06 Thread Andrew Gregory
On 07/06/15 at 06:17pm, Allan McRae wrote: > On 06/07/15 12:30, Andrew Gregory wrote: > > On 07/06/15 at 11:35am, Allan McRae wrote: > >> On 05/07/15 22:44, Daniel Schoepe wrote: > >>> On Sun, 05 Jul 2015 14:01 +0200, Allan McRae wrote: > >>>>> -

Re: [pacman-dev] Version bounds for IgnorePkg

2015-07-05 Thread Andrew Gregory
On 07/06/15 at 11:35am, Allan McRae wrote: > On 05/07/15 22:44, Daniel Schoepe wrote: > > On Sun, 05 Jul 2015 14:01 +0200, Allan McRae wrote: > >>> - As discussed when I brought this up a while back, only equality > >>> constraints > >>> are supported, since the other types of bounds would have

Re: [pacman-dev] [PATCH 0/4] hooks

2015-07-04 Thread Andrew Gregory
On 07/05/15 at 12:00am, Allan McRae wrote: > Firstly, WOO! > > On 04/07/15 19:59, Andrew Gregory wrote: > > = TODO = > > * documentation > > * run PreTransaction hooks *after* conflict checks > > * hook/trigger validation > > * masking hooks wit

[pacman-dev] [PATCH 4/4] add example hooks

2015-07-04 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- hooks/checkboot.hook | 17 + hooks/checkmount | 13 + hooks/checkmount.conf | 1 + hooks/checkmount.hook | 17 + hooks/sync.hook | 16 5 files changed, 64 insertions(+) create mode 100644

[pacman-dev] [PATCH 3/4] wip add hooks

2015-07-04 Thread Andrew Gregory
--- lib/libalpm/Makefile.am | 2 + lib/libalpm/alpm.c | 1 + lib/libalpm/alpm.h | 10 ++ lib/libalpm/handle.c| 59 lib/libalpm/handle.h| 1 + lib/libalpm/hook.c | 354 lib/libalpm/hook.h | 34 + lib/

[pacman-dev] [PATCH 2/4] move ini parser into common

2015-07-04 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- src/common/ini.c | 116 ++ src/common/ini.h | 30 ++ src/pacman/ini.c | 117 +-- src/pacman/ini.h | 31 +-- 4 files changed, 148

[pacman-dev] [PATCH 0/4] hooks

2015-07-04 Thread Andrew Gregory
etc.). They do *not* have access to which package/file triggered the hook. For the time being, run order is officially undefined. apg Andrew Gregory (4): move strtim to util-common move ini parser into common wip add hooks add example hooks hooks/checkboot.hook | 17 +++ hooks/chec

[pacman-dev] [PATCH 1/4] move strtim to util-common

2015-07-04 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- src/common/util-common.c | 39 +++ src/common/util-common.h | 2 ++ src/pacman/ini.c | 2 +- src/pacman/util.c| 39 --- src/pacman/util.h| 1 - src/util/pactree.c

Re: [pacman-dev] [PATCH 04/13] libalpm: handle both .db and .files extensions

2015-06-23 Thread Andrew Gregory
On 06/24/15 at 09:08am, Allan McRae wrote: > On 24/06/15 02:04, Andrew Gregory wrote: > > On 06/23/15 at 11:03pm, Allan McRae wrote: > >> On 20/06/15 23:29, Andrew Gregory wrote: > >>> On 06/20/15 at 05:42pm, Allan McRae wrote: > >>>> Reads from the .db

Re: [pacman-dev] [PATCH 04/13] libalpm: handle both .db and .files extensions

2015-06-23 Thread Andrew Gregory
On 06/23/15 at 11:03pm, Allan McRae wrote: > On 20/06/15 23:29, Andrew Gregory wrote: > > On 06/20/15 at 05:42pm, Allan McRae wrote: > >> Reads from the .db or .files database depending on the flags in the handle. > >> > >> Signed-off-by: Allan McRae >

Re: [pacman-dev] [PATCH 04/13] libalpm: handle both .db and .files extensions

2015-06-20 Thread Andrew Gregory
On 06/20/15 at 05:42pm, Allan McRae wrote: > Reads from the .db or .files database depending on the flags in the handle. > > Signed-off-by: Allan McRae > --- > lib/libalpm/be_sync.c | 23 +-- > lib/libalpm/db.c | 10 -- > 2 files changed, 25 insertions(+), 8 dele

Re: [pacman-dev] [PATCH 03/13] Add files option to handle

2015-06-20 Thread Andrew Gregory
On 06/20/15 at 05:42pm, Allan McRae wrote: > This option will be used to determine if the .files database should be used > for reading sync information. > > Signed-off-by: Allan McRae > --- > lib/libalpm/alpm.h | 3 +++ > lib/libalpm/handle.c | 13 + > lib/libalpm/handle.h | 1 +

Re: [pacman-dev] [PATCH] Return 17 if a package/group has been built.

2015-05-22 Thread Andrew Gregory
On 05/22/15 at 03:07pm, fbt wrote: > A specific exit code to distinguish failed builds and refusal to build > because the package/group has already been built. > Useful in autobuild scripts. > > Signed-off-by: Jack L. Frost Would it not make more sense to just return 0 for this? Presumably if a

Re: [pacman-dev] [PATCH 5/6] makepkg: put further restrictions on pkgbase

2015-05-12 Thread Andrew Gregory
On 05/13/15 at 12:02am, Allan McRae wrote: > pkgbase should be subject to the same restrictions as pkgver s/pkgver/pkgname/ ? > Signed-off-by: Allan McRae > --- > doc/PKGBUILD.5.txt | 6 -- > scripts/libmakepkg/lint_pkgbuild/pkgbase.sh.in | 9 + > 2 files

Re: [pacman-dev] Duplicated lines of "downloading foo.db..." with --noprogressbar

2015-05-05 Thread Andrew Gregory
On 05/06/15 at 12:32am, David Macek wrote: > On 4. 5. 2015 14:55, Andrew Gregory wrote: > > I don't think this is the right solution. The comments in > > dload_progress_cb suggest that the callback is not intended to be > > called until we have actually downloaded

Re: [pacman-dev] makepkg, bsdtar and non-ASCII user/group names

2015-05-05 Thread Andrew Gregory
On 05/05/15 at 09:20pm, David Macek wrote: > Hey everyone. Can someone help me understand why makepkg sets > `LANG=C` for invoking bsdtar? According to dreisner, the change was > introduced in 537a335cc724a5c7c, but the commit message there only > explains what the change does, not how it does it:

Re: [pacman-dev] Duplicated lines of "downloading foo.db..." with --noprogressbar

2015-05-04 Thread Andrew Gregory
On 05/04/15 at 02:47pm, Allan McRae wrote: > On 23/04/15 06:27, David Macek wrote: > > Hello everyone. I see a problem with --noprogressbar output, but it seems > > to be dependent on server/network. Can anyone confirm with the following > > settings? > > > > # append to pacman.conf > > [mingw64

Re: [pacman-dev] [PATCH] package.c: prettify package size printing

2015-04-11 Thread Andrew Gregory
On 04/10/15 at 12:42am, Ganesh Ajjanagadde wrote: > Unnecessary whitespace after the colon in the package size field is > removed by left-justifying the size value. > > Signed-off-by: Ganesh Ajjanagadde > --- Why keep the width specifier if you want to left-justify the field? Having the extra sp

[pacman-dev] [PATCH 1/4] merge _alpm_logaction into alpm_logaction

2015-04-11 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- lib/libalpm/log.c | 36 +--- lib/libalpm/util.c | 44 lib/libalpm/util.h | 3 --- 3 files changed, 29 insertions(+), 54 deletions(-) diff --git a/lib/libalpm/log.c b/lib/libalpm

[pacman-dev] [PATCH 2/4] alpm_logaction: check logfile before opening

2015-04-11 Thread Andrew Gregory
valgrind does not like calling open(NULL, ...). This also makes the return value 0 if logfile has not been set. Signed-off-by: Andrew Gregory --- lib/libalpm/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index fceb96f..c049bf9

[pacman-dev] [PATCH 4/4] alpm_logaction: implement documented return value

2015-04-11 Thread Andrew Gregory
"return 0 on success, -1 on error (pm_errno is set accordingly)" Signed-off-by: Andrew Gregory --- lib/libalpm/log.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index 602dd37..4383735 100644

[pacman-dev] [PATCH 3/4] alpm_logaction: allow falling back to syslog

2015-04-11 Thread Andrew Gregory
Even if opening the log file fails, if a user has enabled syslog we may still be able to log to that. Set the error return value and continue instead of bailing out. Signed-off-by: Andrew Gregory --- lib/libalpm/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib

Re: [pacman-dev] [PATCH v3 2/2] Add makepkg option --packagelist; fix bug #42150

2015-03-25 Thread Andrew Gregory
On 03/25/15 at 03:09pm, Allan McRae wrote: > On 21/03/15 10:19, joyfulg...@archlinux.us wrote: > > From: Ivy Foster > > > > makepkg --packagelist prints the name of each package that would > > normally be produced, minus $PKGEXT, and exits. > > > > Signed-off-by: Ivy Foster > > --- > > Delete

[pacman-dev] [PATCH] close stdin before running install scripts

2015-03-25 Thread Andrew Gregory
libalpm does not guarantee that script output will be presented to the user or that stdin will be connected to a terminal. Close stdin so that scripts do not attempt to use it for user interaction. Signed-off-by: Andrew Gregory --- https://bbs.archlinux.org/viewtopic.php?id=194200 lib

[pacman-dev] [PATCH 2/2] be_package: fallback to standard filelist loading

2015-03-25 Thread Andrew Gregory
file system. In order to allow alpm to recover in this situation, read the mtree data into a temporary filelist that is only copied over to the package if the entire read is successful. [1] https://github.com/libarchive/libarchive/commit/661684170b970ef7d6eff135b57e58a537e8bc53 Signed-off-by: A

[pacman-dev] [PATCH 1/2] add_entry_to_files_list: pass filelist directly

2015-03-25 Thread Andrew Gregory
Allows entries to be added to arbitrary filelists not connected to a package. Signed-off-by: Andrew Gregory --- lib/libalpm/be_package.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index e284254

Re: [pacman-dev] [PATCH] remove: use strcmp for files in skip_remove

2015-03-02 Thread Andrew Gregory
On 03/03/15 at 04:10pm, Allan McRae wrote: > On 30/11/14 09:02, Andrew Gregory wrote: > > Paths from noupgrade, the transaction skip_remove, and package backup > > lists were combined into a single list matched using fnmatch causing > > paths with glob characters to

[pacman-dev] [PATCH] sync200.py.in: remove unused substitution

2015-02-08 Thread Andrew Gregory
LIBCURL was never set in the Makefile so XferCommand was always being set in the test file. This removes the only substitution in our test files which will prevent the TESTS file from being rebuilt every time configure is run. Signed-off-by: Andrew Gregory --- Makefile.am

Re: [pacman-dev] [PATCH] Add AM_MAINTAINER_MODE to configure.ac and disable by default

2015-02-08 Thread Andrew Gregory
On 02/09/15 at 12:44pm, Allan McRae wrote: > On 09/02/15 12:27, Jan Alexander Steffens wrote: > > On Mon, Feb 9, 2015 at 2:45 AM, Allan McRae wrote: > >> Are there objections to applying this patch - at least until a proper > >> solution is found? > > > > A few years ago there was a bit of drama

Re: [pacman-dev] [libalpm] Installing and removing a package in the same handle lifecycle

2015-02-08 Thread Andrew Gregory
On 02/06/15 at 09:13pm, Fabien Bourigault wrote: > Hi, > I'm a PackageKit alpm backend contributor and I found a strange behavior > when removing a package in the same alpm_handle_t lifecycle. Here you have > the simplified workflow : > > alpm initialization > new transaction > install inkscape >

[pacman-dev] [PATCH] set package origin when adding to db cache

2015-02-08 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- lib/libalpm/db.c | 4 1 file changed, 4 insertions(+) diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index cef6c11..d679d8b 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -579,6 +579,10 @@ int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t

Re: [pacman-dev] [PATCH] zsh completion: get installed packages with pacman -Qq

2015-02-07 Thread Andrew Gregory
On 02/08/15 at 02:30am, Roma Kovalev wrote: > Currently _pacman_completions_installed_packages() globs the directory > @localstatedir@/lib/pacman/local/, this does not respect changes to DBPath in > /etc/pacman.conf, which cause completion to stop working. Instead of globbing > $(pacman -Qq) can be

Re: [pacman-dev] [PATCH] Disable directory ownership warnings

2015-02-03 Thread Andrew Gregory
On 02/04/15 at 02:53pm, Allan McRae wrote: > There was a lot of confusion regarding these warnings, particularly for > packages that create users post_install and then chown the directories. > > Signed-off-by: Allan McRae > --- add.c: In function ‘extract_single_file’: add.c:231:9: error: unus

Re: [pacman-dev] updpkgsums deletes more variables than it should

2015-02-03 Thread Andrew Gregory
On 02/03/15 at 02:27pm, David Macek wrote: > Hi all. > > It seems to me that updpkgsums destroys variables that it should > not, specifically those with a suffix, e.g. "md5sums_extra". > > This is the regex in question: > /^[[:blank:]]*(md|sha)[[:digit:]]+sums(_[^=]+)?=/,/\)[[:blank:]]*(#.*)?$/ >

Re: [pacman-dev] [RFC] Correct directory permissions if the extracting package is the only owner

2015-02-02 Thread Andrew Gregory
On 02/01/15 at 09:09pm, Allan McRae wrote: > Adjusting permissions of directories in their install scripts results in > warnings such as the following when the package update: > > warning: directory ownership differs on /var/lib/postfix/ > filesystem: 73:0 package: 0:0 > > If the package being in

Re: [pacman-dev] Directory permission warnings

2015-01-31 Thread Andrew Gregory
On 01/31/15 at 11:56pm, Allan McRae wrote: > It seems people are getting really confused with the directory > permission warnings that makepkg prints when upgrading a package that > changes some permissions in its install script. > > There are a few ways to deal with this: > > 1) some packages ha

[pacman-dev] [PATCH] trans_commit: restore pm_errno after updating log

2015-01-26 Thread Andrew Gregory
If the call to alpm_logaction failed it would overwrite pm_errno, leading to error messages unrelated to the actual reason the transaction failed. Signed-off-by: Andrew Gregory --- Intended for maint. lib/libalpm/trans.c | 4 1 file changed, 4 insertions(+) diff --git a/lib/libalpm

[pacman-dev] [PATCH 2/3] always notify download callback when finished

2015-01-25 Thread Andrew Gregory
Move the final call outside of curl's progress callback so that we can notify our callback of completion even if the download size was unknown or we encounter an error. Forces download total >= 0 within the callback so that it can be used to indicate a download error. Signed-off-by

[pacman-dev] [PATCH 1/3] dload_progress_cb: cast values to off_t up front

2015-01-25 Thread Andrew Gregory
We only ever use them as off_t, so do the conversion early and avoid the need for multiple casts and DOUBLE_EQ. Signed-off-by: Andrew Gregory --- lib/libalpm/dload.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index

[pacman-dev] [PATCH 3/3] show progress bar when download size is unknown

2015-01-25 Thread Andrew Gregory
which point it will be filled in. Signed-off-by: Andrew Gregory --- Issue discussed here: https://bbs.archlinux.org/viewtopic.php?id=192604 lib/libalpm/dload.c | 2 +- src/pacman/callback.c | 61 +-- 2 files changed, 45 insertions(+), 18 deletions

[pacman-dev] [PATCH] initialize pointers passed to _alpm_pkg_dup

2015-01-01 Thread Andrew Gregory
_alpm_pkg_dup leaves the destination pointer unaltered in case of fatal errors, so when commits 2f0ca00e and be4198b3 freed the pointer, they fixed a memory leak on non-fatal errors by replacing it with a segmentation fault on fatal errors. Signed-off-by: Andrew Gregory --- lib/libalpm/db.c

[pacman-dev] [PATCH] be_package.c: fix style violation

2015-01-01 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- lib/libalpm/be_package.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index 2d42465..06b24a8 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -437,6 +437,7

Re: [pacman-dev] [PATCH 1/1] makepkg: relax package building for new directory symlink handling

2014-12-31 Thread Andrew Gregory
On 12/31/14 at 03:45pm, Christian Hesse wrote: > From: Christian Hesse > > pacman changed directory symlink handling, resulting some packages to > fail installing with conflicts. This relaxes the situation as symlinks > are created before package() and removed after, resulting in file always > be

Re: [pacman-dev] [PATCH 8/9] ini.c: remove useless key check

2014-12-28 Thread Andrew Gregory
On 12/29/14 at 02:13pm, Allan McRae wrote: > On 27/04/14 09:57, Andrew Gregory wrote: > > key points to a statically allocated string, it can't be NULL. > > > > It looks like this is supposed to lines like: > [] > > in the config file. > > Sho

Re: [pacman-dev] [PATCH 7/9] ini.c: remove empty section name restriction

2014-12-28 Thread Andrew Gregory
On 12/29/14 at 02:07pm, Allan McRae wrote: > On 27/04/14 09:57, Andrew Gregory wrote: > > Signed-off-by: Andrew Gregory > > --- > > Why? This seems a reasonable restriction. To move the error handling out of the ini parser. alpm will already reject an empty db nam

Re: [pacman-dev] [PATCH v5] Add testrunner for makepkg-template

2014-12-28 Thread Andrew Gregory
On 12/28/14 at 06:17pm, Florian Pritz wrote: > Signed-off-by: Florian Pritz > --- > > v5: > - remove wrong comment > - look for the executable in PATH > - exit after tap_bail > > Makefile.am| 2 + > test/scripts/Makefile.am |

Re: [pacman-dev] [PATCH v4 01/11] Add testrunner for makepkg-template

2014-12-28 Thread Andrew Gregory
On 12/28/14 at 04:23pm, Florian Pritz wrote: > Signed-off-by: Florian Pritz > --- > > v4: > - adjusted to tap.sh > - move expected output/result/exitcode/arguments into a single file called >testcase-config > - removed line number removal code (depends on "[PATCH] makepkg-template: >Re

Re: [pacman-dev] [PATCH 2/3] use tap.sh for bash tests

2014-12-27 Thread Andrew Gregory
On 12/27/14 at 05:03pm, Allan McRae wrote: > On 25/12/14 08:27, Andrew Gregory wrote: > > On 12/24/14 at 04:07pm, Allan McRae wrote: > >> On 24/12/14 07:53, Andrew Gregory wrote: > >>> tap.sh is a reusable TAP library that handles test counting and provides > >&

Re: [pacman-dev] [PATCH 2/3] use tap.sh for bash tests

2014-12-24 Thread Andrew Gregory
On 12/24/14 at 04:07pm, Allan McRae wrote: > On 24/12/14 07:53, Andrew Gregory wrote: > > tap.sh is a reusable TAP library that handles test counting and provides > > useful diagnostic messages on test failures. > > > > Signed-off-by: Andrew Gregory > > --

[pacman-dev] [PATCH 1/3] add vim modeline to test files

2014-12-23 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- test/scripts/human_to_size_test.sh | 2 ++ test/scripts/parseopts_test.sh | 2 ++ test/util/pacsorttest.sh | 2 ++ test/util/vercmptest.sh| 2 ++ 4 files changed, 8 insertions(+) diff --git a/test/scripts/human_to_size_test.sh b/test

[pacman-dev] [PATCH 3/3] add tap_ prefix to test helper functions

2014-12-23 Thread Andrew Gregory
Allows tap.sh to show the line number where the helper function was called on failures. Signed-off-by: Andrew Gregory --- test/scripts/human_to_size_test.sh | 34 +++--- test/scripts/parseopts_test.sh | 56 +++ test/util/pacsorttest.sh | 54

[pacman-dev] [PATCH 2/3] use tap.sh for bash tests

2014-12-23 Thread Andrew Gregory
tap.sh is a reusable TAP library that handles test counting and provides useful diagnostic messages on test failures. Signed-off-by: Andrew Gregory --- I'm maintaining tap.sh outside of pacman (hence the MIT license) at https://github.com/andrewgregory/tap.sh Documentation is available

Re: [pacman-dev] [PATCH v2] Add testrunner for makepkg-template

2014-12-21 Thread Andrew Gregory
On 12/21/14 at 04:43pm, Florian Pritz wrote: > Signed-off-by: Florian Pritz > --- > > v2: > - use a temp dir for output files > - mark the exit code in the expected_output file with "exitcode: " >(tests are adjusted on my working branch) > > Makefile.am | 2 + >

[pacman-dev] [PATCH] remove.c: honor inverted patterns in noupgrade

2014-11-29 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- lib/libalpm/remove.c| 4 ++-- test/pacman/tests/TESTS | 1 + test/pacman/tests/noupgrade-inverted.py | 19 +++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 test/pacman/tests/noupgrade

[pacman-dev] [PATCH] remove: use strcmp for files in skip_remove

2014-11-29 Thread Andrew Gregory
Paths from noupgrade, the transaction skip_remove, and package backup lists were combined into a single list matched using fnmatch causing paths with glob characters to match unrelated files. Signed-off-by: Andrew Gregory --- lib/libalpm/remove.c | 82

[pacman-dev] [PATCH] add alpm_option_match_noupgrade

2014-11-29 Thread Andrew Gregory
For parity with alpm_option_match_noextract. Signed-off-by: Andrew Gregory --- lib/libalpm/alpm.h | 1 + lib/libalpm/handle.c | 5 + 2 files changed, 6 insertions(+) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 234bd6b..e6ef3ae 100644 --- a/lib/libalpm/alpm.h +++ b/lib

Re: [pacman-dev] [PATCH] pacsort: only look at versions in file mode

2014-11-17 Thread Andrew Gregory
On 11/17/14 at 10:45am, Dave Reisner wrote: > alpm_pkg_vercmp rightfully considers foo-1-1 to be newer than foo-1:1-1 > because of the leading characters. So, in file mode, pacsort must > necessarily ignore the package name when performing comparisons. Create > a struct, for convenience, which over

Re: [pacman-dev] [PATCH 2/3] Optionally pass root path to fnmatch_patterns

2014-11-17 Thread Andrew Gregory
On 11/17/14 at 11:33pm, Allan McRae wrote: > When the system root is passed to fnmatch_patterns, it is stripped from > the start of the string before comparisions are made. > > Signed-off-by: Allan McRae > --- > lib/libalpm/add.c| 4 ++-- > src/common/util-common.c | 9 - > src/c

Re: [pacman-dev] [PATCH 1/3] Make (_alpm_)fnmatch_patterns available to front-end

2014-11-17 Thread Andrew Gregory
On 11/17/14 at 11:33pm, Allan McRae wrote: > This function will be useful in determining if any files are in the NoExtract > array when checking for missing files. > > Signed-off-by: Allan McRae > --- > lib/libalpm/add.c| 4 ++-- > lib/libalpm/util.c | 31 -

Re: [pacman-dev] [PATCH] Ensure filelist realloc uses positive size

2014-11-17 Thread Andrew Gregory
On 11/18/14 at 12:51am, Allan McRae wrote: > A corrupt local db filelist could result in a realloc of size zero. Maybe I'm missing something... Calling realloc with size zero should free the memory and return NULL, which seems like the right thing to do if there are no files. > Signed-off-by: Al

Re: [pacman-dev] [PATCH 2/2] Add --assume-installed to shell completion

2014-11-04 Thread Andrew Gregory
On 11/04/14 at 08:40pm, Florian Pritz wrote: > Signed-off-by: Florian Pritz > --- > > I tested the zsh completion, didn't test bash. > > contrib/bash_completion.in | 6 +++--- > contrib/zsh_completion.in | 2 ++ > 2 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/contrib/bash_

Re: [pacman-dev] [PATCH] makepkg: Use a recursive, shallow clone for git://

2014-10-28 Thread Andrew Gregory
On 10/28/14 at 07:02pm, Drew DeVault wrote: > On 10/28/2014 06:55 PM, Dave Reisner wrote: > >>> Does this work with URLs like: > >>> > >>> git://example.com/repo.git?tag=v1.2.3 > >> > >> Those don't work with makepkg as it stands now. It doesn't work after > >> this patch is applied, either. If w

[pacman-dev] [PATCH 2/4] pmtest: make test paths easily available to tests

2014-10-23 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- test/pacman/pmtest.py | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py index 5a79919..4991971 100644 --- a/test/pacman/pmtest.py +++ b/test/pacman/pmtest.py @@ -40,10 +40,10

[pacman-dev] [PATCH 1/4] pacman-db-upgrade: fix --config option typo

2014-10-23 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- scripts/pacman-db-upgrade.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pacman-db-upgrade.sh.in b/scripts/pacman-db-upgrade.sh.in index f9bd101..2fced9b 100644 --- a/scripts/pacman-db-upgrade.sh.in +++ b/scripts/pacman-db

[pacman-dev] [PATCH 3/4] tests/pacman-db-upgrade-v9: set additional paths

2014-10-23 Thread Andrew Gregory
--config does not respect root, causing pacman-db-upgrade to read the local pacman.conf rather than the one in the test root. Also add a rule to ensure the ALPM_DB_VERSION file is actually being created. Signed-off-by: Andrew Gregory --- test/scripts/pacman-db-upgrade-v9.py | 6 +- 1 file

[pacman-dev] [PATCH 4/4] add pacman-db-upgrade-v9.py to check_SCRIPTS

2014-10-23 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- test/scripts/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/test/scripts/Makefile.am b/test/scripts/Makefile.am index 5dca9a4..8d6bc84 100644 --- a/test/scripts/Makefile.am +++ b/test/scripts/Makefile.am @@ -1,5 +1,6 @@ check_SCRIPTS

[pacman-dev] [PATCH] testdb: ignore ALPM_DB_VERSION

2014-10-15 Thread Andrew Gregory
Replaces the test for hidden files which appears to be leftover from 2e431e1cc before sync db checking was moved to a separate function. Signed-off-by: Andrew Gregory --- src/util/testdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/testdb.c b/src/util/testdb.c

Re: [pacman-dev] [PATCH 6/6] add pacman-db-upgrade test

2014-10-12 Thread Andrew Gregory
On 10/13/14 at 01:32pm, Allan McRae wrote: > On 08/10/14 16:39, Andrew Gregory wrote: > > Signed-off-by: Andrew Gregory > > make PY_LOG_FLAGS=--valgrind check > > not ok 9 - FILE_EMPTY=var/log/valgrind > > > How do I run this individually to get the conten

[pacman-dev] [PATCH] sync.c: download packages before starting commit

2014-10-11 Thread Andrew Gregory
in the log with no matching transaction end. Signed-off-by: Andrew Gregory --- lib/libalpm/sync.c | 11 --- lib/libalpm/sync.h | 1 + lib/libalpm/trans.c | 10 ++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 9fe4ef

[pacman-dev] [PATCH 6/6] add pacman-db-upgrade test

2014-10-07 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- Makefile.am | 1 + test/scripts/pacman-db-upgrade-v9.py | 21 + valgrind.supp| 7 +++ 3 files changed, 29 insertions(+) create mode 100644 test/scripts/pacman-db-upgrade-v9.py diff

[pacman-dev] [PATCH 5/6] pmtest: allow tests to specify test binary

2014-10-07 Thread Andrew Gregory
-off-by: Andrew Gregory --- Makefile.am| 3 ++- test/pacman/pactest.py | 16 ++-- test/pacman/pmenv.py | 3 ++- test/pacman/pmtest.py | 23 ++- test/pacman/util.py| 5 +++-- 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a

[pacman-dev] [PATCH 4/6] pacman: add --confirm option

2014-10-07 Thread Andrew Gregory
--confirm cancels the effect of a previous --noconfirm. This makes it easier for scripts to default to --noconfirm but allow users to override it. Signed-off-by: Andrew Gregory --- doc/pacman.8.txt | 3 +++ src/pacman/conf.h | 1 + src/pacman/pacman.c | 5 + test/pacman/pmtest.py

[pacman-dev] [PATCH 2/6] pmrule: make backup file test more robust

2014-10-07 Thread Andrew Gregory
This prevents an exception in the event backup entries are not in the correct format and brings the test in line with alpm's backup parsing which splits on the last tab rather than the first. Signed-off-by: Andrew Gregory --- test/pacman/pmrule.py | 10 -- 1 file changed, 4 inser

[pacman-dev] [PATCH 3/6] pmtest: allow tests to specify db version

2014-10-07 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- test/pacman/pmtest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py index 09baac7..7ed30eb 100644 --- a/test/pacman/pmtest.py +++ b/test/pacman/pmtest.py @@ -37,6 +37,7 @@ def __init__(self

[pacman-dev] [PATCH 1/6] pmdb: include directories in package file lists

2014-10-07 Thread Andrew Gregory
Needed for checking directories with PKG_FILES. Signed-off-by: Andrew Gregory --- test/pacman/pmdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py index 60e0e9c..aa14dff 100644 --- a/test/pacman/pmdb.py +++ b/test/pacman/pmdb.py

[pacman-dev] [PATCH] pacman-db-upgrade: do not mangle file lists

2014-10-06 Thread Andrew Gregory
grep'ing out blank lines and sorting output thoroughly breaks any file lists with %BACKUP% entries which must be separated from the file list by a blank line. Adds a custom function to ensure that all paths printed are non-empty and unique. Signed-off-by: Andrew Gregory --- My dbupgrade b

Re: [pacman-dev] [PATCH] pacman-db-upgrade: do not mangle file lists

2014-10-04 Thread Andrew Gregory
On 10/05/14 at 02:25pm, Allan McRae wrote: > On 03/10/14 06:35, Andrew Gregory wrote: > > grep'ing out blank lines and sorting output thoroughly breaks any file > > lists with %BACKUP% entries which must be separated from the file list > > by a blank line. > > &

Re: [pacman-dev] [PATCH] pacman-db-upgrade: do not mangle file lists

2014-10-03 Thread Andrew Gregory
On 10/03/14 at 08:48am, Dave Reisner wrote: > On Thu, Oct 02, 2014 at 04:35:52PM -0400, Andrew Gregory wrote: > > grep'ing out blank lines and sorting output thoroughly breaks any file > > lists with %BACKUP% entries which must be separated from the file list > > by a b

[pacman-dev] [PATCH] pacman-db-upgrade: do not mangle file lists

2014-10-02 Thread Andrew Gregory
grep'ing out blank lines and sorting output thoroughly breaks any file lists with %BACKUP% entries which must be separated from the file list by a blank line. Signed-off-by: Andrew Gregory --- Anybody who has replaced an owned directory with a symlink and run pacman-db-upgrade has mangle

[pacman-dev] [PATCH 7/7] extract_single_file: consolidate extraction logic

2014-10-01 Thread Andrew Gregory
Also adds checks that the filename does not exceed PATH_MAX. Signed-off-by: Andrew Gregory --- lib/libalpm/add.c | 133 -- 1 file changed, 60 insertions(+), 73 deletions(-) diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 3509100

[pacman-dev] [PATCH 6/7] extract_single_file: use .pacnew for check files

2014-10-01 Thread Andrew Gregory
Prevents the need to rename the file if we end up keeping it and ensures that pacnew files always reflect the most recent version by overwriting stale copies. Signed-off-by: Andrew Gregory --- lib/libalpm/add.c | 40 +--- 1 file changed, 13 insertions(+), 27

[pacman-dev] [PATCH 4/7] extract_single_file: use full path in messages

2014-10-01 Thread Andrew Gregory
If an error occurs the actual path being extracted is more useful than the original path from the package file list. The original path is still used for checks that use it directly. Signed-off-by: Andrew Gregory --- lib/libalpm/add.c | 31 +-- 1 file changed, 13

[pacman-dev] [PATCH 2/7] extract_single_file: reduce indentation

2014-10-01 Thread Andrew Gregory
Puts all of the conflict cases at the same level. Signed-off-by: Andrew Gregory --- This is almost entirely whitespace reduction; the actual changes are much more visible with --ignore-space-change. lib/libalpm/add.c | 106 ++ 1 file changed

[pacman-dev] [PATCH 1/7] extract_single_file: consolidate needbackup checks

2014-10-01 Thread Andrew Gregory
We need to know if a file needs to be backed up for all extracted files. Signed-off-by: Andrew Gregory --- lib/libalpm/add.c | 53 ++--- 1 file changed, 14 insertions(+), 39 deletions(-) diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index

[pacman-dev] [PATCH 3/7] extract_single_file: factor out db file extraction

2014-10-01 Thread Andrew Gregory
alpm's database files (.INSTALL, .MTREE, etc.) should be extracted no matter what; skip mtree/needbackup/noextract/noupgrade checks for them. Signed-off-by: Andrew Gregory --- lib/libalpm/add.c | 60 +-- 1 file changed, 32 insertions(+

[pacman-dev] [PATCH 0/7] [RFC] extract_single_file cleanup

2014-10-01 Thread Andrew Gregory
directly to .pacnew instead of .paccheck This takes extract_single_file down from 340 lines to 225 and considerably reduces the number of nested conditionals Andrew Gregory (7): extract_single_file: consolidate needbackup checks extract_single_file: reduce indentation extract_single_file

[pacman-dev] [PATCH 5/7] remove support for .pacorig files

2014-10-01 Thread Andrew Gregory
Leave user files in place and save new config files with a .pacnew extension. This reduces the complexity of file extraction and respects the principle that pacman shouldn't modify files it didn't create. Signed-off-by: Andrew Gregory --- contrib/README | 2 +

Re: [pacman-dev] [PATCH] doc/translation-help.txt: Fix link to tutorial on sarovar.org

2014-09-30 Thread Andrew Gregory
On 09/30/14 at 04:24pm, Miguel de Val-Borro wrote: > The website sarovar.org has been shut down. Link is replaced by the latest > available archive.org capture from August 2013. > > Signed-off-by: Miguel de Val-Borro > --- > doc/translation-help.txt | 2 +- > 1 file changed, 1 insertion(+), 1 de

Re: [pacman-dev] [PATCH 3/3] _alpm_key_in_keychain: cache known keys

2014-09-30 Thread Andrew Gregory
On 09/30/14 at 03:24pm, Andrew Gregory wrote: > Implements FS#38042 > > Signed-off-by: Andrew Gregory > --- > lib/libalpm/handle.c | 5 + > lib/libalpm/handle.h | 4 > lib/libalpm/signing.c | 6 ++ > 3 files changed, 15 insertions(+) > > diff --gi

[pacman-dev] [PATCH 1/3] remove retry check from signature validation

2014-09-30 Thread Andrew Gregory
The retry path was removed by 4ccf16dff589ce9f369d377bb5d3f490bd27c624 Signed-off-by: Andrew Gregory --- lib/libalpm/sync.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 4c74a3a..27e720d 100644 --- a/lib/libalpm

[pacman-dev] [PATCH 3/3] _alpm_key_in_keychain: cache known keys

2014-09-30 Thread Andrew Gregory
Implements FS#38042 Signed-off-by: Andrew Gregory --- lib/libalpm/handle.c | 5 + lib/libalpm/handle.h | 4 lib/libalpm/signing.c | 6 ++ 3 files changed, 15 insertions(+) diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 0d8ea34..0dd0e7f 100644 --- a/lib/libalpm

[pacman-dev] [PATCH 2/3] check_keyring: skip keys known to be missing

2014-09-30 Thread Andrew Gregory
Signed-off-by: Andrew Gregory --- lib/libalpm/sync.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 27e720d..b6b225d 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -1074,10 +1074,9 @@ static int check_keyring

Re: [pacman-dev] [PATCHv2] avoid line wrapping if not in a tty or COLUMNS=0

2014-09-28 Thread Andrew Gregory
On 08/11/14 at 12:42pm, Andrew Gregory wrote: > Scripts that parse pacman's output (like pacsearch) generally do not > want wrapped lines. > > Signed-off-by: Andrew Gregory > --- > > * move isatty check to getcols_fd allowing COLUMNS to override > * allow COLUMNS=0

[pacman-dev] [PATCH] Revert "Remove log_cb, add ALPM_EVENT_LOG instead"

2014-09-28 Thread Andrew Gregory
Moving logging to the event callback caused warnings under clang due to non-literal format strings and silenced all log messages when --print was used. This reverts commit cd793c5ab7689cc8cbc18277375b368060e5acfe. Signed-off-by: Andrew Gregory Conflicts: lib/libalpm/alpm.h src

[pacman-dev] [PATCH 1/2] makepkg: do not strip bzr+ from bzr+ssh urls

2014-09-23 Thread Andrew Gregory
bzr does not recognize bare ssh:// urls. Fixes FS#41811 Signed-off-by: Andrew Gregory --- scripts/makepkg.sh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 913c901..f58afda 100644 --- a/scripts/makepkg.sh.in +++ b

[pacman-dev] [PATCH 2/2] makepkg: only strip vcs prefixes from front of url

2014-09-23 Thread Andrew Gregory
Referenced by FS#41811 Signed-off-by: Andrew Gregory --- scripts/makepkg.sh.in | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index f58afda..894d9e5 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in

Re: [pacman-dev] [PATCH 4/4 v2] Check the version of the local database during validation

2014-09-22 Thread Andrew Gregory
On 09/22/14 at 10:45pm, Allan McRae wrote: > When we check the database version directly, there is no longer a > need to scan for depends files. > > Signed-off-by: Allan McRae > --- > > It is much easier to look at the before and after here instead of the patch > directly. > > lib/libalpm/be_

Re: [pacman-dev] [PATCH 1/4 v2] Create local database directory if it is missing

2014-09-22 Thread Andrew Gregory
On 09/22/14 at 10:44pm, Allan McRae wrote: > This means that a missing local database becomes an error (as it > should be immediately created). Note this only creates the "local" > directory and not its parent, which is checked for during locking. > > Signed-off-by: Allan McRae > --- > lib/liba

<    1   2   3   4   5   6   7   8   9   10   >