Update the latest versions upstream

This commit is contained in:
Pierre Pronchery 2019-09-01 05:00:03 +02:00
parent 3561fe9d12
commit 0eb7cb45cc
6 changed files with 110 additions and 44 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
#$Id$ #$Id$
#Copyright (c) 2011-2015 Pierre Pronchery <khorben@defora.org> #Copyright (c) 2011-2019 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%/pkgconfig.sh}/../config.sh"
PREFIX="/usr/local" PREFIX="/usr/local"
[ -f "../config.sh" ] && . "../config.sh"
DEBUG="_debug" DEBUG="_debug"
DEVNULL="/dev/null" DEVNULL="/dev/null"
PROGNAME="pkgconfig.sh" PROGNAME="pkgconfig.sh"
@ -35,13 +35,14 @@ 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"
#functions #functions
#debug #debug
_debug() _debug()
{ {
echo "$@" 1>&2 echo "$@" 1>&3
"$@" "$@"
} }
@ -66,7 +67,7 @@ _usage()
clean=0 clean=0
install=0 install=0
uninstall=0 uninstall=0
while getopts "ciuP:" name; do while getopts "ciuO:P:" name; do
case $name in case $name in
c) c)
clean=1 clean=1
@ -79,6 +80,9 @@ while getopts "ciuP:" name; do
install=0 install=0
uninstall=1 uninstall=1
;; ;;
O)
export "${OPTARG%%=*}"="${OPTARG#*=}"
;;
P) P)
PREFIX="$OPTARG" PREFIX="$OPTARG"
;; ;;
@ -89,7 +93,7 @@ while getopts "ciuP:" name; do
esac esac
done done
shift $(($OPTIND - 1)) shift $(($OPTIND - 1))
if [ $# -eq 0 ]; then if [ $# -lt 0 ]; then
_usage _usage
exit $? exit $?
fi fi
@ -103,8 +107,19 @@ if [ -z "$VERSION" ]; then
_error "The VERSION variable needs to be set" _error "The VERSION variable needs to be set"
exit $? exit $?
fi fi
[ -z "$BINDIR" ] && BINDIR="$PREFIX/bin"
[ -z "$DATADIR" ] && DATADIR="$PREFIX/share"
[ -z "$INCLUDEDIR" ] && INCLUDEDIR="$PREFIX/include"
[ -z "$LIBDIR" ] && LIBDIR="$PREFIX/lib"
[ -z "$LIBEXECDIR" ] && LIBEXECDIR="$PREFIX/libexec"
[ -z "$MANDIR" ] && MANDIR="$DATADIR/man"
if [ -z "$SYSCONFDIR" ]; then
SYSCONFDIR="$PREFIX/etc"
[ "$PREFIX" = "/usr" ] && SYSCONFDIR="/etc"
fi
PKGCONFIG="$PREFIX/lib/pkgconfig" PKGCONFIG="$PREFIX/lib/pkgconfig"
exec 3>&1
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
target="$1" target="$1"
shift shift
@ -122,7 +137,11 @@ while [ $# -gt 0 ]; do
if [ "$install" -eq 1 ]; then if [ "$install" -eq 1 ]; then
source="${target#$OBJDIR}" source="${target#$OBJDIR}"
$DEBUG $MKDIR -- "$PKGCONFIG" || exit 2 $DEBUG $MKDIR -- "$PKGCONFIG" || exit 2
$DEBUG $INSTALL "$target" "$PKGCONFIG/$source" || exit 2 basename="$source"
if [ "${source##*/}" != "$source" ]; then
basename="${source##*/}"
fi
$DEBUG $INSTALL "$target" "$PKGCONFIG/$basename"|| exit 2
continue continue
fi fi
@ -143,10 +162,19 @@ while [ $# -gt 0 ]; do
#create #create
source="${target#$OBJDIR}" source="${target#$OBJDIR}"
source="${source}.in" source="${source}.in"
$DEBUG $SED -e "s;@PACKAGE@;$PACKAGE;" \ ([ -z "$OBJDIR" ] || $DEBUG $MKDIR -- "${target%/*}") || exit 2
-e "s;@VERSION@;$VERSION;" \ $DEBUG $SED -e "s;@PACKAGE@;$PACKAGE;g" \
-e "s;@PREFIX@;$PREFIX;" \ -e "s;@VERSION@;$VERSION;g" \
-e "s;@RPATH@;$RPATH;" \ -e "s;@PREFIX@;$PREFIX;g" \
-e "s;@BINDIR@;$BINDIR;g" \
-e "s;@DATADIR@;$DATADIR;g" \
-e "s;@INCLUDEDIR@;$INCLUDEDIR;g" \
-e "s;@LIBDIR@;$LIBDIR;g" \
-e "s;@LIBEXECDIR@;$LIBEXECDIR;g" \
-e "s;@MANDIR@;$MANDIR;g" \
-e "s;@PWD@;$PWD;g" \
-e "s;@RPATH@;$RPATH;g" \
-e "s;@SYSCONFDIR@;$SYSCONFDIR;g" \
-- "$source" > "$target" -- "$source" > "$target"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
$DEBUG $RM -- "$target" $DEBUG $RM -- "$target"

View File

@ -4,5 +4,5 @@ dist=Makefile,libDatabase.pc.in,pkgconfig.sh
[libDatabase.pc] [libDatabase.pc]
type=script type=script
script=./pkgconfig.sh script=./pkgconfig.sh
depends=libDatabase.pc.in,../config.sh depends=libDatabase.pc.in,pkgconfig.sh,../config.sh
install= install=

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
#$Id$ #$Id$
#Copyright (c) 2012-2015 Pierre Pronchery <khorben@defora.org> #Copyright (c) 2012-2017 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:
@ -47,7 +47,7 @@ TOUCH="touch"
#debug #debug
_debug() _debug()
{ {
echo "$@" 1>&2 echo "$@" 1>&3
"$@" "$@"
} }
@ -72,7 +72,7 @@ _usage()
clean=0 clean=0
install=0 install=0
uninstall=0 uninstall=0
while getopts "ciuP:" name; do while getopts "ciO:uP:" name; do
case "$name" in case "$name" in
c) c)
clean=1 clean=1
@ -81,6 +81,9 @@ while getopts "ciuP:" name; do
uninstall=0 uninstall=0
install=1 install=1
;; ;;
O)
export "${OPTARG%%=*}"="${OPTARG#*=}"
;;
u) u)
install=0 install=0
uninstall=1 uninstall=1
@ -95,7 +98,7 @@ while getopts "ciuP:" name; do
esac esac
done done
shift $((OPTIND - 1)) shift $((OPTIND - 1))
if [ $# -eq 0 ]; then if [ $# -lt 1 ]; then
_usage _usage
exit $? exit $?
fi fi
@ -110,6 +113,7 @@ MODULE="$PACKAGE"
[ -z "$DATADIR" ] && DATADIR="$PREFIX/share" [ -z "$DATADIR" ] && DATADIR="$PREFIX/share"
instdir="$DATADIR/gtk-doc/html" instdir="$DATADIR/gtk-doc/html"
exec 3>&1
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
target="$1" target="$1"
target="${target#$OBJDIR}" target="${target#$OBJDIR}"

View File

@ -23,20 +23,20 @@ depends=../tools/subst.sh,database.xml.in
[gtkdoc/libDatabase.types] [gtkdoc/libDatabase.types]
type=script type=script
script=./gtkdoc.sh script=./gtkdoc.sh
depends=../config.sh depends=gtkdoc.sh,../config.sh
[gtkdoc/tmpl.stamp] [gtkdoc/tmpl.stamp]
type=script type=script
script=./gtkdoc.sh script=./gtkdoc.sh
depends=gtkdoc/libDatabase.types depends=gtkdoc.sh,gtkdoc/libDatabase.types
[gtkdoc/sgml.stamp] [gtkdoc/sgml.stamp]
type=script type=script
script=./gtkdoc.sh script=./gtkdoc.sh
depends=gtkdoc/tmpl.stamp depends=gtkdoc.sh,gtkdoc/tmpl.stamp
[gtkdoc/html.stamp] [gtkdoc/html.stamp]
type=script type=script
script=./gtkdoc.sh script=./gtkdoc.sh
depends=gtkdoc/libDatabase-docs.xml,gtkdoc/sgml.stamp depends=gtkdoc.sh,gtkdoc/libDatabase-docs.xml,gtkdoc/sgml.stamp
install= install=

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
#$Id$ #$Id$
#Copyright (c) 2014-2015 Pierre Pronchery <khorben@defora.org> #Copyright (c) 2014-2017 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:
@ -26,22 +26,47 @@
#variables #variables
PROGNAME="pylint.sh" PROGNAME="pylint.sh"
PROJECTCONF="../project.conf"
#executables #executables
DATE="date"
DEBUG="_debug" DEBUG="_debug"
FIND="find" FIND="find"
PYLINT="pep8" PYLINT="pep8"
SORT="sort -n"
TR="tr"
#functions #functions
#pylint #pylint
_pylint() _pylint()
{ {
filename="$1" subdirs="data doc src tests tools"
#XXX ignores errors $DATE
$DEBUG $PYLINT -- "$filename" 2>&1 | while read line; do while read line; do
echo "$line" 1>&2 case "$line" in
echo "$line" "["*)
break
;;
"subdirs="*)
subdirs=${line#subdirs=}
subdirs=$(echo "$subdirs" | $TR ',' ' ')
;;
esac
done < "$PROJECTCONF"
for subdir in $subdirs; do
[ -d "../$subdir" ] || continue
for filename in $($FIND "../$subdir" -type f -a -name '*.py' | $SORT); do
echo
echo "Testing: $filename"
$DEBUG $PYLINT -- "$filename" 2>&1
if [ $? -eq 0 ]; then
echo "$PROGNAME: $filename: OK" 1>&2
else
#XXX ignore errors
echo "$PROGNAME: $filename: FAIL" 1>&2
fi
done
done done
} }
@ -49,7 +74,7 @@ _pylint()
#debug #debug
_debug() _debug()
{ {
echo "$@" 1>&2 echo "$@" 1>&3
"$@" "$@"
res=$? res=$?
#ignore errors when the command is not available #ignore errors when the command is not available
@ -61,18 +86,21 @@ _debug()
#usage #usage
_usage() _usage()
{ {
echo "Usage: $PROGNAME [-c] target" 1>&2 echo "Usage: $PROGNAME [-c] target..." 1>&2
return 1 return 1
} }
#main #main
clean=0 clean=0
while getopts "cP:" name; do while getopts "cO:P:" name; do
case "$name" in case "$name" in
c) c)
clean=1 clean=1
;; ;;
O)
export "${OPTARG%%=*}"="${OPTARG#*=}"
;;
P) P)
#XXX ignored for compatibility #XXX ignored for compatibility
;; ;;
@ -83,19 +111,18 @@ while getopts "cP:" name; do
esac esac
done done
shift $((OPTIND - 1)) shift $((OPTIND - 1))
if [ $# -ne 1 ]; then if [ $# -lt 1 ]; then
_usage _usage
exit $? exit $?
fi fi
target="$1"
#clean #clean
[ $clean -ne 0 ] && exit 0 [ $clean -ne 0 ] && exit 0
ret=0 exec 3>&1
(date while [ $# -gt 0 ]; do
echo target="$1"
$FIND "../doc" "../src" "../tests" "../tools" -name '*.py' | while read filename; do shift
_pylint "$filename"
done) > "$target" _pylint > "$target" || exit 2
exit $ret done

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
#$Id$ #$Id$
#Copyright (c) 2014-2016 Pierre Pronchery <khorben@defora.org> #Copyright (c) 2014-2017 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:
@ -58,7 +58,7 @@ _shlint()
done < "$PROJECTCONF" done < "$PROJECTCONF"
for subdir in $subdirs; do for subdir in $subdirs; do
[ -d "../$subdir" ] || continue [ -d "../$subdir" ] || continue
for filename in $($FIND "../$subdir" -name '*.sh' | $SORT); do for filename in $($FIND "../$subdir" -type f -a -name '*.sh' | $SORT); do
_shlint_file "$filename" _shlint_file "$filename"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "$filename:" echo "$filename:"
@ -109,7 +109,7 @@ _debug()
#usage #usage
_usage() _usage()
{ {
echo "Usage: $PROGNAME [-c] target" 1>&2 echo "Usage: $PROGNAME [-c] target..." 1>&2
return 1 return 1
} }
@ -124,11 +124,14 @@ _warning()
#main #main
clean=0 clean=0
while getopts "cP:" name; do while getopts "cO:P:" name; do
case "$name" in case "$name" in
c) c)
clean=1 clean=1
;; ;;
O)
export "${OPTARG%%=*}"="${OPTARG#*=}"
;;
P) P)
#XXX ignored for compatibility #XXX ignored for compatibility
;; ;;
@ -139,14 +142,18 @@ while getopts "cP:" name; do
esac esac
done done
shift $((OPTIND - 1)) shift $((OPTIND - 1))
if [ $# -ne 1 ]; then if [ $# -lt 1 ]; then
_usage _usage
exit $? exit $?
fi fi
target="$1"
#clean #clean
[ $clean -ne 0 ] && exit 0 [ $clean -ne 0 ] && exit 0
exec 3>&1 exec 3>&1
_shlint > "$target" while [ $# -gt 0 ]; do
target="$1"
shift
_shlint > "$target" || exit 2
done