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
! refinements around interactions of EOL checks and fixes
! include Harbour files "hidden" under /3rd/ dirs
* bin/commit.hb
+ set errorlevel, so it can now be used as a git pre-commit hook
(as 'exec hbrun bin/commit' in .gits/hooks/pre-commit)
* contrib/hbexpat/hbexpat.hbc
! fixed expat.hbc detection to actually look for .hbc file not .h
(which is never present)
* utils/hbmk2/hbmk2.prg
+ added depfinish= .hbc directive. It was missing, yet I
was using it in hbexpat.hbc in recent patch, and wondered
why it didn't work
[ the necessity of the whole previous patch is still suspect
though. ]
+ show warning for any .hbc directives that is unknown.
This should avoid above situation nicely.
INCOMPATIBILITY: Thus far all lines with unknown directives
were ignored, now only empty ones or ones that begin with
'#' character (in first column), as documented. Clean your
.hbc files accordingly.
! fixed typo in one help text. Pls retranslate, I hope Transifex
keeps previous texts, but you can find it in next language
update commit, if not.
* package/harb_win.mft
! deleted BOM (detected by check.hb)
* contrib/3rd/sqlite3/sqlite3.hbc
* contrib/3rd/sqlite3/sqlite3.hbp
* contrib/hbbz2/3rd/bz2/bz2.hbc
* contrib/hbbz2/3rd/bz2/bz2.hbp
* contrib/hbexpat/3rd/expat/_hbconf.h
* contrib/hbexpat/3rd/expat/expat.hbc
* contrib/hbexpat/3rd/expat/expat.hbp
* contrib/hbhpdf/3rd/libhpdf/_hbhbpdf.c
* contrib/hbhpdf/3rd/libhpdf/libhpdf.hbc
* contrib/hbhpdf/3rd/libhpdf/libhpdf.hbp
* contrib/hblzf/3rd/liblzf/lzf.hbc
* contrib/hblzf/3rd/liblzf/lzf.hbp
* contrib/hbmlzo/3rd/minilzo/minilzo.hbc
* contrib/hbmlzo/3rd/minilzo/minilzo.hbp
* contrib/hbmxml/3rd/minixml/config.h
* contrib/hbmxml/3rd/minixml/minixml.dif
* contrib/hbmxml/3rd/minixml/mxml.hbc
* contrib/hbmxml/3rd/minixml/mxml.hbp
* contrib/hbmzip/3rd/minizip/minizip.hbc
* contrib/hbmzip/3rd/minizip/minizip.hbp
* contrib/hbxdiff/3rd/libxdiff/_hbconf.h
* contrib/hbxdiff/3rd/libxdiff/xdiff.hbc
* contrib/hbxdiff/3rd/libxdiff/xdiff.hbp
* lib/3rd/win/bcc/Makefile
* lib/3rd/win/mingw/Makefile
! deleted SVN IDs
* rediffed where required
This commit is contained in:
37
bin/check.hb
37
bin/check.hb
@@ -162,7 +162,7 @@ STATIC FUNCTION CheckFile( cName, /* @ */ aErr, lApplyFixes )
|
||||
ELSE
|
||||
|
||||
IF hb_FileMatch( cName, "ChangeLog.txt" ) .AND. Len( cFile ) > 32768 .AND. ! lApplyFixes
|
||||
cFile := Left( cFile, 16384 ) + Right( cFile, 16384 )
|
||||
cFile := RTrimEOL( Left( cFile, 16384 ) ) + LTrim( Right( cFile, 16384 ) )
|
||||
ENDIF
|
||||
|
||||
lReBuild := .F.
|
||||
@@ -220,21 +220,28 @@ STATIC FUNCTION CheckFile( cName, /* @ */ aErr, lApplyFixes )
|
||||
ENDIF
|
||||
|
||||
IF lReBuild
|
||||
cFile := RemoveEndingWhitespace( cFile, cEOL, lRemoveEndingWhitespace )
|
||||
cFile := RemoveEndingWhitespace( cFile, iif( Empty( cEOL ), hb_eol(), cEOL ), lRemoveEndingWhitespace )
|
||||
ENDIF
|
||||
|
||||
IF !( Right( cFile, Len( cEOL ) ) == cEOL )
|
||||
IF !( Right( cFile, Len( Chr( 10 ) ) ) == Chr( 10 ) )
|
||||
AAdd( aErr, "content: has no EOL at EOF" )
|
||||
IF lApplyFixes
|
||||
cFile += cEOL
|
||||
cFile += iif( Empty( cEOL ), hb_eol(), cEOL )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF Right( cFile, Len( cEOL ) * 2 ) == Replicate( cEOL, 2 )
|
||||
IF Right( cFile, Len( Chr( 10 ) ) * 2 ) == Replicate( Chr( 10 ), 2 )
|
||||
AAdd( aErr, "content: has multiple EOL at EOF" )
|
||||
IF lApplyFixes
|
||||
DO WHILE Right( cFile, Len( cEOL ) * 2 ) == Replicate( cEOL, 2 )
|
||||
cFile := hb_StrShrink( cFile, Len( cEOL ) )
|
||||
DO WHILE Right( cFile, Len( Chr( 10 ) ) * 2 ) == Replicate( Chr( 10 ), 2 )
|
||||
cFile := hb_StrShrink( cFile, Len( Chr( 10 ) ) )
|
||||
ENDDO
|
||||
ENDIF
|
||||
ELSEIF Right( cFile, Len( Chr( 13 ) + Chr( 10 ) ) * 2 ) == Replicate( Chr( 13 ) + Chr( 10 ), 2 )
|
||||
AAdd( aErr, "content: has multiple EOL at EOF" )
|
||||
IF lApplyFixes
|
||||
DO WHILE Right( cFile, Len( Chr( 13 ) + Chr( 10 ) ) * 2 ) == Replicate( Chr( 13 ) + Chr( 10 ), 2 )
|
||||
cFile := hb_StrShrink( cFile, Len( Chr( 13 ) + Chr( 10 ) ) )
|
||||
ENDDO
|
||||
ENDIF
|
||||
ENDIF
|
||||
@@ -257,6 +264,14 @@ STATIC FUNCTION CheckFile( cName, /* @ */ aErr, lApplyFixes )
|
||||
STATIC FUNCTION IsBinary( cFile )
|
||||
RETURN Chr( 0 ) $ cFile .OR. !( Chr( 10 ) $ cFile )
|
||||
|
||||
STATIC FUNCTION RTrimEOL( cFile )
|
||||
|
||||
DO WHILE Right( cFile, 1 ) $ Chr( 13 ) + Chr( 10 )
|
||||
cFile := hb_StrShrink( cFile, 1 )
|
||||
ENDDO
|
||||
|
||||
RETURN cFile
|
||||
|
||||
/*
|
||||
* UTF-8 encoding detection, based on filestr.cpp from Far Manager.
|
||||
* Harbour adaptation Copyright 2013 Viktor Szakats (harbour syenar.net)
|
||||
@@ -426,7 +441,13 @@ STATIC FUNCTION LoadGitignore()
|
||||
LOCAL cLine
|
||||
|
||||
IF s_aIgnore == NIL
|
||||
s_aIgnore := { "*/3rd/*" }
|
||||
|
||||
s_aIgnore := { ;
|
||||
"*/3rd/*", ;
|
||||
"!*/3rd/*/*.hbc", ;
|
||||
"!*/3rd/*/*.hbp", ;
|
||||
"!*/3rd/*/Makefile" }
|
||||
|
||||
FOR EACH cLine IN hb_ATokens( StrTran( hb_MemoRead( ".gitignore" ), Chr( 13 ) ), Chr( 10 ) )
|
||||
IF ! Empty( cLine ) .AND. !( Left( cLine, 1 ) == "#" )
|
||||
/* TODO: clean this */
|
||||
|
||||
@@ -48,6 +48,7 @@ PROCEDURE Main()
|
||||
|
||||
IF Empty( aChanges )
|
||||
OutStd( hb_ProgName() + ": " + "no changes" + hb_eol() )
|
||||
ErrorLevel( 0 )
|
||||
RETURN
|
||||
ENDIF
|
||||
|
||||
@@ -83,6 +84,7 @@ PROCEDURE Main()
|
||||
IF ! hb_FileExists( cLogName := "ChangeLog.txt" )
|
||||
IF ! hb_FileExists( cLogName := "ChangeLog" )
|
||||
OutStd( hb_ProgName() + ": " + "can't find ChangeLog file" + hb_eol() )
|
||||
ErrorLevel( 2 )
|
||||
RETURN
|
||||
ENDIF
|
||||
ENDIF
|
||||
@@ -107,8 +109,10 @@ PROCEDURE Main()
|
||||
hb_MemoWrit( cLogName, cLog )
|
||||
|
||||
OutStd( hb_ProgName() + ": " + hb_StrFormat( "Edit %1$s and commit", cLogName ) + hb_eol() )
|
||||
ErrorLevel( 0 )
|
||||
ELSE
|
||||
OutStd( hb_ProgName() + ": " + "Please correct errors listed above and re-run" + hb_eol() )
|
||||
ErrorLevel( 1 )
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
Reference in New Issue
Block a user