summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rwxr-xr-xscripts/mkipkg2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/mkipkg b/scripts/mkipkg
index 7877078..9c5e184 100755
--- a/scripts/mkipkg
+++ b/scripts/mkipkg
@@ -293,65 +293,67 @@ substAndStripFiles()
stripFile ./$f
substFile ./$f $2
done
}
installScript()
{
if [ -n "$1" -a -f "$1" ]; then
destfile=`basename $1`
filetype=`echo $destfile|cut -d. -f2`
if [ -n "$filetype" ]; then destfile=$filetype; fi
if [ -n "$subst" ]; then
sed -f $subst < $1 > $ctrldir/$destfile
else
cat $1 > $ctrldir/$destfile
fi
chmod +x $ctrldir/$destfile
fi
}
tempDir=/tmp/`basename $self`.$$
mkdir -p $tempDir
if [ $? != 0 ]; then
echo "$self: cannot create $tempDir, exiting..."
+ rm -rf $tempDir
exit 1
fi
ctrldir=$tempDir/CONTROL
mkdir -p $ctrldir
if [ ! -e $subst ] || [ -z "$subst" ]; then
cat $control > $ctrldir/control.new
else
sed -f $subst < $control > $ctrldir/control.new
fi
createFileList $ctrldir/control.new ipkgFileList
if [ "$?" != "0" ]; then
echo "$self: ERROR: missing files, not building $control"
+ rm -rf $tempDir
exit 1
fi
cat $ctrldir/control.new | egrep -v '^(Files|FileExcludeMask|FileIncludeMask):' > $ctrldir/control
rm -f $ctrldir/control.new
( cd $destdir && tar -cf - $ipkgFileList 2>/dev/null ) | ( cd $tempDir && tar -xf - 2>/dev/null )
if [ -z "$filesubst" ]; then
( cd $tempDir && stripFiles "$ipkgFileList" )
else
if ! (echo $filesubst|grep -q '^/'); then
filesubst="$oldpwd/$filesubst"
fi
( cd $tempDir && substAndStripFiles "$ipkgFileList" $filesubst )
fi
path="`echo "$PATH" | sed -e "s/\:/ /g"`"
if [ -z "$mkfsjffs2" ]; then
for i in $path; do
if [ -x "$i/mkfs.jffs2" ]; then
mkfsjffs2="$i/mkfs.jffs2"
break