summaryrefslogtreecommitdiff
path: root/maintainer
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-09-28 05:29:35 (GMT)
committerAlexey Neyman <stilor@att.net>2017-09-28 05:40:21 (GMT)
commit48a949cf60b422c1904dca42519e54902f3ed0a6 (patch)
tree923dd08ce1fee74b3431086e13be0ae0739dd9a1 /maintainer
parentf86adab1f41b2320c20ffe2e9ffe0c6d12954c33 (diff)
Add an ability to verify the digest/signature
Fixes #611. Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'maintainer')
-rw-r--r--maintainer/kconfig-versions.template7
-rwxr-xr-xmaintainer/test-packages.sh37
2 files changed, 43 insertions, 1 deletions
diff --git a/maintainer/kconfig-versions.template b/maintainer/kconfig-versions.template
index 0e0ceb0..e4be903 100644
--- a/maintainer/kconfig-versions.template
+++ b/maintainer/kconfig-versions.template
@@ -274,6 +274,13 @@ config @@fork|@@_ARCHIVE_FORMATS
#!end-foreach
default "@@archive_formats@@"
+config @@fork|@@_SIGNATURE_FORMAT
+ string
+#!foreach version if-differs signature_format
+ default "@@signature_format@@" if @@fork|@@_V_@@ver_sel|@@
+#!end-foreach
+ default "@@signature_format@@"
+
#!end-if
#!if [ "@@nforks@@" -ge 2 ]
diff --git a/maintainer/test-packages.sh b/maintainer/test-packages.sh
index 6049f25..9d26099 100755
--- a/maintainer/test-packages.sh
+++ b/maintainer/test-packages.sh
@@ -18,6 +18,9 @@ Options:
--download, -d
Download all packages to the default directory (\$HOME/src).
+ --digest, -D
+ Create digests (MD5/SHA-1/...) for all package archives.
+
--apply-patches, -a
Implies -d. Unpack and apply the bundled patches.
@@ -37,6 +40,9 @@ while [ -n "${1}" ]; do
--download|-d)
download_pkgs=y
;;
+ --digest|-D)
+ create_digests=y
+ ;;
--verify-urls|-u)
verify_urls=y
;;
@@ -61,7 +67,7 @@ while [ -n "${1}" ]; do
shift
done
-if [ -z "${download_pkgs}${verify_urls}" ]; then
+if [ -z "${download_pkgs}${create_digests}${verify_urls}" ]; then
echo "No action selected" >&2
exit 1
fi
@@ -124,6 +130,30 @@ check_pkg_urls()
done
}
+create_digests()
+{
+ local e m url alg
+ local save_archive_formats="${archive_formats}"
+
+ for e in ${save_archive_formats}; do
+ CT_DoStep EXTRA "Downloading ${archive_filename}${e}"
+ archive_formats="${e}"
+ CT_DoFetch
+ CT_Pushd "${CT_LOCAL_TARBALLS_DIR}"
+ for alg in md5 sha1 sha256 sha512; do
+ CT_DoLog EXTRA "Creating ${alg^^} digest for ${archive_filename}${e}"
+ if ! CT_DoExecLog ALL ${alg}sum "${archive_filename}${e}" > \
+ "${CT_LIB_DIR}/packages/${pkg_name}/${version}/${archive_filename}${e}.${alg}"; then
+ CT_DoExecLog ALL rm -f "${CT_LIB_DIR}/packages/${pkg_name}/${version}/${archive_filename}${e}.${alg}"
+ CT_Abort "${alg}sum failed"
+ fi
+ done
+ CT_Popd
+ CT_EndStep
+ done
+ archive_formats="${save_archive_formats}"
+}
+
run_pkgversion()
{
while [ -n "${1}" ]; do
@@ -171,6 +201,7 @@ CT_${masterpfx}_USE_${originpfx}=y
CT_${pfx}_SRC_RELEASE=y
CT_${pfx}_V_${kcfg}=y
CT_SAVE_TARBALLS=y
+# CT_VERIFY_DOWNLOAD_DIGEST is not set
EOF
./kconfig/conf --defconfig=temp.defconfig temp.in >/dev/null
@@ -181,6 +212,10 @@ EOF
CT_DoLog EXTRA "Verifying URLs for ${pkg_name}-${ver}"
CT_PackageRun "${masterpfx}" check_pkg_urls
fi
+ if [ -n "${create_digests}" ]; then
+ CT_DoLog EXTRA "Creating digests for ${pkg_name}-${ver}"
+ CT_PackageRun "${masterpfx}" create_digests
+ fi
if [ -n "${download_pkgs}" ]; then
CT_DoLog EXTRA "Downloading ${pkg_name}-${ver}"
CT_Fetch "${masterpfx}"