On Sun, Jan 05, 2003 at 01:02:22PM -0800, Will Lowe wrote:
> > Note carefully that Jon says "like".  The "include" keyword does *not*
> > do patterns.  You must explicitly list each item to be included.
> 
> That's ok,  provided I can list directories ... something like this:
> 
> ./var/spool/mail
> ./usr/local
> ./etc
> ./var/log/samba
> 
> ... and just catch those directories and everything in them.  That
> will work, I presume?  The manpage says soemthing confusing about not
> allowing more than one '/', but gnutar's -T option seems to support
> that just fine.

Try this patch, amanda will use the pattern without check if it
contains to /.

Jean-Louis
-- 
Jean-Louis Martineau             email: [EMAIL PROTECTED] 
Departement IRO, Universite de Montreal
C.P. 6128, Succ. CENTRE-VILLE    Tel: (514) 343-6111 ext. 3529
Montreal, Canada, H3C 3J7        Fax: (514) 343-5834
--- /u/martinea/amcore/amanda-2.4.3/client-src/client_util.c    2003-01-02 
20:05:56.000000000 -0500
+++ client-src/client_util.c    2003-01-05 17:31:36.000000000 -0500
@@ -193,28 +193,32 @@
        return 0;
     }
     else {
-       char *glob;
-       char *regex;
-       DIR *d;
-       struct dirent *entry;
-
-       glob = ainc+2;
-       regex = glob_to_regex(glob);
-       if((d = opendir(device)) == NULL) {
-           dbprintf(("%s: Can't open disk '%s']\n",
-                     debug_prefix(NULL), device));
-           if(verbose)
-               printf("ERROR [Can't open disk '%s']\n", device);
-           return 0;
+       char *incname = ainc+2;
+       if(strchr(incname, '/')) {
+           fprintf(file_include, "./%s\n", incname);
        }
        else {
-           while((entry = readdir(d)) != NULL) {
-               if(is_dot_or_dotdot(entry->d_name)) {
-                   continue;
-               }
-               if(match(regex, entry->d_name)) {
-                   fprintf(file_include, "./%s\n", entry->d_name);
-                   nb_exp++;
+           char *regex;
+           DIR *d;
+           struct dirent *entry;
+
+           regex = glob_to_regex(incname);
+           if((d = opendir(device)) == NULL) {
+               dbprintf(("%s: Can't open disk '%s']\n",
+                     debug_prefix(NULL), device));
+               if(verbose)
+                   printf("ERROR [Can't open disk '%s']\n", device);
+               return 0;
+           }
+           else {
+               while((entry = readdir(d)) != NULL) {
+                   if(is_dot_or_dotdot(entry->d_name)) {
+                       continue;
+                   }
+                   if(match(regex, entry->d_name)) {
+                       fprintf(file_include, "./%s\n", entry->d_name);
+                       nb_exp++;
+                   }
                }
            }
        }

Reply via email to