[pacman-dev] [PATCH 5/6] bacman: use block redirection

Dave Reisner d at falconindy.com
Thu Sep 29 13:49:25 EDT 2011


On Fri, Sep 30, 2011 at 01:14:05AM +0800, lolilolicon wrote:
> Doing so is certainly better, but we really should consider reusing
> write_pkginfo() from makepkg.  Splitting common functions from makepkg
> into a library would be nice.

So let's do that instead. There's similar work in repo-add. One way or
another, this should be using printf rather than echo.

> Signed-off-by: lolilolicon <lolilolicon at gmail.com>
> ---
>  contrib/bacman.in |   34 +++++++++++++++++-----------------
>  1 files changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/contrib/bacman.in b/contrib/bacman.in
> index c69ab6f..a28f8e7 100755
> --- a/contrib/bacman.in
> +++ b/contrib/bacman.in
> @@ -207,57 +207,57 @@ while read i; do
>      case "$current" in
>          # desc
>          %NAME%)
> -            echo "pkgname = $i"    >> .PKGINFO
> +            echo "pkgname = $i"
>          ;;
>          %VERSION%)
> -            echo "pkgver = $i"    >> .PKGINFO
> +            echo "pkgver = $i"
>          ;;
>          %DESC%)
> -            echo "pkgdesc = $i"    >> .PKGINFO
> +            echo "pkgdesc = $i"
>          ;;
>          %URL%)
> -            echo "url = $i"    >> .PKGINFO
> +            echo "url = $i"
>          ;;
>          %LICENSE%)
> -            echo "license = $i"    >> .PKGINFO
> +            echo "license = $i"
>          ;;
>          %ARCH%)
> -            echo "arch = $i"    >> .PKGINFO
> +            echo "arch = $i"
>          ;;
>          %BUILDDATE%)
> -            echo "builddate = $(date -u "+%s")"    >> .PKGINFO
> +            echo "builddate = $(date -u "+%s")"
>          ;;
>          %PACKAGER%)
> -            echo "packager = $pkg_pkger"        >> .PKGINFO
> +            echo "packager = $pkg_pkger"
>          ;;
>          %SIZE%)
> -            echo "size = $pkg_size"        >> .PKGINFO
> +            echo "size = $pkg_size"
>          ;;
>          %GROUPS%)
> -            echo "group = $i"    >> .PKGINFO
> +            echo "group = $i"
>          ;;
>          %REPLACES%)
> -            echo "replaces = $i"    >> .PKGINFO
> +            echo "replaces = $i"
>          ;;
>          %DEPENDS%)
> -            echo "depend = $i"   >> .PKGINFO
> +            echo "depend = $i"
>          ;;
>          %OPTDEPENDS%)
> -            echo "optdepend = $i" >> .PKGINFO
> +            echo "optdepend = $i"
>          ;;
>          %CONFLICTS%)
> -            echo "conflict = $i" >> .PKGINFO
> +            echo "conflict = $i"
>          ;;
>          %PROVIDES%)
> -            echo "provides = $i"  >> .PKGINFO
> +            echo "provides = $i"
>          ;;
>  
>          # files
>          %BACKUP%)
>              # strip the md5sum after the tab
> -            echo "backup = ${i%%$'\t'*}"   >> .PKGINFO
> +            echo "backup = ${i%%$'\t'*}"
>          ;;
> -    esac
> +    esac >> .PKGINFO
>  done
>  
>  comp_files=".PKGINFO"
> -- 
> 1.7.6.4
> 
> 


More information about the pacman-dev mailing list