bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] Treatment of symbolic link


From: Shigio YAMAGUCHI
Subject: Re: [RFC] Treatment of symbolic link
Date: Thu, 28 Feb 2008 10:23:54 +0900

Hello,
I have modified global(1) and gtags(1) to allow symbolic link.
To realize it, I used normalize_path() and abs2rel() in libutil/abs2rel.c
module instead of realpath(3) library function.

Though the symbolic link to a directory might confuse users,
it is originally as such. They should understand the characteristic.

----------------------------------------------------------------------
[Example]
----------------------------------------------------------------------
/tmp
  +-global
  |  +-GTAGS
  |  +-gtags ----+ (symbolic link to ../work/gtag2)
  |  +-htags --+ | (symbolic link to ../work/htag2)
  |            | |
  +-work       | |
     +-gtag2 <-+ |
     |  +-gtags.c|
     |           |
     +-htag2 <---+
        +-htags.c

Current version
===============

$ cd /tmp/global
$ gtags
Warning: './gtags' is a directory. (Ignored)
Warning: './htags' is a directory. (Ignored)
...
$ global -f gtags/gtags.c
'/tmp/work/gtags/gtags.c' is out of source tree.

New version
===========

$ cd /tmp/global
$ gtags
$ global -f gtags/gtags.c
usage              91 gtags/gtags.c  usage(void)
help               98 gtags/gtags.c  help(void)
...
$ global -f gtags/../htags/htags.c
mkdir              61 htags/htags.c  #define mkdir(path,mode) mkdir(path)
link               62 htags/htags.c  #define link(one,two) (-1)
...
% cd gtags                                      <= get out of the source tree
$ global -f gtags.c
global: GTAGS not found.
$ pwd
/tmp/work/gtags
----------------------------------------------------------------------

Please tell me if there is something problem.
Thank you in advance.

On Sun, 13 Jan 2008 19:19:13 +0900
"Shigio YAMAGUCHI" <address@hidden> wrote:

> How about changing the specification of directory traverse with symbolic link?
> 
> 1. Current Specification
> 
> Synbolic link which points to a directory is ignored.
> 
> % gtags
> % global -x main
> main                4 a/main.c         main(int argc, char *argv[])
> % ln -s a b
> % gtags
> Warning: './b' is a directory. (Ignored)
> Warning: './b' is a directory. (Ignored)
> Warning: './b' is a directory. (Ignored)
> % global -x main
> main                4 a/main.c         main(int argc, char *argv[])
> 
> 2. New Specification
> 
> Synbolic link which points to a directory is accepted.
> 
> % gtags
> % global -x main
> main                4 a/main.c         main(int argc, char *argv[])
> % ln -s a b
> % gtags
> % global -x main
> main                4 a/main.c         main(int argc, char *argv[])
> main                4 b/main.c         main(int argc, char *argv[])
> 
> 
> Though I do not remember why to have made it to such a specification,
> maybe it was to avoid parsing a file many times.
> Anyway, I think it is bad specification or a bug.
> --
> Shigio Yamaguchi <address@hidden> - Tama Communications Corporation
> PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3
> 


-- 
Shigio YAMAGUCHI <address@hidden> - GNU Project
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]