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

2018-02-22 Thread Luke Shumaker
From: Luke Shumaker These are things that were (IMO) missed in 5afac1e. I found them using: git grep -E '(plain|msg|msg2|warning|error|die) "[^"]*\$' I went a little above-and-beyond for escaping strings for the error messages in db-functions' arch_repo_add and

[arch-projects] [dbscripts] [PATCH v2 2/3] test: Fixup glob matching

2018-02-22 Thread Luke Shumaker
From: Luke Shumaker - ftpdir-cleanup.bats: Glob expansion does not occur in [[ -f ]] tests. The [[ ! -f .../${pkgname}-*${PKGEXT} ]] checks were checking that there were no files containing a literal '*' for that part of their name. Obviously, this isn't what was

[arch-projects] [dbscripts] [PATCH v2 1/3] test: common.bash:__getCheckSum: Don't rely on IFS

2018-02-22 Thread Luke Shumaker
From: Luke Shumaker I managed to stumble across a bug in BATS where the run() function screwed with the global IFS. The bug has been fixed in git, but isn't in a release yet. https://github.com/sstephenson/bats/issues/89 Anyway, this bug breaks __getCheckSum().

[arch-projects] [dbscripts] [PATCH v2 0/3] Misc touchup

2018-02-22 Thread Luke Shumaker
From: Luke Shumaker These are a few minor unrelated touch-ups that I noticed when doing the PKGEXT work. There's no real theme to them. v2: - Use Bash 4.4 feature to avoid introducing temporary variables in the printf commit - Mention splitting declaring and setting

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

2018-02-22 Thread Eli Schwartz via arch-projects
On 02/22/2018 08:52 PM, Luke Shumaker wrote: > I guess I *should* have explained it a bit more; the escaping of the > package list happens when assigning pkgs_str: > > printf -v pkgs_str -- '%q ' "${pkgs[@]}" Hmm, true. But the version without the additional variable wins IMO. > Anyway,

Re: [arch-projects] [dbscripts] [PATCH 1/3] test: common.bash:__getCheckSum: Don't rely on IFS

