[pacman-dev] [PATCH v5] paccache: adding the possibility for multiple cachedirs
Maxim Andersson
thesilentboatman at gmail.com
Thu Aug 28 06:37:47 EDT 2014
2014-08-28 0:57 GMT+02:00 Dave Reisner <d at falconindy.com>:
> On Thu, Aug 28, 2014 at 12:43:02AM +0200, Maxim Andersson wrote:
>> Multiple cachedirs by specifing the -c option more than ones.
>>
>> Also other minor changes:
>> - Removed leading whitespaces in parse_filename()
>> - Aligned --nocolor with other long options in usage()
>>
>> Signed-off-by: Maxim Andersson <thesilentboatman at gmail.com>
>> ---
>> contrib/paccache.sh.in | 62 +++++++++++++++++++++++++++++++-------------------
>> 1 file changed, 38 insertions(+), 24 deletions(-)
>>
>> diff --git a/contrib/paccache.sh.in b/contrib/paccache.sh.in
>> index 039ac8a..03b2b53 100644
>> --- a/contrib/paccache.sh.in
>> +++ b/contrib/paccache.sh.in
>> @@ -23,9 +23,9 @@ shopt -s extglob
>> declare -r myname='paccache'
>> declare -r myver='@PACKAGE_VERSION@'
>>
>> -declare -a candidates=() cmdopts=() whitelist=() blacklist=()
>> +declare -a cachedirs=() candidates=() cmdopts=() whitelist=() blacklist=()
>> declare -i delete=0 dryrun=0 filecount=0 move=0 needsroot=0 totalsaved=0 verbose=0
>> -declare cachedir=@localstatedir@/cache/pacman/pkg delim=$'\n' keep=3 movedir= scanarch=
>> +declare delim=$'\n' keep=3 movedir= scanarch=
>>
>> USE_COLOR='y'
>>
>> @@ -43,7 +43,7 @@ pkgfilter() {
>> # script after the block of awk.
>>
>> awk -v keep="$1" -v scanarch="$2" '
>> - function parse_filename(filename, parts, count, i, pkgname, arch) {
>> + function parse_filename(filename, parts, count, i, pkgname, arch) {
>
> NAK. You should have just left this alone. There's no concept of
> localizing variables to functions except to declare them as function
> parameters, so in order to distinguish the "required" parameters from
> the localized variables in the function, the convention is to add some
> whitespace in the parameter list.
>
> Don't worry about this -- I'm pulling your patch to my local with this
> change reverted (and fixing up the commit message).
>
> Thanks!
>
Ahh ok, didn't know that. Thanks for clarifying!
More information about the pacman-dev
mailing list