[Tack-devel] Linux install problems.
Moved to https://github.com/davidgiven/ack
Brought to you by:
dtrg
From: r. c. <rvc...@ac...> - 2006-07-25 02:34:56
|
I'm trying to install the cvs ack on debian testing (updated weekly) and ran into a few problems: - first/create_dir does this mkdir $1 2>/dev/null to create directory $1. By default mkdir doesn't create directories other than the last one; the preceding directories must exist: $ mkdir /tmp/a/b/c mkdir: cannot create directory `/tmp/a/b/c': No such file or directory This can be fixed by using the -p option to mkdir: $ rm -rf /tmp/a ; mkdir -p /tmp/a/b/c ; ls /tmp/a/b/c $ Or by using install -d: $ rm -rf /tmp/a ; install -d /tmp/a/b/c ; ls /tmp/a/b/c $ I don't know which of these is more portable. - first/mk_config does this for i in lang/cem/cemcom.ansi lang/cem/cemcom lang/m2/comp do cp $SRC_HOME/$i/BigPars $CONFIG/$i/Parameters chmod +w $CONFIG/$i/Parameters done but it doesn't create $CONFIG/$i/Parameters, which causes erorrs: cp: cannot create regular file `/tmp/ack/lang/cem/cemcom.ansi/Parameters': No such file or directory This can be fixed by for i in lang/cem/cemcom.ansi lang/cem/cemcom lang/m2/comp do create_dir $CONFIG/$i/Parameters cp $SRC_HOME/$i/BigPars $CONFIG/$i/Parameters chmod +w $CONFIG/$i/Parameters done (I'm assuming Parameters is BigPars's parent directory). This fix has to be applied to both for loops, the second of which isn't shown here. - INSTALL does this ( # Slight complication here to ensure that the #! magic at the # beginning of TakeAction is preserved correctly. head -1 $SRC_HOME/TakeAction echo "PATH=:$CONFIG/bin:$UTIL_HOME/bin:$PATH; export PATH" tail +2 $SRC_HOME/TakeAction ) > $CONFIG/bin/TakeAction For whatever reason, using tail +n tail is frowned upon: $ tail +3 /dev/null Warning: "+number" syntax is deprecated, please use "-n +number" $ The code works, but it's noisy. It can be quieted by following the warning, or by sed '2,$d' < $SRC_HOME/TakeAction echo "PATH=:$CONFIG/bin:$UTIL_HOME/bin:$PATH; export PATH" sed '1d' < $SRC_HOME/TakeAction or by (which replaces all the code given above) awk 'NR == 2 { write "PATH=:$CONFIG/bin:$UTIL_HOME/bin:$PATH; export PATH" } 1 ' <$SRC_HOME/TakeAction >$CONFIG/bin/TakeAction although perhaps the best way is to add PATH=@PATH@ ; export PATH to $SRC_HOME/TakeAction and use sed 's;@PATH@;$CONFIG/bin:$UTIL_HOME/bin:$PATH;' \ <$SRC_HOME/TakeAction >$CONFIG/bin/TakeAction in INSTALL. Even with these fixes the install still fails because mk_config tries to cd to $CONFIG/mach which doesn't exist; I haven't figured out that one yet. |