Previously, -m and -v were required in order to identify the module
being worked on.
Now, if neither -m nor -v are supplied, it is assumed that the current
directory is a working copy of a DKMS source tree. A temporary source
tree is created by taking a copy of the current directory, a temporary
DKMS tree is created, the source tree added, and a DKMS package
generated in the parent directory.
For example, from a working copy of a DKMS source tree:
dkms mkdeb --source-only
Currently only the mkdeb and mkdsc commands are supported for use in
this fashion, but a framework exists to add support for other commands
in the future.
---
dkms | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 51 insertions(+), 2 deletions(-)
diff --git a/dkms b/dkms
index ef4df63..17c9ef4 100755
--- a/dkms
+++ b/dkms
@@ -1966,6 +1966,46 @@ show_status ()
fi
}
debian_package=$(echo $module | sed s/_/-/)
@@ -3052,7 +3095,7 @@ function make_debian()
echo $INSTALL_PACKAGES | sed 's/|/\ install\
/g' > $TEMPFILE
$ROOT "sh -c '/usr/sbin/synaptic --set-selections --non-interactive --hide-main-window < $TEMPFILE'"
- trap 'rm -f $TEMPFILE' EXIT HUP TERM
+ trap "rm -f $TEMPFILE; delete_temporary_trees" EXIT HUP TERM
else
$ROOT apt-get -y install $INSTALL_PACKAGES
fi
@@ -3106,7 +3149,7 @@ function make_debian()
#prepare build directory and copy template
local temp_dir=`mktemp -d $tmp_location/dkms.XXXXXX`
- trap 'rm -rf $temp_dir' EXIT HUP TERM
+ trap "rm -rf $temp_dir; delete_temporary_trees" EXIT HUP TERM
local temp_dir_debian="$temp_dir/$debian_package-dkms-$module_version"
invoke_command "cp -ar '$DEBDIR/' '$temp_dir_debian'" "copying template"
pushd "$temp_dir_debian" > /dev/null 2>&1
@@ -3145,8 +3188,14 @@ function make_debian()
esac
popd > /dev/null 2>&1
+ if in_temporary_trees; then
+ echo "Copying built files to "`pwd`"/.." >&2
+ cp "$dkms_tree/$module/$module_version/deb/"* ..
+ fi
+
#cleanup
invoke_command "rm $temp_dir -fr" "Cleaning up temporary files"
+ delete_temporary_trees
Previously, -m and -v were required in order to identify the module
being worked on.
Now, if neither -m nor -v are supplied, it is assumed that the current
directory is a working copy of a DKMS source tree. A temporary source
tree is created by taking a copy of the current directory, a temporary
DKMS tree is created, the source tree added, and a DKMS package
generated in the parent directory.
For example, from a working copy of a DKMS source tree:
dkms mkdeb --source-only
Currently only the mkdeb and mkdsc commands are supported for use in +++++++ +++++++ +++++++ +++++++ +++++++ +++++++ ++--
this fashion, but a framework exists to add support for other commands
in the future.
---
dkms | 53 +++++++
1 files changed, 51 insertions(+), 2 deletions(-)
diff --git a/dkms b/dkms
index ef4df63..17c9ef4 100755
--- a/dkms
+++ b/dkms
@@ -1966,6 +1966,46 @@ show_status ()
fi
}
+function create_ temporary_ trees () "$PACKAGE_ NAME" version= "$PACKAGE_ VERSION" tree_dir= "$source_ tree/$PACKAGE_ NAME-$PACKAGE_ VERSION" trees_del_ command= "rm -rf $source_tree $dkms_tree" temporary_ trees () trees_del_ command trees_del_ command" ]; then trees_del_ command= trees_del_ command" ] type="$ 1"
+{
+ if [ -n "$module" ] || [ -n "$module_version" ]; then
+ return
+ fi
+
+ [ -r dkms.conf ] || return
+
+ . dkms.conf
+ module=
+ module_
+
+ source_tree=`mktemp -d`
+ dkms_tree=`mktemp -d`
+
+ local source_
+ mkdir -p "$source_tree_dir"
+ cp -a * "$source_tree_dir" # intentionally skip .git or .hg
+ add_module
+ temporary_
+}
+
+function delete_
+{
+ $temporary_
+ if [ -n "$temporary_
+ module=
+ module_version=
+ source_tree=
+ dkms_tree=
+ temporary_
+ fi
+}
+
+function in_temporary_trees ()
+{
+ [ -n "$temporary_
+ return $?
+}
+
media_valid()
{
if [ "$media" == "floppy" ] ||
@@ -3001,6 +3041,9 @@ function make_debian()
{
create_
+ create_ temporary_ trees temporary_ trees" EXIT HUP TERM common_ test "mk${create_type}"
+ trap "delete_
+
make_
debian_ package= $(echo $module | sed s/_/-/) temporary_ trees" EXIT HUP TERM
@@ -3052,7 +3095,7 @@ function make_debian()
echo $INSTALL_PACKAGES | sed 's/|/\ install\
/g' > $TEMPFILE
$ROOT "sh -c '/usr/sbin/synaptic --set-selections --non-interactive --hide-main-window < $TEMPFILE'"
- trap 'rm -f $TEMPFILE' EXIT HUP TERM
+ trap "rm -f $TEMPFILE; delete_
else
$ROOT apt-get -y install $INSTALL_PACKAGES
fi
@@ -3106,7 +3149,7 @@ function make_debian()
#prepare build directory and copy template dkms.XXXXXX` temporary_ trees" EXIT HUP TERM debian= "$temp_ dir/$debian_ package- dkms-$module_ version"
local temp_dir=`mktemp -d $tmp_location/
- trap 'rm -rf $temp_dir' EXIT HUP TERM
+ trap "rm -rf $temp_dir; delete_
local temp_dir_
invoke_command "cp -ar '$DEBDIR/' '$temp_dir_debian'" "copying template"
pushd "$temp_dir_debian" > /dev/null 2>&1
@@ -3145,8 +3188,14 @@ function make_debian()
esac
popd > /dev/null 2>&1
+ if in_temporary_trees; then tree/$module/ $module_ version/ deb/"* .. temporary_ trees
+ echo "Copying built files to "`pwd`"/.." >&2
+ cp "$dkms_
+ fi
+
#cleanup
invoke_command "rm $temp_dir -fr" "Cleaning up temporary files"
+ delete_
#done
if [ "$?" -eq 0 ]; then
--
1.5.6.3