debian/rules: "$(shell cd ..." causes make to execute a directory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pacemaker (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: pacemaker
Hello,
in debian/rules you have:
$(shell cd xml && for a in *-1.0.rng; do ln -s "$$a" `echo "$$a" | sed 's/-1.0//g'`; done)
I'm sorry to inform you that this contains at least two errors:
running "dpkg-buildpackage" ends with:
# set rng compatibility symlinks
/scratch/
make: execvp: /scratch/
make: *** [build-stamp] Error 127
dpkg-buildpackage: error: debian/rules build gave error exit status 2
the reason for this error is that the expression "$(shell cd xml ..." causes the cd command to
print out the current directory which then "make" tries to execute. Now I don't know if this
is the correct behaviour of the "shell" but you certainly can observe this behaviour in bash
scripts if the argument to the "cd" command is neither absolute nor contains a slash.
Anyways I still think that the correct way to change a directory in a makefile is:
(cd xml && for ...)
doing this brings us to the second error:
# set rng compatibility symlinks
(cd xml && for a in *-1.0.rng; do ln -s "$a" `echo "$a" | sed 's/-1.0//g'`; done)
/scratch/
ln: target `score.rng' is not a directory
make: *** [build-stamp] Error 1
dpkg-buildpackage: error: debian/rules build gave error exit status 2
now what's wrong here? the directory xml does not contain any file
that matches the pattern '*-1.0.rng' which means that the for loop is
run once with $a = '*-1.0.rng' and I don't think this is intended.
this brings me to the conclusion:
since there no file that matches the desired pattern, you might
as well remove this line.
best regards,
Peter
the problem occurs when the environment variable CDPATH is set