From fb9328c9b5b1d0e02d682a28a120bc798b799b61 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 4 Apr 2013 04:41:09 +0200 Subject: [PATCH] 2013-04-04 04:30 UTC+0200 Viktor Szakats (harbour syenar.net) * bin/commit.hb + added code to launch default git editor with ChangeLog.txt (not yet activated) * contrib/hbexpat/hbexpat.hbc - reverted these two: 2013-04-03 16:01 UTC+0200 2013-03-27 16:29 UTC+0100 It seems that expat.hbc is always installed regardless of local or system copy is used along the build/install process * utils/hbmk2/hbmk2.prg ! fixed -run on Darwin after 2013-03-15 13:57 UTC+0100 (untested) --- ChangeLog.txt | 17 +++++++++++++++++ bin/commit.hb | 37 +++++++++++++++++++++++++++++++++++++ contrib/hbexpat/hbexpat.hbc | 9 +-------- utils/hbmk2/hbmk2.prg | 3 ++- 4 files changed, 57 insertions(+), 9 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index da0e679ebe..3907e01474 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,23 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-04-04 04:30 UTC+0200 Viktor Szakats (harbour syenar.net) + * bin/commit.hb + + added code to launch default git editor with ChangeLog.txt + (not yet activated) + + * contrib/hbexpat/hbexpat.hbc + - reverted these two: + 2013-04-03 16:01 UTC+0200 + 2013-03-27 16:29 UTC+0100 + It seems that expat.hbc is always installed regardless + of local or system copy is used along the build/install + process + + * utils/hbmk2/hbmk2.prg + ! fixed -run on Darwin after 2013-03-15 13:57 UTC+0100 + (untested) + 2013-04-04 03:39 UTC+0200 Viktor Szakats (harbour syenar.net) * bin/check.hb ! fixed shrinking of ChangeLog.txt to not result in broken EOLs diff --git a/bin/commit.hb b/bin/commit.hb index 72ebb72742..2c90fcd95d 100644 --- a/bin/commit.hb +++ b/bin/commit.hb @@ -109,6 +109,7 @@ PROCEDURE Main() hb_MemoWrit( cLogName, cLog ) OutStd( hb_ProgName() + ": " + hb_StrFormat( "Edit %1$s and commit", cLogName ) + hb_eol() ) +// LaunchCommand( GitEditor(), cLogName ) ErrorLevel( 0 ) ELSE OutStd( hb_ProgName() + ": " + "Please correct errors listed above and re-run" + hb_eol() ) @@ -255,4 +256,40 @@ STATIC FUNCTION GitUser() AllTrim( hb_StrReplace( cName, Chr( 10 ) + Chr( 13 ), "" ) ), ; StrTran( AllTrim( hb_StrReplace( cEMail, Chr( 10 ) + Chr( 13 ), "" ) ), "@", " " ) ) +STATIC FUNCTION GitEditor() + + LOCAL cValue := "" + + hb_processRun( Shell() + " " + CmdEscape( "git config --global core.editor" ),, @cValue ) + + cValue := hb_StrReplace( cValue, Chr( 10 ) + Chr( 13 ), "" ) + + IF Left( cValue, 1 ) == "'" .AND. Right( cValue, 1 ) == "'" + cValue := hb_StrShrink( SubStr( cValue, 2 ), 1 ) + ENDIF + + IF Lower( cValue ) == "notepad.exe" /* banned, use notepad2.exe or else */ + cValue := "" + ENDIF + + RETURN cValue + +STATIC FUNCTION LaunchCommand( cCommand, cArg ) + + IF Empty( cCommand ) + RETURN -1 + ENDIF + +#if defined( __PLATFORM__WINDOWS ) + IF hb_osIsWinNT() + cCommand := 'start "" "' + cCommand + '"' + ELSE + cCommand := "start " + cCommand + ENDIF +#elif defined( __PLATFORM__OS2 ) + cCommand := 'start "" "' + cCommand + '"' +#endif + + RETURN hb_run( cCommand + " " + cArg ) + #include "check.hb" diff --git a/contrib/hbexpat/hbexpat.hbc b/contrib/hbexpat/hbexpat.hbc index b6b439f143..b5d3e758b4 100644 --- a/contrib/hbexpat/hbexpat.hbc +++ b/contrib/hbexpat/hbexpat.hbc @@ -6,11 +6,4 @@ incpaths=. headers=${hb_name}.ch libs=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF} - -depkeyhead=expat_hbc:expat.hbc -depcontrol=expat_hbc:local{HB_BUILD_3RDEXT='no'} -depincpathlocal=expat_hbc:3rd/expat -depfinish=expat_hbc - -libs=3rd/expat/expat.hbc{HBMK_HAS_EXPAT_HBC_LOCAL} -libs=expat{!HBMK_HAS_INST_EXPAT_HBC_LOCAL} +libs=3rd/expat/expat.hbc diff --git a/utils/hbmk2/hbmk2.prg b/utils/hbmk2/hbmk2.prg index f18e45f638..112b18fb05 100644 --- a/utils/hbmk2/hbmk2.prg +++ b/utils/hbmk2/hbmk2.prg @@ -7534,6 +7534,7 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit IF hbmk[ _HBMK_lGUI ] /* TOFIX: Find a way to pass arbitrary options to an .app. */ l_aOPTRUN := {} + cCommand += ".app" ENDIF #endif cCommand := AllTrim( LaunchCommand( cCommand ) + " " + ArrayToList( l_aOPTRUN ) ) @@ -7561,7 +7562,7 @@ STATIC FUNCTION LaunchCommand( cCommand ) #elif defined( __PLATFORM__OS2 ) cCommand := 'start "" ' + FNameEscape( cCommand, _ESC_DBLQUOTE ) #elif defined( __PLATFORM__DARWIN ) - cCommand := "open " + FNameEscape( cCommand + ".app", _ESC_NIX ) + cCommand := "open " + FNameEscape( cCommand, _ESC_NIX ) #endif RETURN cCommand