/[cvs]/eggdrop1.9/misc/addpatch
ViewVC logotype

Contents of /eggdrop1.9/misc/addpatch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download)
Mon Mar 24 02:42:39 2003 UTC (16 years, 1 month ago) by wcc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
* Removed patch.h.

1 #! /bin/sh
2 #
3 # addpatch - modifies src/patch.h
4 #
5 # Copyright (C) 2002, 2003 Eggheads Development Team
6 # Copyright (C) 2000 Fabian Knittel <fknittel@gmx.de>
7 #
8 # This file is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
26 #
27 # $Id: addpatch,v 1.4 2003/03/05 02:16:20 wcc Exp $
28
29
30 show_usage()
31 {
32 echo "Usage: $0 <patch-name> [unixtime]"
33 echo ""
34 echo " patch-name - Name of last patch added."
35 echo " unixtime - Some unixtime number or 'now'. Default is 'now'."
36 exit 1
37 }
38
39 if test "x$1" = "x"; then
40 show_usage;
41 else
42 patch_name=$1
43 fi
44
45 if test ! -f src/main.c; then
46 echo "You are not in the Eggdrop root directory."
47 exit 1
48 fi
49
50 if test "x$2" = "x"; then
51 unix_time=`date +%s`
52 echo "Setting unixtime to now."
53 else
54 unix_time=$2
55 fi
56
57 if test "${unix_time}" = now; then
58 unix_time=`date +%s`
59 echo "Setting unixtime to now."
60 fi
61
62 echo "Patching src/patch.h:"
63 echo " unixtime: ${unix_time}, patch name: ${patch_name}"
64 if sed src/patch.h -e "s/^patch.*\")\(.*current unixtime.*\)/patch(\"${unix_time}\")\1/" -e "s/^patch.*);$/patch(\"${patch_name}\");/" > src/patch.h_
65 then
66 mv src/patch.h_ src/patch.h
67 else
68 echo "Failed to adjust src/patch.h"
69 exit 1
70 fi
71
72 exit 0

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23