Import the newer scripts from DeforaOS configure
This commit is contained in:
parent
95beab7f5b
commit
470e451d52
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#$Id$
|
#$Id$
|
||||||
#Copyright (c) 2011-2019 Pierre Pronchery <khorben@defora.org>
|
#Copyright (c) 2011-2020 Pierre Pronchery <khorben@defora.org>
|
||||||
#
|
#
|
||||||
#Redistribution and use in source and binary forms, with or without
|
#Redistribution and use in source and binary forms, with or without
|
||||||
#modification, are permitted provided that the following conditions are met:
|
#modification, are permitted provided that the following conditions are met:
|
||||||
|
@ -27,14 +27,15 @@
|
||||||
#variables
|
#variables
|
||||||
CONFIGSH="${0%/pkgconfig.sh}/../config.sh"
|
CONFIGSH="${0%/pkgconfig.sh}/../config.sh"
|
||||||
PREFIX="/usr/local"
|
PREFIX="/usr/local"
|
||||||
DEBUG="_debug"
|
|
||||||
DEVNULL="/dev/null"
|
DEVNULL="/dev/null"
|
||||||
PROGNAME="pkgconfig.sh"
|
PROGNAME="pkgconfig.sh"
|
||||||
#executables
|
#executables
|
||||||
|
DEBUG="_debug"
|
||||||
INSTALL="install -m 0644"
|
INSTALL="install -m 0644"
|
||||||
MKDIR="mkdir -m 0755 -p"
|
MKDIR="mkdir -m 0755 -p"
|
||||||
RM="rm -f"
|
RM="rm -f"
|
||||||
SED="sed"
|
SED="sed"
|
||||||
|
|
||||||
[ -f "$CONFIGSH" ] && . "$CONFIGSH"
|
[ -f "$CONFIGSH" ] && . "$CONFIGSH"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#$Id$
|
#$Id$
|
||||||
#Copyright (c) 2012-2017 Pierre Pronchery <khorben@defora.org>
|
#Copyright (c) 2012-2020 Pierre Pronchery <khorben@defora.org>
|
||||||
#
|
#
|
||||||
#Redistribution and use in source and binary forms, with or without
|
#Redistribution and use in source and binary forms, with or without
|
||||||
#modification, are permitted provided that the following conditions are met:
|
#modification, are permitted provided that the following conditions are met:
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
|
|
||||||
|
|
||||||
#variables
|
#variables
|
||||||
|
CONFIGSH="${0%/docbook.sh}/../config.sh"
|
||||||
PREFIX="/usr/local"
|
PREFIX="/usr/local"
|
||||||
[ -f "../config.sh" ] && . "../config.sh"
|
|
||||||
PROGNAME="docbook.sh"
|
PROGNAME="docbook.sh"
|
||||||
#executables
|
#executables
|
||||||
DEBUG="_debug"
|
DEBUG="_debug"
|
||||||
|
@ -37,6 +37,8 @@ RM="rm -f"
|
||||||
XMLLINT="xmllint"
|
XMLLINT="xmllint"
|
||||||
XSLTPROC="xsltproc --nonet --xinclude"
|
XSLTPROC="xsltproc --nonet --xinclude"
|
||||||
|
|
||||||
|
[ -f "$CONFIGSH" ] && . "$CONFIGSH"
|
||||||
|
|
||||||
|
|
||||||
#functions
|
#functions
|
||||||
#debug
|
#debug
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
|
|
||||||
#variables
|
#variables
|
||||||
|
CONFIGSH="${0%/gtkdoc.sh}/../config.sh"
|
||||||
PREFIX="/usr/local"
|
PREFIX="/usr/local"
|
||||||
PROGNAME="gtkdoc.sh"
|
PROGNAME="gtkdoc.sh"
|
||||||
#executables
|
#executables
|
||||||
|
@ -41,7 +42,7 @@ RM="rm -f"
|
||||||
RMDIR="rmdir"
|
RMDIR="rmdir"
|
||||||
TOUCH="touch"
|
TOUCH="touch"
|
||||||
|
|
||||||
[ -f "../config.sh" ] && . "../config.sh"
|
[ -f "$CONFIGSH" ] && . "$CONFIGSH"
|
||||||
|
|
||||||
|
|
||||||
#functions
|
#functions
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
|
|
||||||
#variables
|
#variables
|
||||||
|
CONFIGSH="${0%/clint.sh}/../config.sh"
|
||||||
CFLAGS=
|
CFLAGS=
|
||||||
CPPFLAGS=
|
CPPFLAGS=
|
||||||
PROGNAME="clint.sh"
|
PROGNAME="clint.sh"
|
||||||
|
@ -39,6 +40,8 @@ MKDIR="mkdir -p"
|
||||||
SORT="sort -n"
|
SORT="sort -n"
|
||||||
TR="tr"
|
TR="tr"
|
||||||
|
|
||||||
|
[ -f "$CONFIGSH" ] && . "$CONFIGSH"
|
||||||
|
|
||||||
|
|
||||||
#functions
|
#functions
|
||||||
#clint
|
#clint
|
||||||
|
|
111
tests/fixme.sh
111
tests/fixme.sh
|
@ -25,17 +25,23 @@
|
||||||
|
|
||||||
|
|
||||||
#variables
|
#variables
|
||||||
|
CONFIGSH="${0%/fixme.sh}/../config.sh"
|
||||||
PROGNAME="fixme.sh"
|
PROGNAME="fixme.sh"
|
||||||
PROJECTCONF="../project.conf"
|
PROJECTCONF="../project.conf"
|
||||||
|
REGEXP_ERROR="FIXME"
|
||||||
|
REGEXP_WARNING="\\(TODO\|XXX\\)"
|
||||||
#executables
|
#executables
|
||||||
DATE="date"
|
DATE="date"
|
||||||
DEBUG="_debug"
|
DEBUG="_debug"
|
||||||
FIND="find"
|
FIND="find"
|
||||||
GREP="grep"
|
GREP="grep"
|
||||||
|
HEAD="head"
|
||||||
MKDIR="mkdir -p"
|
MKDIR="mkdir -p"
|
||||||
SORT="sort -n"
|
SORT="sort -n"
|
||||||
TR="tr"
|
TR="tr"
|
||||||
|
|
||||||
|
[ -f "$CONFIGSH" ] && . "$CONFIGSH"
|
||||||
|
|
||||||
|
|
||||||
#functions
|
#functions
|
||||||
#fixme
|
#fixme
|
||||||
|
@ -64,24 +70,7 @@ _fixme()
|
||||||
for subdir in $subdirs; do
|
for subdir in $subdirs; do
|
||||||
[ -d "../$subdir" ] || continue
|
[ -d "../$subdir" ] || continue
|
||||||
for filename in $($FIND "../$subdir" -type f | $SORT); do
|
for filename in $($FIND "../$subdir" -type f | $SORT); do
|
||||||
callback=
|
callback=$(_fixme_callback "$filename")
|
||||||
ext=${filename##*/}
|
|
||||||
ext=${ext%.in}
|
|
||||||
ext=${ext##*.}
|
|
||||||
case "$ext" in
|
|
||||||
asm|S)
|
|
||||||
callback="_fixme_asm"
|
|
||||||
;;
|
|
||||||
c|cc|cpp|cxx|h|js)
|
|
||||||
callback="_fixme_c"
|
|
||||||
;;
|
|
||||||
conf|sh)
|
|
||||||
callback="_fixme_sh"
|
|
||||||
;;
|
|
||||||
htm|html|xml)
|
|
||||||
callback="_fixme_xml"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
[ -n "$callback" ] || continue
|
[ -n "$callback" ] || continue
|
||||||
($callback "$filename") 2>&1
|
($callback "$filename") 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
@ -93,54 +82,114 @@ _fixme()
|
||||||
return $res
|
return $res
|
||||||
}
|
}
|
||||||
|
|
||||||
_fixme_asm()
|
_fixme_callback()
|
||||||
|
{
|
||||||
|
filename="$1"
|
||||||
|
ext=${filename##*/}
|
||||||
|
ext=${ext%.in}
|
||||||
|
ext=${ext##*.}
|
||||||
|
callback=
|
||||||
|
|
||||||
|
case "$ext" in
|
||||||
|
asm|S)
|
||||||
|
echo "_fixme_callback_asm"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
c|cc|cpp|cxx|h|js|v)
|
||||||
|
echo "_fixme_callback_c"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
conf|sh)
|
||||||
|
echo "_fixme_callback_sh"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
py)
|
||||||
|
echo "_fixme_callback_python"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
htm|html|xml|xsl)
|
||||||
|
echo "_fixme_callback_xml"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
case $($HEAD -n 1 "$filename") in
|
||||||
|
"#!/bin/sh"*|"#! /bin/sh"*|\
|
||||||
|
"#!/usr/bin/env bash"*|"#! /usr/bin/env bash"*)
|
||||||
|
echo "_fixme_callback_sh"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
"#!/usr/bin/env python"*|"#! /usr/bin/env python"*)
|
||||||
|
echo "_fixme_callback_python"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
"<html"*|"<?xml"*)
|
||||||
|
echo "_fixme_callback_xml"
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
return 2
|
||||||
|
}
|
||||||
|
|
||||||
|
_fixme_callback_asm()
|
||||||
{
|
{
|
||||||
res=0
|
res=0
|
||||||
filename="$1"
|
filename="$1"
|
||||||
|
|
||||||
#warnings
|
#warnings
|
||||||
$GREP -nH '/\*.*\(TODO\|XXX\)' "$filename"
|
$GREP -nH "/\\*.*$REGEXP_WARNING" "$filename"
|
||||||
#failures
|
#failures
|
||||||
$GREP -nH '/\*.*FIXME' "$filename" && res=2
|
$GREP -nH "/\\*.*$REGEXP_ERROR" "$filename" && res=2
|
||||||
return $res
|
return $res
|
||||||
}
|
}
|
||||||
|
|
||||||
_fixme_c()
|
_fixme_callback_c()
|
||||||
{
|
{
|
||||||
res=0
|
res=0
|
||||||
filename="$1"
|
filename="$1"
|
||||||
|
|
||||||
#warnings
|
#warnings
|
||||||
$GREP -nH '/\(/\|\*\).*\(TODO\|XXX\)' "$filename"
|
$GREP -nH "/\\(/\\|\\*\\).*$REGEXP_WARNING" "$filename"
|
||||||
#failures
|
#failures
|
||||||
$GREP -nH '/\(/\|\*\).*FIXME' "$filename" && res=2
|
$GREP -nH "/\\(/\\|\\*\\).*$REGEXP_ERROR" "$filename" && res=2
|
||||||
return $res
|
return $res
|
||||||
}
|
}
|
||||||
|
|
||||||
_fixme_sh()
|
_fixme_callback_python()
|
||||||
{
|
{
|
||||||
res=0
|
res=0
|
||||||
filename="$1"
|
filename="$1"
|
||||||
#XXX avoid matching the regexp
|
|
||||||
comment="#"
|
comment="#"
|
||||||
|
|
||||||
#warnings
|
#warnings
|
||||||
$GREP -nH "$comment.*\\(TODO\\|XXX\\)" "$filename"
|
$GREP -nH "$comment.*$REGEXP_WARNING" "$filename"
|
||||||
#failures
|
#failures
|
||||||
$GREP -nH "$comment.*FIXME" "$filename" && res=2
|
$GREP -nH "$comment.*$REGEXP_ERROR" "$filename" && res=2
|
||||||
return $res
|
return $res
|
||||||
}
|
}
|
||||||
|
|
||||||
_fixme_xml()
|
_fixme_callback_sh()
|
||||||
|
{
|
||||||
|
res=0
|
||||||
|
filename="$1"
|
||||||
|
comment="#"
|
||||||
|
|
||||||
|
#warnings
|
||||||
|
$GREP -nH "$comment.*$REGEXP_WARNING" "$filename"
|
||||||
|
#failures
|
||||||
|
$GREP -nH "$comment.*$REGEXP_ERROR" "$filename" && res=2
|
||||||
|
return $res
|
||||||
|
}
|
||||||
|
|
||||||
|
_fixme_callback_xml()
|
||||||
{
|
{
|
||||||
res=0
|
res=0
|
||||||
filename="$1"
|
filename="$1"
|
||||||
|
|
||||||
#XXX limited to a single line
|
#XXX limited to a single line
|
||||||
#warnings
|
#warnings
|
||||||
$GREP -nH '<!--.*\(TODO\|XXX\)' "$filename"
|
$GREP -nH "<!--.*$REGEXP_WARNING" "$filename"
|
||||||
#failures
|
#failures
|
||||||
$GREP -nH '<!--.*FIXME' "$filename" && res=2
|
$GREP -nH "<!--.*$REGEXP_ERROR" "$filename" && res=2
|
||||||
return $res
|
return $res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
|
|
||||||
#variables
|
#variables
|
||||||
|
CONFIGSH="${0%/htmllint.sh}/../config.sh"
|
||||||
DEVNULL="/dev/null"
|
DEVNULL="/dev/null"
|
||||||
PROGNAME="htmllint.sh"
|
PROGNAME="htmllint.sh"
|
||||||
PROJECTCONF="../project.conf"
|
PROJECTCONF="../project.conf"
|
||||||
|
@ -37,6 +38,8 @@ MKDIR="mkdir -p"
|
||||||
SORT="sort -n"
|
SORT="sort -n"
|
||||||
TR="tr"
|
TR="tr"
|
||||||
|
|
||||||
|
[ -f "$CONFIGSH" ] && . "$CONFIGSH"
|
||||||
|
|
||||||
|
|
||||||
#functions
|
#functions
|
||||||
#htmllint
|
#htmllint
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
|
|
||||||
#variables
|
#variables
|
||||||
|
CONFIGSH="${0%/xmllint.sh}/../config.sh"
|
||||||
DEVNULL="/dev/null"
|
DEVNULL="/dev/null"
|
||||||
PROGNAME="xmllint.sh"
|
PROGNAME="xmllint.sh"
|
||||||
PROJECTCONF="../project.conf"
|
PROJECTCONF="../project.conf"
|
||||||
|
@ -37,6 +38,8 @@ SORT="sort -n"
|
||||||
TR="tr"
|
TR="tr"
|
||||||
XMLLINT="xmllint --nonet"
|
XMLLINT="xmllint --nonet"
|
||||||
|
|
||||||
|
[ -f "$CONFIGSH" ] && . "$CONFIGSH"
|
||||||
|
|
||||||
|
|
||||||
#functions
|
#functions
|
||||||
#xmllint
|
#xmllint
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#$Id$
|
#$Id$
|
||||||
#Copyright (c) 2012-2019 Pierre Pronchery <khorben@defora.org>
|
#Copyright (c) 2012-2020 Pierre Pronchery <khorben@defora.org>
|
||||||
#
|
#
|
||||||
#Redistribution and use in source and binary forms, with or without
|
#Redistribution and use in source and binary forms, with or without
|
||||||
#modification, are permitted provided that the following conditions are met:
|
#modification, are permitted provided that the following conditions are met:
|
||||||
|
@ -45,6 +45,7 @@ INSTALL="install"
|
||||||
MKDIR="mkdir -m 0755 -p"
|
MKDIR="mkdir -m 0755 -p"
|
||||||
RM="rm -f"
|
RM="rm -f"
|
||||||
SED="sed"
|
SED="sed"
|
||||||
|
|
||||||
[ -f "$CONFIGSH" ] && . "$CONFIGSH"
|
[ -f "$CONFIGSH" ] && . "$CONFIGSH"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user