Fix mandir for installing. trunk tip
authorRoger Light <roger@atchoo.org>
Tue Jan 27 10:54:13 2009 +0000 (2009-01-27)
branchtrunk
changeset 44c2b9204b5d35
parent 43 cb31a5ebe804
Fix mandir for installing.
config.mk
po/treewatch.pot
src/treewatch.c
     1.1 --- a/config.mk	Tue Jan 27 10:52:34 2009 +0000
     1.2 +++ b/config.mk	Tue Jan 27 10:54:13 2009 +0000
     1.3 @@ -11,5 +11,5 @@
     1.4  MSGFMT=msgfmt
     1.5  
     1.6  prefix=/usr/local
     1.7 -mandir=${prefix}/man
     1.8 +mandir=${prefix}/share/man
     1.9  
     2.1 --- a/po/treewatch.pot	Tue Jan 27 10:52:34 2009 +0000
     2.2 +++ b/po/treewatch.pot	Tue Jan 27 10:54:13 2009 +0000
     2.3 @@ -8,7 +8,7 @@
     2.4  msgstr ""
     2.5  "Project-Id-Version: PACKAGE VERSION\n"
     2.6  "Report-Msgid-Bugs-To: \n"
     2.7 -"POT-Creation-Date: 2008-11-16 13:42+0000\n"
     2.8 +"POT-Creation-Date: 2009-01-17 09:33+0000\n"
     2.9  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    2.10  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    2.11  "Language-Team: LANGUAGE <LL@li.org>\n"
    2.12 @@ -16,29 +16,29 @@
    2.13  "Content-Type: text/plain; charset=CHARSET\n"
    2.14  "Content-Transfer-Encoding: 8bit\n"
    2.15  
    2.16 -#: ../src/treewatch.c:137 ../src/treewatch.c:205
    2.17 +#: ../src/treewatch.c:141 ../src/treewatch.c:209
    2.18  #, c-format
    2.19  msgid "Error: Out of memory\n"
    2.20  msgstr ""
    2.21  
    2.22 -#: ../src/treewatch.c:173 ../src/treewatch.c:231
    2.23 +#: ../src/treewatch.c:177 ../src/treewatch.c:235
    2.24  #, c-format
    2.25  msgid "--- %s exited with status %d ---\n"
    2.26  msgstr ""
    2.27  
    2.28 -#: ../src/treewatch.c:264
    2.29 +#: ../src/treewatch.c:268
    2.30  #, c-format
    2.31  msgid "Error: inotify initialization failed.\n"
    2.32  msgstr ""
    2.33  
    2.34 -#: ../src/treewatch.c:290
    2.35 +#: ../src/treewatch.c:294
    2.36  #, c-format
    2.37  msgid ""
    2.38  "treewatch version %s (build date: %s)\n"
    2.39  "\n"
    2.40  msgstr ""
    2.41  
    2.42 -#: ../src/treewatch.c:291
    2.43 +#: ../src/treewatch.c:295
    2.44  #, c-format
    2.45  msgid ""
    2.46  "Copyright (C) 2008 Roger Light\n"
    2.47 @@ -46,7 +46,7 @@
    2.48  "\n"
    2.49  msgstr ""
    2.50  
    2.51 -#: ../src/treewatch.c:292
    2.52 +#: ../src/treewatch.c:296
    2.53  #, c-format
    2.54  msgid ""
    2.55  "treewatch comes with ABSOLUTELY NO WARRANTY.  You may distribute treewatch "
    2.56 @@ -55,7 +55,7 @@
    2.57  "\n"
    2.58  msgstr ""
    2.59  
    2.60 -#: ../src/treewatch.c:293
    2.61 +#: ../src/treewatch.c:297
    2.62  #, c-format
    2.63  msgid ""
    2.64  "treewatch is a program to watch a directory and execute a program on file "
    2.65 @@ -63,12 +63,12 @@
    2.66  "\n"
    2.67  msgstr ""
    2.68  
    2.69 -#: ../src/treewatch.c:294
    2.70 +#: ../src/treewatch.c:298
    2.71  #, c-format
    2.72  msgid "Usage: treewatch -h\n"
    2.73  msgstr ""
    2.74  
    2.75 -#: ../src/treewatch.c:295
    2.76 +#: ../src/treewatch.c:299
    2.77  #, c-format
    2.78  msgid ""
    2.79  "       treewatch [-aw] [-c command] [-d dir] [-f file] [-o \"some options"
    2.80 @@ -76,7 +76,7 @@
    2.81  "\n"
    2.82  msgstr ""
    2.83  
    2.84 -#: ../src/treewatch.c:296
    2.85 +#: ../src/treewatch.c:300
    2.86  #, c-format
    2.87  msgid ""
    2.88  " -a, --all-files      Watch all files in the directories. Makes any --file-"
    2.89 @@ -84,21 +84,21 @@
    2.90  "                      arguments redundant.\n"
    2.91  msgstr ""
    2.92  
    2.93 -#: ../src/treewatch.c:297
    2.94 +#: ../src/treewatch.c:301
    2.95  #, c-format
    2.96  msgid ""
    2.97  " -c, --command        Specify full path to command to run (default: /usr/bin/"
    2.98  "make)\n"
    2.99  msgstr ""
   2.100  
   2.101 -#: ../src/treewatch.c:298
   2.102 +#: ../src/treewatch.c:302
   2.103  #, c-format
   2.104  msgid ""
   2.105  " -d, --directory      Directory to watch. May be specified multiple times.\n"
   2.106  "                      (default: current directory)\n"
   2.107  msgstr ""
   2.108  
   2.109 -#: ../src/treewatch.c:299
   2.110 +#: ../src/treewatch.c:303
   2.111  #, c-format
   2.112  msgid ""
   2.113  " -f, --file-ending    File endings to watch. May be specified mutiple "
   2.114 @@ -106,27 +106,27 @@
   2.115  "                      (default is to watch all of: .c .cpp .h)\n"
   2.116  msgstr ""
   2.117  
   2.118 -#: ../src/treewatch.c:300
   2.119 +#: ../src/treewatch.c:304
   2.120  #, c-format
   2.121  msgid " -h, --help           Display this help.\n"
   2.122  msgstr ""
   2.123  
   2.124 -#: ../src/treewatch.c:301
   2.125 +#: ../src/treewatch.c:305
   2.126  #, c-format
   2.127  msgid " -o, --options        Options to pass to the command to run.\n"
   2.128  msgstr ""
   2.129  
   2.130 -#: ../src/treewatch.c:302
   2.131 +#: ../src/treewatch.c:306
   2.132  #, c-format
   2.133  msgid " -v, --verbose        Be more verbose (print child exit status).\n"
   2.134  msgstr ""
   2.135  
   2.136 -#: ../src/treewatch.c:303
   2.137 +#: ../src/treewatch.c:307
   2.138  #, c-format
   2.139  msgid " -w, --no-wait        Don't wait for child command to terminate.\n"
   2.140  msgstr ""
   2.141  
   2.142 -#: ../src/treewatch.c:304
   2.143 +#: ../src/treewatch.c:308
   2.144  #, c-format
   2.145  msgid ""
   2.146  "\n"
     3.1 --- a/src/treewatch.c	Tue Jan 27 10:52:34 2009 +0000
     3.2 +++ b/src/treewatch.c	Tue Jan 27 10:54:13 2009 +0000
     3.3 @@ -245,6 +245,13 @@
     3.4  	}
     3.5  }
     3.6  
     3.7 +void add_watch(int inotify_fd, const char *directory, int recurse)
     3.8 +{
     3.9 +	inotify_add_watch(inotify_fd, directory, IN_CLOSE_WRITE | IN_DELETE | IN_MOVED_TO);
    3.10 +	if(recurse){
    3.11 +	}
    3.12 +}
    3.13 +
    3.14  
    3.15  int main(int argc, char *argv[])
    3.16  {
    3.17 @@ -252,6 +259,7 @@
    3.18  	int sopt, optindex;
    3.19  	/* has the user used a -d argument? If not then use the default directory. */
    3.20  	int have_directory = 0;
    3.21 +	int recurse = 0;
    3.22  
    3.23  	waitforcommand = 1;
    3.24  	command = NULL;
    3.25 @@ -282,7 +290,7 @@
    3.26  				break;
    3.27  			case 'd':
    3.28  				/* Specify directories to watch */
    3.29 -				inotify_add_watch(reconfigure_fd, optarg, IN_CLOSE_WRITE | IN_DELETE | IN_MOVED_TO);
    3.30 +				add_watch(reconfigure_fd, optarg, recurse);
    3.31  				have_directory = 1;
    3.32  				break;
    3.33  			case 'f':
    3.34 @@ -311,6 +319,9 @@
    3.35  			case 'o':
    3.36  				command_options = optarg;
    3.37  				break;
    3.38 +			case 'r':
    3.39 +				recurse = 1;
    3.40 +				break;
    3.41  			case 'v':
    3.42  				verbose = 1;
    3.43  				break;
    3.44 @@ -328,7 +339,7 @@
    3.45  	if(!command_options) command_options = strdup("");
    3.46  
    3.47  	if(!have_directory){
    3.48 -		inotify_add_watch(reconfigure_fd, ".", IN_CLOSE_WRITE | IN_DELETE | IN_MOVED_TO);
    3.49 +		add_watch(reconfigure_fd, ".", recurse);
    3.50  	}
    3.51  	if(!fileendings_count){
    3.52  		fileendings_count = 3;