Fwd: [packages/rpm-build-tools/full-changelog] prepend to autogenerated changelog link to full changelog in gitweb

Elan Ruusamäe glen at pld-linux.org
Fri Aug 17 16:50:00 CEST 2012


comments on this?

if no comments, i'll merge it to master

extra bonus part from this, the %changelog first entry is date of srpm 
build date like it used to be in cvs days (actually there was rpm build 
time, but here it is srpm create time)

changelog looks like this:

glen at carme-pld packages/php $ rpmbuild -bs php.spec
builder: Active branch PHP_5_4. Use -r BRANCHNAME to override
builder: SMP make flags are set to -j4
Already up-to-date.
WARNING! Spec name (php) does not agree with package name (php54)

No conditional flags passed

from available:
--with   :       embed gcov instantclient interbase_inst litespeed 
mysqlnd oci8 suhosin system_gd system_libzip tests type_hints zts
--without:       apache1 apache2 cgi curl enchant filter fpm imap 
interbase kerberos5 ldap mhash mm mssql mysqli odbc openssl pcre 
pdo_sqlite pgsql phar pspell recode snmp sqlite2 sqlite3 sybase_ct tidy 
wddx xmlrpc

Available branches: AC-branch Ac-branch LIBCHAMPLAIN_0_8 MIMUW_PORTALOZA 
PHP_5_2 PHP_5_4 RA-branch RA-branch-security RA-branch_DEVEL 
RA-branch_general master
Building target platforms: x86_64-linux
Wrote: /home/users/glen/rpm/SRPMS/php54-5.4.5-0.15.src.rpm
     0m6.10s real     0m1.12s user     0m0.66s system


glen at carme-pld packages/php $ LC_ALL=en_US.utf8 rpm -qp 
/home/users/glen/rpm/SRPMS/php54-5.4.5-0.15.src.rpm --changelog |head
* Fri Aug 17 2012 PLD Linux Team <feedback at pld-linux.org>
- For complete changelog see: 
http://git.pld-linux.org/?p=packages/php54.git;a=log;h=PHP_5_4

* Thu Aug 16 2012 Elan Ruusamäe <glen at delfi.ee> 5d43dd0
Revert "use "System/Localtime" tzname (which uses /etc/localtime) if 
configuration can not be found"

* Fri Aug 10 2012 Elan Ruusamäe <glen at delfi.ee> e84b92a
use "System/Localtime" tzname (which uses /etc/localtime) if 
configuration can not be found

* Thu Aug 02 2012 Elan Ruusamäe <glen at delfi.ee> d87d42c
glen at carme-pld packages/php $


-------- Original Message --------
Subject: 	[packages/rpm-build-tools/full-changelog] prepend to 
autogenerated changelog link to full changelog in gitweb
Date: 	Wed, 15 Aug 2012 22:19:34 +0200
From: 	glen <glen at pld-linux.org>
Reply-To: 	pld-devel-en at lists.pld-linux.org, 
pld-devel-pl at lists.pld-linux.org
To: 	pld-cvs-commit at lists.pld-linux.org



commit 9e269b3c86618fa473833f6959c6c955e2b14066
Author: Elan Ruusamäe<glen at delfi.ee>
Date:   Wed Aug 15 23:19:03 2012 +0300

     prepend to autogenerated changelog link to full changelog in gitweb

  builder.sh | 15 ++++++++++++++-
  1 file changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/builder.sh b/builder.sh
index 6cb8678..c67cad4 100755
--- a/builder.sh
+++ b/builder.sh
@@ -468,7 +468,20 @@ insert_gitlog() {
  		git notes list $sha1>  /dev/null 2>&1&&  logfmt=%N
  		git log -n 1 $sha1 --format=format:"* %ad %an<%ae>  %h%n${logfmt}%n" --date=raw | sed '/^$/q'
  	done>  $gitlog
-	LC_ALL=C gawk '/^\* /{printf("* %s %s\n", strftime("%a %b %d %Y", $2), substr($0, length($1)+length($2)+length($3)+4)); next}{print}' $gitlog>  $speclog
+
+	# add link to full git logs
+	local giturl="http://git.pld-linux.org/?p=packages/$PACKAGE_NAME.git;a=log"
+	if [ -n "$CVSTAG" ]; then
+		giturl="$giturl;h=$CVSTAG"
+	fi
+	local gitauthor="PLD Linux Team<feedback at pld-linux.org>"
+	LC_ALL=C gawk -vgiturl="$giturl" -vgitauthor="$gitauthor" -vpackage=$PACKAGE_NAME 'BEGIN{
+		printf("* %s %s\n- For complete changelog see: %s\n", strftime("%a %b %d %Y"), gitauthor, giturl);
+		print;
+		exit
+	}'>  $speclog
+
+	LC_ALL=C gawk '/^\* /{printf("* %s %s\n", strftime("%a %b %d %Y", $2), substr($0, length($1)+length($2)+length($3)+4)); next}{print}' $gitlog>>  $speclog
  	sed '/^%changelog/,$d' $SPECFILE | sed -e "\${
  			a%changelog
  			r $speclog
_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit at lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit



More information about the pld-devel-en mailing list