Skip to content

Commit

Permalink
Fix add_source_tree if the destination directory exists
Browse files Browse the repository at this point in the history
If "$source_tree/$module-$module_version" already exists when
add_source_tree is called, the cp command needs to be aware of this so
it only copies the contents of "$from" and not the containing directory
as well.

This may occur if the tarball passed to ldtarball happens to be stored
in /usr/src/$module-$module_version/

By always creating the destination directory, the cp command can assume
it is always present, and succeed whether or not the destination
directory was already present.

Signed-off-by: Jim Ramsay <jim_ramsay@dell.com>
  • Loading branch information
Jim Ramsay authored and Mario Limonciello committed Jun 30, 2011
1 parent f447ea7 commit dd0bfd5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dkms
Expand Up @@ -3049,7 +3049,8 @@ add_source_tree() {
"$dkms_tree/$module/$version/source") return;;
"$dkms_tree/$module/$version/build") return;;
esac
cp -fr "$from" "$source_tree/$module-$module_version"
mkdir -p "$source_tree/$module-$module_version"
cp -fr "$from"/* "$source_tree/$module-$module_version"
}

make_kmp()
Expand Down

0 comments on commit dd0bfd5

Please sign in to comment.