[arch-projects] [dbscripts] [PATCH v2 3/3] Update messages to make fuller use of printf formatters

Eli Schwartz eschwartz at archlinux.org
Mon Feb 26 23:00:04 UTC 2018


On 02/26/2018 05:14 PM, Luke Shumaker wrote:
> On Mon, 26 Feb 2018 00:46:48 -0500,
> Eli Schwartz wrote:
>>> +++ b/db-functions
>>> @@ -450,7 +450,7 @@ arch_repo_add() {
>>>  	# package files might be relative to repo dir
>>>  	pushd "${FTP_BASE}/${repo}/os/${arch}" >/dev/null
>>>  	/usr/bin/repo-add -q "${repo}${DBEXT}" ${pkgs[@]} \
>>> -		|| error "repo-add ${repo}${DBEXT} ${pkgs[@]}"
>>> +		|| error 'repo-add %q %s' "${repo}${DBEXT}" "${pkgs[*]@Q}"
>>>  	popd >/dev/null
>>>  	set_repo_permission "${repo}" "${arch}"
>>>  
>>> @@ -468,7 +468,7 @@ arch_repo_remove() {
>>>  		return 1
>>>  	fi
>>>  	/usr/bin/repo-remove -q "${dbfile}" ${pkgs[@]} \
>>> -		|| error "repo-remove ${dbfile} ${pkgs[@]}"
>>> +		|| error 'repo-remove %q %s' "$dbfile" "${pkgs[*]@Q}"
>>>  	set_repo_permission "${repo}" "${arch}"
>>
>> I think for consistency we should use the same style which means using
>> "${dbfile at Q}"
> 
> I was going for consistency with the repo-add version, which doesn't
> have a single dbfile variable to @Q.  Would you have me introduce a
> dbfile variable in arch_repo_add?

Well, we basically use it hardcoded three times, so why not. :p

Just like the repo-add version, except with pushd "${dbfile%/*}"

Actually, this decreases the difference between the two enough that we
may want to just have one call the other... or do this:

https://lists.archlinux.org/pipermail/arch-projects/2018-February/004832.html

-- 
Eli Schwartz
Bug Wrangler and Trusted User

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/arch-projects/attachments/20180226/bda9f0f2/attachment.asc>


More information about the arch-projects mailing list