Skip to content
Snippets Groups Projects
Commit 04824846 authored by H. William Welliver III's avatar H. William Welliver III
Browse files

install_module gets along better with directory modules

Rev: bin/install_module:1.5
parent 25083e8f
No related branches found
No related tags found
No related merge requests found
...@@ -17,11 +17,8 @@ do ...@@ -17,11 +17,8 @@ do
*.pmod) *.pmod)
if [ -d "$DIR" ]; then if [ -d "$DIR" ]; then
break break
else
:
fi fi
if [ -f "$DIR" ]; then if [ -f "$DIR" ]; then
mv "$DIR" "$DIR-foo" mv "$DIR" "$DIR-foo"
mkdir $DIR mkdir $DIR
...@@ -53,10 +50,23 @@ else ...@@ -53,10 +50,23 @@ else
: :
fi fi
if [ -d "$BASE.pmod" ]; then if [ -d "$BASE.pmod" -a -d "$FROM" ]; then
EXT=`echo $TO | sed -e 's@(\.[^.]$)@\1@/'` # we are copying a dir module into a dir module.
FROM="$FROM/."
elif [ -d "$BASE.pmod" ]; then
EXT=`echo $TO | sed -e 's@^.*\.\(.[^\.]*\)$@\1@'`
TO="$BASE.pmod/module.$EXT" TO="$BASE.pmod/module.$EXT"
fi fi
# Add proper flag to copy recursively if FROM is a directory module
CPFLAGS=""
if [ -d "$FROM" ]; then
CPFLAGS="-r"
fi
pwd
cp $CPFLAGS "$FROM" "$TO"
exec cp "$FROM" "$TO" exit $?
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment