Skip to content

Commit f80008c

Browse files
committed
Import newer scripts upstream
1 parent a936573 commit f80008c

File tree

3 files changed

+46
-20
lines changed

3 files changed

+46
-20
lines changed

data/pkgconfig.sh

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#$Id$
3-
#Copyright (c) 2011-2014 Pierre Pronchery <khorben@defora.org>
3+
#Copyright (c) 2011-2015 Pierre Pronchery <khorben@defora.org>
44
#
55
#Redistribution and use in source and binary forms, with or without
66
#modification, are permitted provided that the following conditions are met:
@@ -29,6 +29,7 @@ PREFIX="/usr/local"
2929
[ -f "../config.sh" ] && . "../config.sh"
3030
DEBUG="_debug"
3131
DEVNULL="/dev/null"
32+
PROGNAME="pkgconfig.sh"
3233
#executables
3334
INSTALL="install -m 0644"
3435
MKDIR="mkdir -m 0755 -p"
@@ -40,23 +41,23 @@ SED="sed"
4041
#debug
4142
_debug()
4243
{
43-
echo "$@" 1>&2
44+
echo "$@" 1>&3
4445
"$@"
4546
}
4647

4748

4849
#error
4950
_error()
5051
{
51-
echo "pkgconfig.sh: $@" 1>&2
52+
echo "$PROGNAME: $@" 1>&2
5253
return 2
5354
}
5455

5556

5657
#usage
5758
_usage()
5859
{
59-
echo "Usage: pkgconfig.sh [-c|-i|-u][-P prefix] target..." 1>&2
60+
echo "Usage: $PROGNAME [-c|-i|-u][-P prefix] target..." 1>&2
6061
return 1
6162
}
6263

@@ -104,6 +105,7 @@ if [ -z "$VERSION" ]; then
104105
fi
105106

106107
PKGCONFIG="$PREFIX/lib/pkgconfig"
108+
exec 3>&1
107109
while [ $# -gt 0 ]; do
108110
target="$1"
109111
shift
@@ -121,7 +123,11 @@ while [ $# -gt 0 ]; do
121123
if [ "$install" -eq 1 ]; then
122124
source="${target#$OBJDIR}"
123125
$DEBUG $MKDIR -- "$PKGCONFIG" || exit 2
124-
$DEBUG $INSTALL "$target" "$PKGCONFIG/$source" || exit 2
126+
basename="$source"
127+
if [ "${source##*/}" != "$source" ]; then
128+
basename="${source##*/}"
129+
fi
130+
$DEBUG $INSTALL "$target" "$PKGCONFIG/$basename"|| exit 2
125131
continue
126132
fi
127133

doc/gtkdoc.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ TOUCH="touch"
4747
#debug
4848
_debug()
4949
{
50-
echo "$@" 1>&2
50+
echo "$@" 1>&3
5151
"$@"
5252
}
5353

@@ -110,6 +110,7 @@ MODULE="$PACKAGE"
110110
[ -z "$DATADIR" ] && DATADIR="$PREFIX/share"
111111
instdir="$DATADIR/gtk-doc/html"
112112

113+
exec 3>&1
113114
while [ $# -gt 0 ]; do
114115
target="$1"
115116
target="${target#$OBJDIR}"

tests/pylint.sh

+33-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#$Id$
3-
#Copyright (c) 2014-2015 Pierre Pronchery <khorben@defora.org>
3+
#Copyright (c) 2014-2016 Pierre Pronchery <khorben@defora.org>
44
#
55
#Redistribution and use in source and binary forms, with or without
66
#modification, are permitted provided that the following conditions are met:
@@ -26,30 +26,54 @@
2626

2727
#variables
2828
PROGNAME="pylint.sh"
29+
PROJECTCONF="../project.conf"
2930
#executables
31+
DATE="date"
3032
DEBUG="_debug"
3133
FIND="find"
3234
PYLINT="pep8"
35+
SORT="sort"
36+
TR="tr"
3337

3438

3539
#functions
3640
#pylint
3741
_pylint()
3842
{
39-
filename="$1"
43+
subdirs="data doc src tests tools"
4044

41-
#XXX ignores errors
42-
$DEBUG $PYLINT -- "$filename" 2>&1 | while read line; do
43-
echo "$line" 1>&2
44-
echo "$line"
45+
$DATE
46+
echo
47+
while read line; do
48+
case "$line" in
49+
"["*)
50+
break
51+
;;
52+
"subdirs="*)
53+
subdirs=${line#subdirs=}
54+
subdirs=$(echo "$subdirs" | $TR ',' ' ')
55+
;;
56+
esac
57+
done < "$PROJECTCONF"
58+
for subdir in $subdirs; do
59+
[ -d "../$subdir" ] || continue
60+
for filename in $($FIND "../$subdir" -name '*.py' | $SORT); do
61+
$DEBUG $PYLINT -- "$filename" 2>&1
62+
if [ $? -eq 0 ]; then
63+
echo "$filename:"
64+
else
65+
#XXX ignore errors
66+
echo "$PROGNAME: $filename: FAIL" 1>&2
67+
fi
68+
done
4569
done
4670
}
4771

4872

4973
#debug
5074
_debug()
5175
{
52-
echo "$@" 1>&2
76+
echo "$@" 1>&3
5377
"$@"
5478
res=$?
5579
#ignore errors when the command is not available
@@ -92,10 +116,5 @@ target="$1"
92116
#clean
93117
[ $clean -ne 0 ] && exit 0
94118

95-
ret=0
96-
(date
97-
echo
98-
$FIND "../doc" "../src" "../tests" "../tools" -name '*.py' | while read filename; do
99-
_pylint "$filename"
100-
done) > "$target"
101-
exit $ret
119+
exec 3>&1
120+
_pylint > "$target"

0 commit comments

Comments
 (0)