[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnu-arch-users] [BUG] my-revision-library broken
From: |
Aaron Bentley |
Subject: |
Re: [Gnu-arch-users] [BUG] my-revision-library broken |
Date: |
Tue, 28 Sep 2004 16:01:27 -0400 |
User-agent: |
Mozilla Thunderbird 0.5 (X11/20040309) |
Johannes Berg wrote:
On Tue, 2004-09-28 at 12:18 -0400, Aaron Bentley wrote:
It looks like you're stumbling over this:
181: dir = directory_as_cwd (argv[1]);
I think I'm looking at a totally different copy of the code. Here, I
have a copy that doesn't use the dir variable (in my.c,
arch_set_my_library_path)
I was looking at cmd-my-revision-library.c.
So, I think the appropriate code is:
if (dir_exists (dir))
dir = canonicalize (dir);
else if (operation == add)
printf ("Can't add revlib; dir does not exist\n%s: ", dir);
exit (2);
Does that help?
Thats about what I was thinking, but the code in my.c is somewhat more
complex since it rebuilds the complete list.
It should be done at the my-revision-library.c level.
Could someone else please look at it? Whoever
does can also remove the dir variable from
libarch/my.c:arch_set_my_library_path(), it is apparently unnecessary.
Huh? That function requires a dir to add/remove.
Here, it has a local variable "dir", and its only uses are:
dir = safe_current_working_directory ();
lim_free (0, dir);
After invoking fai --revisions --modified, I can report...
It's a fossil.
The code was inserted in:
address@hidden/file-utils--devo--1.0--patch-77
Originally, this was part of an in-line version of directory_as_cwd, but
nowadays, dir_spec is used, and it's produced using directory_as_cwd.
===
safe_chdir (dir_spec);
dir = safe_current_working_directory ();
lib_file = arch_my_default_library_file ();
lib_dir = file_name_directory (0, lib_file);
ensure_directory_exists (lib_dir);
out_fd = safe_open (lib_file, O_WRONLY | O_CREAT, 0777);
safe_ftruncate (out_fd, 0L);
safe_printfmt (out_fd, "%s\n", dir);
===
Aaron
--
Aaron Bentley
Director of Technology
Panometrics, Inc.
Re: [Gnu-arch-users] [BUG] my-revision-library broken, Bug Goo, 2004/09/29