[pacman-dev] [PATCH 1/2] makepkg: fix .PKGINFO/.BUILDINFO files swallowing status printing
The respective write_* functions are low-level and shouldn't be outputting statuses; move these to the logic flow where they are used. This ensures the functions can be used in the future wherever, and also solves an issue where, as fallout from the message.sh retrofitting in commit 882e707e40bbade0111cf3bdedbdac4d4b70453b, the statuses got redirected to the actual files. The resulting package was technically correct, except that it contained useless lines which pacman ignored, and repo-add also ignored but at the same time generated an error message: /usr/bin/repo-add: line 335: declare: `=-> Generating .PKGINFO file...': not a valid identifier Thirdparty package tools with stricter parsers may abort with errors, and "repose" is known to do so. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> --- scripts/makepkg.sh.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 87253883..3ac03d11 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -634,7 +634,6 @@ write_pkginfo() { merge_arch_attrs - msg2 "$(gettext "Generating %s file...")" ".PKGINFO" printf "# Generated by makepkg %s\n" "$makepkg_version" printf "# using %s\n" "$(fakeroot -v)" @@ -672,8 +671,6 @@ write_pkginfo() { } write_buildinfo() { - msg2 "$(gettext "Generating %s file...")" ".BUILDINFO" - write_kv_pair "format" "1" write_kv_pair "pkgname" "$pkgname" @@ -728,7 +725,9 @@ create_package() { msg "$(gettext "Creating package \"%s\"...")" "$pkgname" pkgarch=$(get_pkg_arch) + msg2 "$(gettext "Generating %s file...")" ".PKGINFO" write_pkginfo > .PKGINFO + msg2 "$(gettext "Generating %s file...")" ".BUILDINFO" write_buildinfo > .BUILDINFO # check for changelog/install files -- 2.19.1
Currently this prints the following message: ==> Extracting database to a temporary location... ==> Extracting database to a temporary location... This redundancy is potentially confusing and may cause people to think something is wrong. Historically, this message came from a time when we only extracted one database, but repo-add was changed to always create the files database in commit cb0f2bd0385f447e045e2b2aab9ffa55df3c2d8a and whole code block with message intact was moved into a for loop and run (and printed) twice. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> --- scripts/repo-add.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index cff52d4e..bccf2f37 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -543,7 +543,7 @@ prepare_repo_db() { fi fi verify_signature "$dbfile" - msg "$(gettext "Extracting database to a temporary location...")" + msg "$(gettext "Extracting %s to a temporary location...")" "${dbfile##*/}" bsdtar -xf "$dbfile" -C "$tmpdir/$repo" else case $cmd in -- 2.19.1
participants (1)
-
Eli Schwartz