[arch-commits] Commit in pkgstats/trunk (PKGBUILD pkgstats.sh)

Pierre Schmitz pierre at archlinux.org
Fri Sep 10 09:58:19 UTC 2010


    Date: Friday, September 10, 2010 @ 05:58:19
  Author: pierre
Revision: 90270

update to version 2.0; submit currently used mirror

Modified:
  pkgstats/trunk/PKGBUILD	(contents, properties)
  pkgstats/trunk/pkgstats.sh

-------------+
 PKGBUILD    |   10 +++++-----
 pkgstats.sh |   24 ++++++++++++++----------
 2 files changed, 19 insertions(+), 15 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-09-10 08:18:29 UTC (rev 90269)
+++ PKGBUILD	2010-09-10 09:58:19 UTC (rev 90270)
@@ -1,16 +1,16 @@
-# $Id: $
+# $Id$
 # Maintainer: Pierre Schmitz <pierre at archlinux.de>
 
 pkgname=pkgstats
-pkgver=1.0
-pkgrel=3
+pkgver=2.0
+pkgrel=1
 pkgdesc='submits a list of installed packages to the Arch Linux project'
 arch=('any')
 url='http://www.archlinux.de'
 license=('GPL')
-depends=('bash' 'curl' 'pacman')
+depends=('bash' 'curl' 'pacman' 'sed' 'coreutils')
 source=('pkgstats.sh')
-md5sums=('899e398052a41a2fef6ec4a4ddb151d9')
+md5sums=('4f6c4fef01b7b000d9da9c43442af2ea')
 
 build() {
 	install -D -m755 ${srcdir}/pkgstats.sh ${pkgdir}/usr/bin/pkgstats


Property changes on: pkgstats/trunk/PKGBUILD
___________________________________________________________________
Added: svn:keywords
   + Id

Modified: pkgstats.sh
===================================================================
--- pkgstats.sh	2010-09-10 08:18:29 UTC (rev 90269)
+++ pkgstats.sh	2010-09-10 09:58:19 UTC (rev 90270)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-pkgstatsver=1.0
+pkgstatsver='2.0'
 showonly=false
 
 usage() {
@@ -17,7 +17,7 @@
 }
 
 while getopts 'vdhs' option; do
-	case $option in
+	case ${option} in
 		v)	echo "pkgstats, version ${pkgstatsver}"; exit 0;;
 		d)	debug='-v';;
 		s)	showonly=true;;
@@ -25,24 +25,28 @@
 	esac
 done
 
-pkglist=$(mktemp --tmpdir pkglist.XXXXXX)
-echo 'Creating package list...'
-pacman -Qq > ${pkglist}
+echo 'Collecting data...'
+pkglist="$(mktemp --tmpdir pkglist.XXXXXX)"
+pacman -Qq > "${pkglist}"
+arch="$(uname -m)"
+mirror="$(pacman -Sdp extra/pkgstats 2>/dev/null | sed -E 's#(.*/)extra/os/.*#\1#')"
 
-if $showonly; then
+if ${showonly}; then
 	echo 'packages='
-	cat ${pkglist}
+	cat  "${pkglist}"
 	echo ''
-	echo "arch=$(uname -m)"
+	echo "arch=${arch}"
 	echo "pkgstatsver=${pkgstatsver}"
+	echo "mirror=${mirror}"
 else
 	echo 'Submitting data...'
 	curl ${debug} -f -H 'Expect: ' \
 		--data-urlencode "packages@${pkglist}" \
-		--data-urlencode "arch=$(uname -m)" \
+		--data-urlencode "arch=${arch}" \
 		--data-urlencode "pkgstatsver=${pkgstatsver}" \
+		--data-urlencode "mirror=${mirror}" \
 		'https://www.archlinux.de/?page=PostPackageList' \
 		|| echo 'Sorry, package list could not be sent.'
 fi
 
-rm -f ${pkglist}
+rm -f "${pkglist}"




More information about the arch-commits mailing list