From 5990163309a8fa9e0306045ffc1543b01e15b3c0 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 4 Jul 2010 12:46:03 +0000 Subject: [PATCH] 2010-07-04 14:45 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) - external/patchup.prg + bin/patchup.prg * Moved to bin dir for universal access. F.e. we may want to support external components inside contribs or anywhere else in the tree. + Added support to recognize and use .hbp file as well, if Makefile is not available in current dir. --- harbour/ChangeLog | 9 +++++++++ harbour/{external => bin}/patchup.prg | 27 +++++++++++++++++---------- 2 files changed, 26 insertions(+), 10 deletions(-) rename harbour/{external => bin}/patchup.prg (97%) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8fc6b7b073..47beee3585 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,15 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-04 14:45 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + - external/patchup.prg + + bin/patchup.prg + * Moved to bin dir for universal access. F.e. we may want + to support external components inside contribs or anywhere + else in the tree. + + Added support to recognize and use .hbp file as well, if + Makefile is not available in current dir. + 2010-07-04 12:21 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/cdpapi.c * src/rtl/cdpapihb.c diff --git a/harbour/external/patchup.prg b/harbour/bin/patchup.prg similarity index 97% rename from harbour/external/patchup.prg rename to harbour/bin/patchup.prg index 794fc54f64..c8b9c1e994 100644 --- a/harbour/external/patchup.prg +++ b/harbour/bin/patchup.prg @@ -24,7 +24,7 @@ * tested) * * patchup requires several meta data (in the form of specially formatted lines) - * in the component's Makefile. Formatting rules are as follows: + * in the component's Makefile or .hbp file. Formatting rules are as follows: * * - The first character on the line is a hash mark (`#'), followed by any number * of white spaces. @@ -126,8 +126,8 @@ * * If no differences between the original and the Harbour trees were found, * a possibly pre-existing diff file is removed. Following this change up - * in the component's Makefile is left for the operator -- patchup will communicate - * if there is a likely need to perform this action. + * in the component's Makefile (or .hbp file) is left for the operator -- patchup + * will communicate if there is a likely need to perform this action. * * It is strongly advised not to try to mix the two modes. If there are any * pending local modifications, a rediff should be done before a component @@ -247,7 +247,9 @@ STATIC s_aTools := { ; PROCEDURE Main( ... ) - LOCAL cFile /* memoized Makefile */ + LOCAL cFileName + LOCAL cFile /* memorized input make file */ + LOCAL aDir LOCAL aRegexMatch /* regex match results */ LOCAL cMemoLine /* MemoLine */ LOCAL nMemoLine /* Line number */ @@ -286,15 +288,20 @@ PROCEDURE Main( ... ) ENDSWITCH ENDIF - IF ! hb_FileExists( "Makefile" ) - OutStd( "No `Makefile' in the current directory." + OSNL ) - ErrorLevel( 1 ) - QUIT + IF ! hb_FileExists( cFileName := "Makefile" ) + IF Empty( aDir := Directory( "*.hbp" ) ) + OutStd( "No `Makefile' or '*.hbp' file in the current directory." + OSNL ) + ErrorLevel( 1 ) + QUIT + ELSE + ASort( aDir,,, { | tmp, tmp1 | tmp[ F_NAME ] < tmp1[ F_NAME ] } ) + cFileName := aDir[ 1 ][ F_NAME ] + ENDIF ENDIF SetupTools() - cFile := MemoRead( "Makefile" ) + cFile := MemoRead( cFileName ) cDiffFile := NIL /* default to `no local diff' */ nMemoLine := 0 @@ -515,7 +522,7 @@ PROCEDURE Main( ... ) ENDIF IF ! lRediff - OutStd( "Don't forget to update Makefile with the new version and URL information." + OSNL ) + OutStd( "Don't forget to update `" + cFileName + "' with the new version and URL information." + OSNL ) ENDIF OutStd( "The temporary directory `" + s_cTempDir + "' has not been removed." +OSNL )