Re: [pacman-dev] [PATCH] Add Eli to current maintainers

2019-11-15 Thread Dan McGee
On Fri, Nov 15, 2019 at 9:49 PM Andrew Gregory 
wrote:

> On 11/16/19 at 12:15am, Allan McRae wrote:
> > Also retire Dan into past major contributors.
>
> ACK.
>

Probably should have happened a long time ago. :)


Re: [pacman-dev] [PATCH] libalpm:Dereference double pointer before assigning NULL.

2019-11-15 Thread Andrew Gregory
On 11/15/19 at 12:03pm, Daniel T. Borelli wrote:
> Hi.
> I believe that the author's intention was to dereference the double
> pointer before assigning it NULL so that it has an effect outside the
> function.
> 
> Signed-off-by: Daniel T. Borelli 
> ---
> 
>  lib/libalpm/signing.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

ACK.  The entire function needs its whitespace fixed too.


Re: [pacman-dev] [PATCH] Handle .part files that are the size of the correct package

2019-11-15 Thread Andrew Gregory
On 11/15/19 at 11:46pm, Allan McRae wrote:
> In rare cases, likely due to a well timed Ctrl+C, but possibly due to a
> broken mirror, a ".part" file may have size at least that of the correct
> package size.
> 
> When encountering this issue, currently pacman fails in different ways
> depending on where the package falls in the list to download.  If last,
> "wrong or NULL argument passed" error is reported, or a "invalid or
> corrupt package" issue if not.
> 
> Capture these .part files, and remove the extension. This lets pacman
> either use the package if valid, or offer to remove it if it fails checksum
> or signature verification.
> 
> Signed-off-by: Allan McRae 
> ---
> 
> To test this patch do:
> 
> mv /var/cache/pacman/pkg/xz-5.2.4-2-x86_64.pkg.tar.xz{,.part}
> pacman -S xz
> 
> 
> Having to run _alpm_filecache_find() in find_dl_candidates() on all packages 
> that
> have download size of 0 is not given we run already it in 
> compute_download_size().
> However, we would require storing it in the alpm_pkg_t struct and I don't 
> think
> that overhead was worth it.  However, we then call _alpm_filecache_find() in 
> check_validity() and load_package()...  Still probably not worth it!
> 
>  lib/libalpm/dload.c |  6 ++
>  lib/libalpm/sync.c  | 14 --
>  2 files changed, 18 insertions(+), 2 deletions(-)

ACK.  This does cause one minor oddity: if the .part is the only
package being installed, pacman prints "::Retrieving packages..." but
then doesn't actually download anything.


Re: [pacman-dev] [PATCH] Add Eli to current maintainers

2019-11-15 Thread Andrew Gregory
On 11/16/19 at 12:15am, Allan McRae wrote:
> Also retire Dan into past major contributors.

ACK.


[pacman-dev] [PATCH] libalpm:Dereference double pointer before assigning NULL.

2019-11-15 Thread Daniel T. Borelli
Hi.
I believe that the author's intention was to dereference the double
pointer before assigning it NULL so that it has an effect outside the
function.

Signed-off-by: Daniel T. Borelli 
---

 lib/libalpm/signing.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index cab31f8e..3c4f883f 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -479,7 +479,7 @@ static int email_from_uid(const char *uid, char
**email) char *start, *end;
 
if (uid == NULL) {
-   email = NULL;
+   *email = NULL;
return -1;
}
 
@@ -492,7 +492,7 @@ static int email_from_uid(const char *uid, char
**email) STRNDUP(*email, start+1, end-start-1, return -1);
return 0;
} else {
-   email = NULL;
+   *email = NULL;
return -1;
}
 }
-- 
2.24.0


[pacman-dev] [PATCH v2] makepkg: add the $startdir to package .BUILDINFO

2019-11-15 Thread Eli Schwartz
This value is needed for reproducible builds. The reason is because
$BUILDDIR changes its behavior depending on whether it is the same as
$startdir, and the result is that we cannot know whether $srcdir (the
path that is potentially embedded into the final package) is actually
"$BUILDDIR/src" or "$BUILDDIR/$pkgbase/src".