2018-02-22 Thread Luke Shumaker
On Thu, 22 Feb 2018 19:27:04 -0500, Eli Schwartz wrote: > > [1 Re: [arch-projects] [dbscripts] [PATCH 1/3] test: > common.bash:__getCheckSum: Don't rely on IFS ] > [1.1 ] > On 02/22/2018 06:43 PM, Luke Shumaker wrote: > > On Thu, 22 Feb 2018 16:43:36 -0500, > > Eli Schwartz wrote: > >>>

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

2018-02-22 Thread Luke Shumaker
On Thu, 22 Feb 2018 19:23:17 -0500, Eli Schwartz wrote: > > On 02/22/2018 06:54 PM, Luke Shumaker wrote: > >> I do see what you're doing, I'm just not sure why. Is the whole idea > >> with this extra variable floating around, to avoid tokenizing > >> "${pkgs[@]}" as separate messages? That's why

Re: [arch-projects] [dbscripts] [PATCH 1/3] test: common.bash:__getCheckSum: Don't rely on IFS

2018-02-22 Thread Eli Schwartz via arch-projects
On 02/22/2018 06:43 PM, Luke Shumaker wrote: > On Thu, 22 Feb 2018 16:43:36 -0500, > Eli Schwartz wrote: >>> __getCheckSum() { >>> - local result=($(sha1sum $1)) >>> - echo ${result[0]} >>> + local result >>> + result="$(sha1sum "$1")" >>> + echo "${result%% *}" >> >> Why are you moving

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

2018-02-22 Thread Eli Schwartz via arch-projects
On 02/22/2018 06:54 PM, Luke Shumaker wrote: >> I do see what you're doing, I'm just not sure why. Is the whole idea >> with this extra variable floating around, to avoid tokenizing >> "${pkgs[@]}" as separate messages? That's why "${pkgs[*]}" tokenizes the >> members of an array as one word by

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

2018-02-22 Thread Luke Shumaker
On Thu, 22 Feb 2018 16:44:20 -0500, Eli Schwartz wrote: > > I went a little above-and-beyond for escaping strings for the error > > messages in db-functions' arch_repo_add and arch_repo_remove. The > > code should explain itself, but I wanted to point it out, as it's more > > complex than the

Re: [arch-projects] [dbscripts] [PATCH 1/3] test: common.bash:__getCheckSum: Don't rely on IFS

2018-02-22 Thread Luke Shumaker
On Thu, 22 Feb 2018 16:43:36 -0500, Eli Schwartz wrote: > > __getCheckSum() { > > - local result=($(sha1sum $1)) > > - echo ${result[0]} > > + local result > > + result="$(sha1sum "$1")" > > + echo "${result%% *}" > > Why are you moving over to declaring the variable and assigning it

Re: [arch-projects] [dbscripts] [PATCH 2/3] test: Fixup glob matching

2018-02-22 Thread Eli Schwartz via arch-projects
On 02/22/2018 03:43 PM, Luke Shumaker wrote: > From: Luke Shumaker > > - ftpdir-cleanup.bats: Glob expansion does not occur in [[ -f ]] tests. >The [[ ! -f .../${pkgname}-*${PKGEXT} ]] checks were checking that there >were no files containing a literal '*' for that

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

2018-02-22 Thread Eli Schwartz via arch-projects
On 02/22/2018 03:43 PM, Luke Shumaker wrote: > From: Luke Shumaker > > These are things that were (IMO) missed in 5afac1e. I found them using: > > git ls-files|xargs grep -E '(plain|msg|msg2|warning|error|die) "[^"]*\$' Consider using git grep next time :p rather than

Re: [arch-projects] [dbscripts] [PATCH 1/3] test: common.bash:__getCheckSum: Don't rely on IFS

2018-02-22 Thread Eli Schwartz via arch-projects
On 02/22/2018 03:43 PM, Luke Shumaker wrote: > From: Luke Shumaker > > I managed to stumble across a bug in BATS where the run() function > screwed with the global IFS. The bug has been fixed in git, but isn't > in a release yet. > >

[arch-projects] [dbscripts] [PATCH 1/3] test: common.bash:__getCheckSum: Don't rely on IFS

2018-02-22 Thread Luke Shumaker
From: Luke Shumaker I managed to stumble across a bug in BATS where the run() function screwed with the global IFS. The bug has been fixed in git, but isn't in a release yet. https://github.com/sstephenson/bats/issues/89 Anyway, this bug breaks __getCheckSum().

[arch-projects] [dbscripts] [PATCH 0/3] Misc touchup

2018-02-22 Thread Luke Shumaker
From: Luke Shumaker These are a few minor unrelated touch-ups that I noticed when doing the PKGEXT work. There's no real theme to them. Luke Shumaker (3): test: common.bash:__getCheckSum: Don't rely on IFS test: Fixup glob matching Update messages to make fuller use

[arch-projects] [dbscripts] [PATCH 2/3] test: Fixup glob matching

2018-02-22 Thread Luke Shumaker
From: Luke Shumaker - ftpdir-cleanup.bats: Glob expansion does not occur in [[ -f ]] tests. The [[ ! -f .../${pkgname}-*${PKGEXT} ]] checks were checking that there were no files containing a literal '*' for that part of their name. Obviously, this isn't what was

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

2018-02-22 Thread Luke Shumaker
From: Luke Shumaker These are things that were (IMO) missed in 5afac1e. I found them using: git ls-files|xargs grep -E '(plain|msg|msg2|warning|error|die) "[^"]*\$' I went a little above-and-beyond for escaping strings for the error messages in db-functions'

[arch-projects] [dbscripts] [GIT] Official repo DB scripts branch master updated. 20131102-69-ge53cad6

2018-02-22 Thread Eli Schwartz via arch-projects
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 "Official repo DB scripts". The branch, master has been updated via e53cad6e4a8284165c6d0b2c7c86f6c077be693b (commit) via