svn commit: r295014 - user/des/compat
Dag-Erling Smørgrav
des at FreeBSD.org
Thu Jan 28 20:42:30 UTC 2016
Author: des
Date: Thu Jan 28 20:42:29 2016
New Revision: 295014
URL: https://svnweb.freebsd.org/changeset/base/295014
Log:
Use unique names for all files so we can more easily generate multiple
tarballs in one go, as well as compare them to earlier versions.
Modified:
user/des/compat/mkcompat.sh
Modified: user/des/compat/mkcompat.sh
==============================================================================
--- user/des/compat/mkcompat.sh Thu Jan 28 20:36:03 2016 (r295013)
+++ user/des/compat/mkcompat.sh Thu Jan 28 20:42:29 2016 (r295014)
@@ -39,7 +39,7 @@ error() {
exit 1
}
-[ $# -ne 3 ] || error "usage: ${progname} /path/old /path/new"
+[ $# -eq 2 ] || error "usage: ${progname} /path/old /path/new"
# Extract version information from old release
old="$1"
@@ -108,12 +108,14 @@ portname="compat${old_major}x"
portversion="${old_revision}.${old_version}.${today}"
pkgname="${portname}-${old_arch}-${portversion}"
tarname="${pkgname}.tar.xz"
-mtree="mtree.${old_arch}"
+mtree="mtree-${old_arch}-${portversion}"
echo '#mtree' >"${mtree}"
-plist="pkg-plist.${old_arch}"
+plist="pkg-plist-${old_arch}-${portversion}"
:>"${plist}"
-distinfo="distinfo.${old_arch}"
+distinfo="distinfo-${old_arch}-${portversion}"
:>"${distinfo}"
+digests="digests-${old_arch}-${portversion}"
+:>"${digests}"
# Search old tree for libraries which do not exist in the new tree
(cd "${old}" && find -s lib* usr/lib* -type f -name 'lib*.so.*') | \
@@ -122,17 +124,20 @@ distinfo="distinfo.${old_arch}"
if [ ! -f "${new}/${file}" ] ; then
lib=$(basename "${file}")
dir=$(basename $(dirname "${file}"))
- if [ -f "${pkgname}/${dir}/${lib}" ] ; then
- error "duplicate library: ${dir}/${lib}"
+ target="${dir}/${lib}"
+ if [ -f "${pkgname}/${target}" ] ; then
+ error "duplicate library: ${target}"
fi
- notice "missing ${dir}/${lib}"
- echo "${pkgname}/${dir}/${lib} uid=0 gid=0 mode=0444" \
+ notice "missing ${target}"
+ echo "${pkgname}/${target} uid=0 gid=0 mode=0444" \
"type=file content=${old}/${file}" >>"${mtree}"
- echo "${dir}/${lib}" >>"${plist}"
+ echo "${dir}/compat/${lib}" >>"${plist}"
+ echo $(sha256 -q "${old}/${file}") "${target}" >>"${digests}"
fi
done
sort "${plist}" >"${plist}-" && mv "${plist}-" "${plist}"
sort "${mtree}" >"${mtree}-" && mv "${mtree}-" "${mtree}"
+sort -k 2 "${digests}" > "${digests}-" && mv "${digests}-" "${digests}"
# Create tarball and distinfo
tar -Jcf "${tarname}" @"${mtree}" || exit 1
More information about the svn-src-user
mailing list