[pacman-dev] [PATCH 3/4] Use curly braces for all shell variables in PKGBUILD prototypes

Allan McRae allan at archlinux.org
Fri Jan 17 06:32:41 EST 2014


On 17/01/14 08:18, Jason St. John wrote:
> Added to encourage "proper" delimiting of variable names
> 
> Signed-off-by: Jason St. John <jstjohn at purdue.edu>
> ---
> This also improves syntax highlighting of file extensions when opening
> the PKGBUILD prototypes in Vim.
> 

This is going to be fun!

@Dave: care to comment?  (I know you dislike unneeded braces :D )

> 
>  proto/PKGBUILD-split.proto | 20 ++++++++++----------
>  proto/PKGBUILD.proto       | 16 ++++++++--------
>  2 files changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/proto/PKGBUILD-split.proto b/proto/PKGBUILD-split.proto
> index b2832b9..8f5bd1d 100644
> --- a/proto/PKGBUILD-split.proto
> +++ b/proto/PKGBUILD-split.proto
> @@ -24,24 +24,24 @@ backup=()
>  options=()
>  install=
>  changelog=
> -source=("$pkgbase-$pkgver.tar.gz"
> -        "$pkgname-$pkgver.patch")
> +source=("${pkgbase}-${pkgver}.tar.gz"
> +        "${pkgname}-${pkgver}.patch")
>  noextract=()
>  md5sums=() # generate with 'updpkgsums'
>  
>  prepare() {
> -	cd "$pkgname-$pkgver"
> -	patch -p1 -i "$srcdir/$pkgname-$pkgver.patch"
> +	cd "${pkgname}-${pkgver}"
> +	patch -p1 -i "${srcdir}/${pkgname}-${pkgver}.patch"
>  }
>  
>  build() {
> -	cd "$pkgbase-$pkgver"
> +	cd "${pkgbase}-${pkgver}"
>  	./configure --prefix=/usr
>  	make
>  }
>  
>  check() {
> -	cd "$pkgname-$pkgver"
> +	cd "${pkgname}-${pkgver}"
>  	make -k check
>  }
>  
> @@ -65,14 +65,14 @@ package_pkg1() {
>  	install=
>  	changelog=
>  
> -	cd "$pkgbase-$pkgver"
> -	make DESTDIR="$pkgdir/" install-pkg1
> +	cd "${pkgbase}-${pkgver}"
> +	make DESTDIR="${pkgdir}/" install-pkg1
>  }
>  
>  package_pkg2() {
>  	# options and directives overrides
>  	pkgdesc=""
>  
> -	cd "$pkgbase-$pkgver"
> -	make DESTDIR="$pkgdir/" install-pkg2
> +	cd "${pkgbase}-${pkgver}"
> +	make DESTDIR="${pkgdir}/" install-pkg2
>  }
> diff --git a/proto/PKGBUILD.proto b/proto/PKGBUILD.proto
> index 479d5e5..0eb1c20 100644
> --- a/proto/PKGBUILD.proto
> +++ b/proto/PKGBUILD.proto
> @@ -24,28 +24,28 @@ backup=()
>  options=()
>  install=
>  changelog=
> -source=("$pkgname-$pkgver.tar.gz"
> -        "$pkgname-$pkgver.patch")
> +source=("${pkgname}-${pkgver}.tar.gz"
> +        "${pkgname}-${pkgver}.patch")
>  noextract=()
>  md5sums=() # generate with 'updpkgsums'
>  
>  prepare() {
> -	cd "$pkgname-$pkgver"
> -	patch -p1 -i "$srcdir/$pkgname-$pkgver.patch"
> +	cd "${pkgname}-${pkgver}"
> +	patch -p1 -i "${srcdir}/${pkgname}-${pkgver}.patch"
>  }
>  
>  build() {
> -	cd "$pkgname-$pkgver"
> +	cd "${pkgname}-${pkgver}"
>  	./configure --prefix=/usr
>  	make
>  }
>  
>  check() {
> -	cd "$pkgname-$pkgver"
> +	cd "${pkgname}-${pkgver}"
>  	make -k check
>  }
>  
>  package() {
> -	cd "$pkgname-$pkgver"
> -	make DESTDIR="$pkgdir/" install
> +	cd "${pkgname}-${pkgver}"
> +	make DESTDIR="${pkgdir}/" install
>  }
> 



More information about the pacman-dev mailing list