theslinux-buildsystem branch _utils updated 55478af + new function :_pkgbuild_to_yaml

  • From: git@xxxxxxxxxxxxxxxxxxxx
  • To: theslinux-phantom@xxxxxxxxxxxxx
  • Date: Fri, 09 Aug 2013 02:34:13 -0700

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 "theslinux-buildsystem".

The branch, _utils has been updated
       via  55478af5f6f134017f11b93a11648716d301864f (commit)
      from  e916f67415f706f7975c79aa6b3437939f591c8c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 55478af5f6f134017f11b93a11648716d301864f
Author: Ky-Anh Huynh <kyanh@xxxxxxxxxxxxx>
Date:   Fri Aug 9 16:32:48 2013 +0700

    + new function :_pkgbuild_to_yaml
    
    This will help us to build our own databases

-----------------------------------------------------------------------

Summary of changes:
 _utils/run.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/_utils/run.sh b/_utils/run.sh
index 3bbf383..b1a1779 100755
--- a/_utils/run.sh
+++ b/_utils/run.sh
@@ -774,6 +774,54 @@ _get_update() {
   get_update
 }
 
+_pkgbuild_to_yaml() {
+  _s_env || return 1
+
+  # Copied from `makepkg`
+  # FIXME: We should not mirror code like this. Need another way to
+  # FIXME: patch `makepkg` and make code clean.
+  unset pkgname pkgbase pkgver pkgrel epoch pkgdesc url license groups provides
+  unset md5sums replaces depends conflicts backup source install changelog 
build
+  unset makedepends optdepends options noextract
+
+  pkgver="${PACKAGE_VERSION:-}"
+  pkgrel="${PACKAGE_RELEASE:-}"
+  pkgbase="${PACKAGE_BASE:-}"
+
+  [[ ! -z "$pkgname" ]] || pkgname="$pkgbase"
+
+  if [[ -n "$PACKAGE_FEATURE" ]]; then
+    conflicts=("${conflicts[@]}" "$pkgname")
+    provides=("${provides[@]}" "$pkgname")
+    replaces=("${replaces[@]}" "$pkgname")
+  fi
+  # /Copied from `makepkg`
+
+  source "PKGBUILD" || return 127
+  cat <<EOF
+---
+$PACKAGE_BASE:
+  version: $PACKAGE_VERSION
+  description: $pkgdesc
+  install: $install
+  feature: $PACKAGE_FEATURE
+  url: $url
+  license: "${license[@]}"
+  packages:
+$(for _u in "${pkgname[@]}"; do echo "  - $_u";done)
+  sources:
+$(for _u in "${source[@]}"; do echo "  - $_u";done)
+  conflicts:
+$(for _u in "${conflicts[@]}"; do echo "  - $_u";done)
+  provides:
+$(for _u in "${provides[@]}"; do echo "  - $_u";done)
+  replaces:
+$(for _u in "${replaces[@]}"; do echo "  - $_u";done)
+  makedepends:
+$(for _u in "${makedepends[@]}"; do echo "  - $_u";done)
+EOF
+}
+
 _func=""
 case "${0##*/}" in
   "s-import-package") _func="_import_packages" ;;


hooks/post-receive
-- 
theslinux-buildsystem
--
Purpose: Store commits, feeds from other projects
Post: mailto:theslinux-phantom@xxxxxxxxxxxxx
Archive, Gmane: http://theslinux.org/lists/phantom/
Subscribe: mailto:theslinux-phantom-request@xxxxxxxxxxxxx?Subject=subscribe
Unsubscribe: mailto:theslinux-phantom-request@xxxxxxxxxxxxx?Subject=unsubscribe
Other information: http://theslinux.org/lists (vi) or 
http://theslinux.org/lists/en (en)
Support: mailto:theslinux-questions@xxxxxxxxxxxxx

Other related posts:

  • » theslinux-buildsystem branch _utils updated 55478af + new function :_pkgbuild_to_yaml - git