From d733d9d59b1d807f4e5f15d9f5d37e60dceb68a4 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 11 Jun 2012 11:21:36 +0000 Subject: [PATCH] 2012-06-11 13:20 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbrun/hbrun.prg + use .hb as default extension for Harbour sources. (was .prg) + bin/hbcommit.hb + added commit preparer script. It will pull all changed files, format it according to Harbour ChangeLog standard, add standard commit header and prepend the entry before latest on into ChangeLog file. Usage: $ hbrun hbcommit.hb Please try it and use it when committing to Harbour SVN * contrib/hbplist * disabled hbqt and its dependencies, until the nightly build breaker problem is resolved. --- harbour/ChangeLog | 18 +++++ harbour/bin/hbcommit.hb | 130 ++++++++++++++++++++++++++++++++ harbour/contrib/hbplist | 6 +- harbour/contrib/hbrun/hbrun.prg | 8 +- 4 files changed, 155 insertions(+), 7 deletions(-) create mode 100644 harbour/bin/hbcommit.hb diff --git a/harbour/ChangeLog b/harbour/ChangeLog index aa061d861a..1e471c3dfb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,24 @@ The license applies to all entries newer than 2009-04-28. */ +2012-06-11 13:20 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/hbrun/hbrun.prg + + use .hb as default extension for Harbour sources. + (was .prg) + + + bin/hbcommit.hb + + added commit preparer script. It will pull all changed + files, format it according to Harbour ChangeLog standard, + add standard commit header and prepend the entry before + latest on into ChangeLog file. + Usage: + $ hbrun hbcommit.hb + Please try it and use it when committing to Harbour SVN + + * contrib/hbplist + * disabled hbqt and its dependencies, until the nightly + build breaker problem is resolved. + 2012-06-11 12:21 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbblat/hbblat.hbp + added experimental support for installing 3rd party .dll diff --git a/harbour/bin/hbcommit.hb b/harbour/bin/hbcommit.hb new file mode 100644 index 0000000000..451f4614de --- /dev/null +++ b/harbour/bin/hbcommit.hb @@ -0,0 +1,130 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * SVN commit preparer + * + * Copyright 2012 Viktor Szakats (harbour syenar.net) + * www - http://harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + * + */ + +#define _MY_NAME_ "Firstname Lastname (me domain.net)" +#define _PCOMMIT_ ".pcommit" + +#pragma warninglevel=3 +#pragma -km+ +#pragma -ko+ + +PROCEDURE Main() + + LOCAL aChanges := DoctorChanges( Changes() ) + LOCAL cLog + LOCAL cLogNew + LOCAL cLine + LOCAL nOffset + LOCAL cHit + LOCAL nPos + LOCAL cMyName + + IF Empty( aChanges ) + OutStd( hb_progname() + ": no changes" + hb_eol() ) + RETURN + ENDIF + + // ; + + IF hb_FileExists( _PCOMMIT_ ) + cMyName := AllTrim( hb_MemoRead( _PCOMMIT_ ) ) + ELSE + cMyName := _MY_NAME_ + ENDIF + + nOffset := hb_UTCOffset() + + cLogNew := hb_StrFormat( "%1$s UTC+%2$02d%3$02d %4$s",; + hb_TToC( hb_DateTime(), "YYYY-MM-DD", "HH:MM" ),; + Int( nOffset / 3600 ),; + Int( ( ( nOffset / 3600 ) - Int( nOffset / 3600 ) ) * 60 ),; + cMyName ) + hb_eol() + + FOR EACH cLine IN aChanges + cLogNew += cLine + hb_eol() + NEXT + + // ; + + cLog := MemoRead( "ChangeLog" ) + cHit := hb_AtX( "\n[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] UTC[\-+][0-9][0-9][0-9][0-9] ", cLog ) + IF Empty( cHit ) + cHit := "" + ENDIF + + nPos := At( AllTrim( cHit ), cLog ) + IF nPos > 0 + cLog := Left( cLog, nPos - 1 ) + cLogNew + hb_eol() + SubStr( cLog, nPos ) + ELSE + cLog += hb_eol() + cLogNew + ENDIF + + hb_MemoWrit( "ChangeLog", cLog ) + + RETURN + +STATIC FUNCTION DoctorChanges( aChanges ) + LOCAL cLine + LOCAL cStart + LOCAL aNew := {} + + ASort( aChanges,,, {| x, y | x < y } ) + + FOR EACH cLine IN aChanges + IF ! Empty( cLine ) .AND. SubStr( cLine, 8, 1 ) == " " + cStart := Left( cLine, 1 ) + SWITCH cStart + CASE "M" + cStart := "*" + EXIT + CASE "A" + cStart := "+" + EXIT + CASE "D" + cStart := "-" + EXIT + CASE "X" + cStart := "" + EXIT + OTHERWISE + cStart := "?" + ENDSWITCH + IF ! Empty( cStart ) + AAdd( aNew, " " + cStart + " " + StrTran( SubStr( cLine, 8 + 1 ), "\", "/" ) ) + ENDIF + ENDIF + NEXT + + RETURN aNew + +STATIC FUNCTION Changes() + LOCAL cStdOut + + hb_processRun( "svn status -q",, @cStdOut ) + + RETURN hb_ATokens( StrTran( cStdOut, Chr( 13 ) ), Chr( 10 ) ) diff --git a/harbour/contrib/hbplist b/harbour/contrib/hbplist index ca25ffbaa7..2458136e88 100644 --- a/harbour/contrib/hbplist +++ b/harbour/contrib/hbplist @@ -25,7 +25,7 @@ hbgt/hbgt.hbp hbhpdf/hbhpdf.hbp # uses: libhpdf (locally hosted) hbhttpd/hbhttpd.hbp hbhttpd/hbhttpds.hbp -hbide/hbide.hbp +#hbide/hbide.hbp hblzf/hblzf.hbp # uses: liblzf (locally hosted) hbmagic/hbmagic.hbp hbmemio/hbmemio.hbp @@ -40,7 +40,7 @@ hbnf/hbnf.hbp hbodbc/hbodbc.hbp hboslib/hboslib.hbp hbpgsql/hbpgsql.hbp -hbqt/hbqt_all.hbp +#hbqt/hbqt_all.hbp hbrun/hbrun.hbp hbsms/hbsms.hbp hbsqlit3/hbsqlit3.hbp # uses: sqlite3 (locally hosted) @@ -50,7 +50,7 @@ hbtip/hbtipssl.hbp hbtpathy/hbtpathy.hbp hbunix/hbunix.hbp hbwin/hbwin.hbp -hbxbp/hbxbp.hbp +#hbxbp/hbxbp.hbp hbxdiff/hbxdiff.hbp # uses: libxdiff (locally hosted) hbxpp/hbxpp.hbp hbzebra/hbzebra.hbp diff --git a/harbour/contrib/hbrun/hbrun.prg b/harbour/contrib/hbrun/hbrun.prg index 8d6f9f8857..70503dc0e4 100644 --- a/harbour/contrib/hbrun/hbrun.prg +++ b/harbour/contrib/hbrun/hbrun.prg @@ -158,9 +158,9 @@ PROCEDURE _APPMAIN( cFile, ... ) hb_FNameSplit( cFile, NIL, NIL, @cExt ) cExt := Lower( cExt ) SWITCH cExt - CASE ".prg" CASE ".hb" CASE ".hbs" + CASE ".prg" CASE ".hrb" CASE ".dbf" EXIT @@ -172,9 +172,9 @@ PROCEDURE _APPMAIN( cFile, ... ) hbrun_extensionlist_init( aDynamic ) hbrun_Prompt( hb_AParams(), "USE " + cFile + " SHARED" ) EXIT - CASE ".prg" CASE ".hb" CASE ".hbs" + CASE ".prg" IF Empty( GetEnv( "HBRUN_NOHEAD" ) ) hHeaders := __hbrun_CoreHeaderFiles() /* add core header files */ ENDIF @@ -288,7 +288,7 @@ STATIC FUNCTION hbrun_FileSig( cFile ) LOCAL hFile LOCAL cBuff, cSig, cExt - cExt := ".prg" + cExt := ".hb" hFile := FOpen( cFile, FO_READ ) IF hFile != F_ERROR cSig := hb_hrbSignature() @@ -587,7 +587,7 @@ STATIC PROCEDURE hbrun_Usage() "Copyright (c) 1999-2012, Przemyslaw Czerpak, Viktor Szakats" + hb_eol() + ; "http://harbour-project.org/" + hb_eol() +; hb_eol() +; - "Syntax: hbrun [ []]" + hb_eol() ) + "Syntax: hbrun [ []]" + hb_eol() ) RETURN