~ubuntu-manpage-repository-dev/ubuntu-manpage-repository/production

« back to all changes in this revision

Viewing changes to bin/make-sitemaps.sh

merge up to trunk r222

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh -e
 
1
#!/bin/bash -e
2
2
 
3
3
###############################################################################
4
4
# This is the Ubuntu manpage repository generator and interface.
5
 
 
5
#
6
6
# Copyright (C) 2008 Canonical Ltd.
7
 
 
7
#
8
8
# This code was originally written by Dustin Kirkland <kirkland@ubuntu.com>,
9
9
# based on a framework by Kees Cook <kees@ubuntu.com>.
10
 
 
10
#
11
11
# This program is free software: you can redistribute it and/or modify
12
12
# it under the terms of the GNU General Public License as published by
13
13
# the Free Software Foundation, either version 3 of the License, or
14
14
# (at your option) any later version.
15
 
 
15
#
16
16
# This program is distributed in the hope that it will be useful,
17
17
# but WITHOUT ANY WARRANTY; without even the implied warranty of
18
18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
19
# GNU General Public License for more details.
20
 
 
20
#
21
21
# You should have received a copy of the GNU General Public License
22
22
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
 
 
23
#
24
24
# On Debian-based systems, the complete text of the GNU General Public
25
25
# License can be found in /usr/share/common-licenses/GPL-3
26
26
###############################################################################
27
27
 
28
 
 
29
28
# Generate sitemaps per sitemaps.org for google.com
30
29
 
31
 
. ./config 
 
30
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
31
 
 
32
# shellcheck disable=SC1090
 
33
. "$DIR/../config"
32
34
 
33
35
printf "%s\n" "INFO: Making sitemaps"
34
36
 
 
37
(
35
38
cd "$PUBLIC_HTML_DIR"
36
39
find manpages/ -type f -name "*.html" | xargs -i printf "%s\n" "<url><loc>$SITE/{}</loc></url>" | split -l 50000 - manpages/sitemap_
37
40
 
43
46
        echo "</urlset>" >> "$i.xml"
44
47
        rm -f "$i"
45
48
done
46
 
cd -
 
49
)