summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TODO1
-rw-r--r--src/oh-gencontrol9
2 files changed, 9 insertions, 1 deletions
diff --git a/TODO b/TODO
index 6d3b955..9530b3b 100644
--- a/TODO
+++ b/TODO
@@ -5,7 +5,6 @@ TODO:
* Check on file ownership and modes.
* Finish tar archive handling in opkhelper.
* Build packages with copyright information and changelogs. [1][2]
- * Generate MD5 checksums of files.
Future Plans:
* Package signing. [3]
diff --git a/src/oh-gencontrol b/src/oh-gencontrol
index 03acc3d..6505920 100644
--- a/src/oh-gencontrol
+++ b/src/oh-gencontrol
@@ -142,6 +142,15 @@ gen_control_bin()
chmod 644 ${control_dir}/conffiles
fi
fi
+
+ # MD5 checksums.
+ find ${data_dir} -type f | sed "@^${data_dir}@@" | sort | xargs md5sum \
+ > ${control_dir}/md5sums
+ if [ -z "$(cat ${control_dir}/md5sums)" ]; then
+ rm -f ${control_dir}/md5sums
+ else
+ chmod 644 ${control_dir}/md5sums
+ fi
}
if [ ${#} -eq 0 ]; then