/var/lib/sorcery/modules/url_handlers/url_dir

     1	#!/bin/bash
     2	#---------------------------------------------------------------------
     3	##
     4	##=head1 SYNOPSIS
     5	##
     6	## Url handler functions for grabbing directory urls.
     7	##
     8	##=head1 DESCRIPTION
     9	##
    10	## This type of url was added as a response to the following request:
    11	##
    12	##   I'm an AbiWord developer, and I keep the latest source
    13	##   tree in my abi directory. If I could make the abi spell
    14	##   (not to be confused with the abispell) use my current
    15	##   CVS checked-out tree, that would  be nice.
    16	##
    17	## This file contains functions for I<downloading> (actually it just
    18	## copies, tars, and compresses) directories which can be accessed
    19	## through the local file system.
    20	##
    21	## Url's of this type are specified using the format
    22	##
    23	##  dir://<directory>
    24	##
    25	## where <directory> is the full path to a directory that will be
    26	## tarred and compressed for use by sorcery in casting a spell.
    27	##
    28	##=head1 COPYRIGHT
    29	##
    30	## Copyright 2002 by the Source Mage Team
    31	##
    32	##=head1 FUNCTIONS
    33	##
    34	##=over 4
    35	##
    36	#---------------------------------------------------------------------
    37	
    38	#---------------------------------------------------------------------
    39	##=item url_dir_verify <url>
    40	##
    41	## Verifies the specified directory exists.  Returns true if the
    42	## directory exists OR if the dir is an empty string.
    43	##
    44	#---------------------------------------------------------------------
    45	function url_dir_verify() {
    46	
    47	  DIRNAME=`url_dir_crack $1`
    48	  if  [  -n  "$DIRNAME"  ]; then
    49	      [  -d  "$DIRNAME"  ]
    50	  fi
    51	}
    52	
    53	#---------------------------------------------------------------------
    54	##=back
    55	##
    56	##=head1 LICENSE
    57	##
    58	## This software is free software; you can redistribute it and/or modify
    59	## it under the terms of the GNU General Public License as published by
    60	## the Free Software Foundation; either version 2 of the License, or
    61	## (at your option) any later version.
    62	##
    63	## This software is distributed in the hope that it will be useful,
    64	## but WITHOUT ANY WARRANTY; without even the implied warranty of
    65	## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    66	## GNU General Public License for more details.
    67	##
    68	## You should have received a copy of the GNU General Public License
    69	## along with this software; if not, write to the Free Software
    70	## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    71	##
    72	#---------------------------------------------------------------------