release.sh: Handle git submodules when setting up git worktree
[xorg-util-modular.git] / make-readme.pl
blob04eed84583a82c92b253a6f8bf434d929988613f
1 #! /usr/bin/perl -w
3 # Script to add some common URL's to X.Org module README files so that
4 # people finding them packaged in distros or mirrored on other sites
5 # have an easier time finding the origin and our bugtracker/git/etc.
7 ###########################################################################
9 # Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
11 # Permission is hereby granted, free of charge, to any person obtaining a
12 # copy of this software and associated documentation files (the "Software"),
13 # to deal in the Software without restriction, including without limitation
14 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
15 # and/or sell copies of the Software, and to permit persons to whom the
16 # Software is furnished to do so, subject to the following conditions:
18 # The above copyright notice and this permission notice (including the next
19 # paragraph) shall be included in all copies or substantial portions of the
20 # Software.
22 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28 # DEALINGS IN THE SOFTWARE.
30 ###########################################################################
32 use strict;
33 use Cwd;
35 my $module = cwd();
36 $module =~ s|^.*/([^/]+)/([^/]+)$|$1/$2|;
38 my $modname = $2;
40 my $desc;
42 my @manpage = glob('man/*.man');
43 push @manpage, glob('*.man');
45 foreach my $manpage (@manpage) {
46 if ($manpage && (-f $manpage)) {
47 open(my $MANPAGE, '<', $manpage) or warn "Cannot read $manpage\n";
49 while (my $l = <$MANPAGE>) {
50 if ($l =~ /^.SH NAME/) {
51 $desc = <$MANPAGE>;
52 last;
55 close($MANPAGE);
57 chomp($desc);
59 # Remove backslashes, such as \- instead of -
60 $desc =~ s/\\//g;
62 if ($modname =~ /^xf86-(input|video)-(.*)$/) {
63 my $driver = $2;
65 $desc =~ s/^\s*$driver/$modname/;
66 $desc =~ s/driver$/driver for the Xorg X server/;
69 last if ($desc ne '');
73 open(my $README, '>>', 'README') or die;
75 if ($desc) {
76 print $README $desc, "\n";
79 print $README <<__EOF__;
81 All questions regarding this software should be directed at the
82 Xorg mailing list:
84 http://lists.freedesktop.org/mailman/listinfo/xorg
86 Please submit bug reports to the Xorg bugzilla:
88 https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
90 The primary development code repository can be found at:
92 git://anongit.freedesktop.org/git/xorg/$module
94 http://cgit.freedesktop.org/xorg/$module
96 For patch submission instructions, see:
98 http://www.x.org/wiki/Development/Documentation/SubmittingPatches
100 For more information on the git code manager, see:
102 http://wiki.x.org/wiki/GitPage
104 __EOF__
106 close($README);