Signed-off-by: Eli Schwartz 
---

v2: add documentation and bump the format version. I went with '2'
rather than require a pre-release bump to get a 'real number' which we
might forget, so if anything else gets added in the current patch
release cycle (unlikely?) we can just skip the bumping.

 doc/BUILDINFO.5.asciidoc | 3 +++
 scripts/makepkg.sh.in| 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/doc/BUILDINFO.5.asciidoc b/doc/BUILDINFO.5.asciidoc
index 3db1e12f..bb300e18 100644
--- a/doc/BUILDINFO.5.asciidoc
+++ b/doc/BUILDINFO.5.asciidoc
@@ -53,6 +53,9 @@ BUILDINFO file format.
 *builddir*::
The directory where the package was built.
 
+*startdir*::
+   The directory from which makepkg was executed.
+
 *buildenv (array)*::
The build environment specified in makepkg.conf.
 
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 2deb61da..ca3e7459 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -626,7 +626,7 @@ write_pkginfo() {
 }
 
 write_buildinfo() {
-   write_kv_pair "format" "1"
+   write_kv_pair "format" "2"
 
write_kv_pair "pkgname" "$pkgname"
write_kv_pair "pkgbase" "$pkgbase"
@@ -643,6 +643,7 @@ write_buildinfo() {
write_kv_pair "packager" "${PACKAGER}"
write_kv_pair "builddate" "${SOURCE_DATE_EPOCH}"
write_kv_pair "builddir"  "${BUILDDIR}"
+   write_kv_pair "startdir"  "${startdir}"
write_kv_pair "buildenv" "${BUILDENV[@]}"
write_kv_pair "options" "${OPTIONS[@]}"
 
-- 
2.24.0


[pacman-dev] [PATCH] Add Eli to current maintainers

2019-11-15 Thread Allan McRae
Also retire Dan into past major contributors.

Signed-off-by: Allan McRae 
---
 doc/footer.asciidoc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/footer.asciidoc b/doc/footer.asciidoc
index cdaba40c..1c33d016 100644
--- a/doc/footer.asciidoc
+++ b/doc/footer.asciidoc
@@ -18,14 +18,15 @@ Current maintainers:
 
 * Allan McRae 
 * Andrew Gregory 
-* Dan McGee 
 * Dave Reisner 
+* Eli Schwartz 
 
 Past major contributors:
 
 * Judd Vinet 
 * Aurelien Foret 
 * Aaron Griffin 
+* Dan McGee 
 * Xavier Chantry 
 * Nagy Gabor 
 
-- 
2.24.0


[pacman-dev] [PATCH] Handle .part files that are the size of the correct package

2019-11-15 Thread Allan McRae
In rare cases, likely due to a well timed Ctrl+C, but possibly due to a
broken mirror, a ".part" file may have size at least that of the correct
package size.

When encountering this issue, currently pacman fails in different ways
depending on where the package falls in the list to download.  If last,
"wrong or NULL argument passed" error is reported, or a "invalid or
corrupt package" issue if not.

Capture these .part files, and remove the extension. This lets pacman
either use the package if valid, or offer to remove it if it fails checksum
or signature verification.

Signed-off-by: Allan McRae 
---

To test this patch do:

mv /var/cache/pacman/pkg/xz-5.2.4-2-x86_64.pkg.tar.xz{,.part}
pacman -S xz


Having to run _alpm_filecache_find() in find_dl_candidates() on all packages 
that
have download size of 0 is not given we run already it in 
compute_download_size().
However, we would require storing it in the alpm_pkg_t struct and I don't think
that overhead was worth it.  However, we then call _alpm_filecache_find() in 
check_validity() and load_package()...  Still probably not worth it!

 lib/libalpm/dload.c |  6 ++
 lib/libalpm/sync.c  | 14 --
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index ddcc45f6..40a1d07d 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -414,6 +414,12 @@ static int curl_download_internal(struct dload_payload 
*payload,
 
curl_set_handle_opts(payload, curl, error_buffer);
 
+   if(payload->max_size == payload->initial_size) {
+   /* .part file is complete */
+   ret = 0;
+   goto cleanup;
+   }
+
if(localf == NULL) {
localf = fopen(payload->tempfile_name, 
payload->tempfile_openmode);
if(localf == NULL) {
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 70c37890..97a351fe 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -731,6 +731,8 @@ static int find_dl_candidates(alpm_db_t *repo, alpm_list_t 
**files)
alpm_pkg_t *spkg = i->data;
 
if(spkg->origin != ALPM_PKG_FROM_FILE && repo == 
spkg->origin_data.db) {
+   char *fpath = NULL;
+
if(!repo->servers) {
handle->pm_errno = ALPM_ERR_SERVER_NONE;
_alpm_log(handle, ALPM_LOG_ERROR, "%s: %s\n",
@@ -738,13 +740,21 @@ static int find_dl_candidates(alpm_db_t *repo, 
alpm_list_t **files)
return 1;
}
 
-   if(spkg->download_size != 0) {
+   ASSERT(spkg->filename != NULL, RET_ERR(handle, 
ALPM_ERR_PKG_INVALID_NAME, -1));
+
+   if(spkg->download_size == 0) {
+   /* check for file in cache - allows us to 
handle complete .part files */
+   fpath = _alpm_filecache_find(handle, 
spkg->filename);
+   }
+
+   if(spkg->download_size != 0 || !fpath) {
struct dload_payload *payload;
-   ASSERT(spkg->filename != NULL, RET_ERR(handle, 
ALPM_ERR_PKG_INVALID_NAME, -1));
payload = build_payload(handle, spkg->filename, 
spkg->size, repo->servers);
ASSERT(payload, return -1);
*files = alpm_list_add(*files, payload);
}
+
+   FREE(fpath);
}
}
 
-- 
2.24.0


Re: [pacman-dev] pacman -D --notes="project bar" asar

2019-11-15 Thread Allan McRae
On 15/11/19 3:41 am, Daan van Rossum wrote:
> Dear pacman devs,
> 
> I occasionally miss something like an "Install Notes" field in the pacman 
> database (a variant of "Install Reason") for the installer to leave arbitrary 
> notes that help understand/remember why certain packages exist on a system.


Long standing bug about this:
https://bugs.archlinux.org/task/35455

Allan


[pacman-dev] [GIT] The official pacman repository branch, master, updated. v5.2.1-15-gb9faf652

2019-11-15 Thread Allan McRae
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official pacman repository".

The branch, master has been updated
   via  b9faf652735c603d1bdf849a570185eb721f11c1 (commit)
   via  540b19164b1ab3a4950b4a828fb90d047f4a591d (commit)
  from  27f354a7874b965bf223832bdf9749504cd1a590 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit b9faf652735c603d1bdf849a570185eb721f11c1
Author: Allan McRae 
Date:   Tue Nov 12 16:14:57 2019 +1000

pactest: set package tar format to GNU_FORMAT

python-3.8 changed the default tar format to PAX_FORMAT. This caused
issues in our testsuite with package extraction of files with UTF-8
characters as we run the tests under the C locale.

sycn600.py:
error: error while reading package 
/tmp/pactest-xuhri4xa/var/cache/pacman/pkg/unicodechars-2.0-1.pkg.tar.gz: 
Pathname can't be converted from UTF-8 to current locale.

Set format back to GNU_FORMAT.

Signed-off-by: Allan McRae 

commit 540b19164b1ab3a4950b4a828fb90d047f4a591d
Author: Allan McRae 
Date:   Tue Nov 12 07:29:52 2019 +1000

libalpm/sync.c: Do not download missing keys multiple times

We now store key structs of our missing key info, so can not search the list
for string matches. This caused missing keys to be downloaded once for every
package they signed.

Signed-off-by: Allan McRae 

---

Summary of changes:
 lib/libalpm/sync.c   | 12 ++--
 test/pacman/pmpkg.py |  2 +-
 2 files changed, 11 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
The official pacman repository