[asterisk-dev] [Code Review] 4064: makefile: Relax badshell tilde test to allow for ~ in middle of DESTDIR.

wdoekes reviewboard at asterisk.org
Sun Oct 12 02:50:27 CDT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4064/
-----------------------------------------------------------

(Updated Oct. 12, 2014, 2:50 a.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers.


Changes
-------

Committed in revision 425291


Bugs: ASTERISK-13797
    https://issues.asterisk.org/jira/browse/ASTERISK-13797


Repository: Asterisk


Description
-------

(copied from the bug report)

The main Makefile has a target test called 'badshell' that tests if
DESTDIR does not happen to have an an-expanded tilde (~).  This might
be the case if you run:

    make install DESTDIR=~/somewhere/

and the shell wouldn't expand it as expected due to either bugs or
lack of features in it.  However for packaging the Debian package we
have, as part of the package name, 'dfsg' and sometimes also '~rcN'.


Basically: the current test matches ANY tilde in the filename, while
it only makes sense to match the first character.

This patch changes the badshell test to $(filter ~%,...) instead of
$(findstring ~,...) as suggested by Tilghman in 2009 (except we allow
~username as well).


Why in 1.8 and not in trunk? Because this is trivial and it saves the
debian guys another patch.


Diffs
-----

  /branches/1.8/Makefile 424940 

Diff: https://reviewboard.asterisk.org/r/4064/diff/


Testing
-------

$ make DESTDIR='~/somewhere' install
Your shell doesn't do ~ expansion when expected (specifically, when doing "make install DESTDIR=~/path").
Try replacing ~ with $HOME, as in "make install DESTDIR=$HOME/path".


$ make DESTDIR=~somewhere install
Your shell doesn't do ~ expansion when expected (specifically, when doing "make install DESTDIR=~/path").
Try replacing ~ with $HOME, as in "make install DESTDIR=$HOME/path".


$ make DESTDIR=~walter/test123 install
CC="cc" CXX="" LD="" AR="" RANLIB="" CFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" makeopts
make[1]: Entering directory `/home/walter/src/asterisk-1.8.x-WRITE/menuselect'
...
$ ls ~/test123/usr/sbin/asterisk 
/home/walter/test123/usr/sbin/asterisk


$ make DESTDIR=`pwd`/test123~123 install
CC="cc" CXX="" LD="" AR="" RANLIB="" CFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" makeopts
make[1]: Entering directory `/home/walter/src/asterisk-1.8.x-WRITE/menuselect'
...
$ ls test123~123/usr/sbin/asterisk 
test123~123/usr/sbin/asterisk


Thanks,

wdoekes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20141012/b408bff0/attachment.html>


More information about the asterisk-dev mailing list