develop_begin_command - can't change directory

Cal Webster <[email protected]>
Newsgroups gmane.comp.version-control.aegis.user
Message-ID <1336772257.2265.5.camel@kc130ssa>
## Aegis Version:
rpm -q
------
aegis-4.24.4-rc1.i686
------

## Host OS:

uname -r
-----------------------
2.6.32-220.7.1.el6.i686
-----------------------

cat /etc/redhat-release
-----------------------
CentOS release 6.2 (Final)
-----------------------

## Synopsis: The "develop_begin_command" function throws an error when
attempting to change the working directory. This appears to be a bug in
Aegis.

## Problem Description: Regardless of how I construct or call the
commands, "cd" can't find any directories. By comparison, the
"build_command" function has no problems with this. According to the
description in aepconf (5) this should work.

Excerpt from aepconf man page:
------------------------------
develop_begin_command = string;
       This field contains a command to be executed whenever a 'aegis
       -Develop_Begin' command is successful.  If this field is
       absent, nothing is done.  Used by the aedb(1) command.  All of
       the substitutions described by aesub(5) are available.

       Executed as: the developer.  Current directory: the development
       directory of the change.  Exit status: ignored.
------------------------------

I need to remove all *.d (auto-dependency) derived files and rebuild
them as soon as development begins. Our projects are managed by
segregating subsystems in subdirectories of the main project so we have
to change directory to do anything. The derived auto-dependency files
contain paths to the integration directory so they poison the dependency
mappings. I've changed our Makefiles so the *.d files are removed at the
end of aeb but they still need to be re-generated at aedb.

## Results:

Variations I've tried:

====================================================
develop_begin_command = "cd hostcomp/ ; rm *.d ; make dep";
====================================================
aedb -p av8b94.17 -c 3
-----------------------
aegis: project "av8b94.17": change 3: development directory
	"/home/cwebster/aegis/av8b94.17.C003"
aegis: logging to "/home/cwebster/aegis/av8b94.17.C003/aegis.log"
aegis: cd /home/cwebster/aegis/av8b94.17.C003
aegis: cd hostcomp/ ; rm *.d ; make dep
/bin/sh: line 0: cd: hostcomp/: No such file or directory
aegis: warning: command "cd hostcomp/ ; rm *.d ; make dep" exit status 1
aegis: project "av8b94.17": change 3: merging files from all baselines
into
	working directory according to directory style
aegis: project "av8b94.17": change 3: user "cwebster" has begun
development
====================================================
develop_begin_command = "pwd ; cd ${Change
development_directory}/hostcomp ; rm *.d ; make dep";
====================================================
aedb -p av8b94.17  -c 4
-----------------------
aegis: project "av8b94.17": change 4: development directory
	"/home/cwebster/aegis/av8b94.17.C004"
aegis: logging to "/home/cwebster/aegis/av8b94.17.C004/aegis.log"
aegis: cd /home/cwebster/aegis/av8b94.17.C004
aegis: pwd ; cd /home/cwebster/aegis/av8b94.17.C004/hostcomp ; rm *.d ;
make
	dep
/home/cwebster/aegis/av8b94.17.C004
/bin/sh: line 0: cd: /home/cwebster/aegis/av8b94.17.C004/hostcomp: No
such file or directory
aegis: warning: command "pwd ;
cd /home/cwebster/aegis/av8b94.17.C004/hostcomp
	; rm *.d ; make dep" exit status 1
aegis: project "av8b94.17": change 4: merging files from all baselines
into
	working directory according to directory style
aegis: project "av8b94.17": change 4: user "cwebster" has begun
development
-----------------------
====================================================
develop_begin_command = "/usr/local/bin/fixdeps.sh";
====================================================
aedb -p av8b94.17  -c 5
-----------------------
aegis: project "av8b94.17": change 5: development directory
	"/home/cwebster/aegis/av8b94.17.C005"
aegis: logging to "/home/cwebster/aegis/av8b94.17.C005/aegis.log"
aegis: cd /home/cwebster/aegis/av8b94.17.C005
aegis: /usr/local/bin/fixdeps.sh
/usr/local/bin/fixdeps.sh: line 2: cd: hostcomp: No such file or
directory
rm: cannot remove `*.d': No such file or directory
make: *** No rule to make target `dep'.  Stop.
aegis: warning: command "/usr/local/bin/fixdeps.sh" exit status 2
aegis: project "av8b94.17": change 5: merging files from all baselines
into
	working directory according to directory style
aegis: project "av8b94.17": change 5: user "cwebster" has begun
development
-----------------------
====================================================

In the last attempt I created a shell script to use instead of bare
commands.

/usr/local/bin/fixdeps.sh
-------------------------
#!/bin/sh
cd hostcomp
rm *.d
make dep
-------------------------


## Both of these aegis.conf entries start the same way. One works but
the other doesn't.

build_command = "cd hostcomp/ ; STATE=${state} make dep ; STATE=${state}
make aegis_build";
develop_begin_command = "cd hostcomp/ ; rm *.d ; make dep";

Thank you!

Cal Webster
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.