Debian Codegraph @

clean-docdir

raw
1 #!/bin/sh
2
3 # Copyright © 2024, 2025 Rafael Laboissière <[email protected]>
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, see <https://www.gnu.org/licenses/>.
17
18 dir=$(find $1 -name doc)
19 if [ -n "$dir" -a -d $dir ] ; then
20 for i in $(find $dir) ; do
21 ext=${i##*.}
22 if [ "$ext" != qhc -a "$ext" != qch ] ; then
23 keep=no
24 for j in $DH_OCTAVE_KEEP_DOC ; do
25 if [ "$j" = "${i#$dir/}" ] ; then
26 keep=yes
27 break
28 fi
29 done
30 [ $keep = "no" ] && rm -f $i
31 fi
32 done
33 # Remove empty sub-directories
34 find $dir -type d -empty -delete
35 fi
36
37 # Local Variables:
38 # indent-tabs-mode: nil
39 # tab-width: 4
40 # End: