@@ -78,6 +78,20 @@ cd "$CURRENT_DIRECTORY"
7878SWIFT_VERSION=" $( " $SWIFT_TOOLCHAIN_HOME /bin/swift" --version | grep -Eo ' version [0-9.]+' | sed ' s/version //' ) "
7979echo " Swift version being packaged is $SWIFT_VERSION "
8080
81+ # Get the currently installed version for all of the packages that we need.
82+ # This script assumes that it was run on the build machine and therefore
83+ # that the packages on this machine correspond to those Swift was built
84+ # against.
85+ get_package_version ()
86+ {
87+ echo " $( pkg info " $1 " | grep Version | sed ' s/Version.*: //' ) "
88+ }
89+
90+ LIBUUID_PKG_VERSION=$( get_package_version libuuid)
91+ LIBXML2_PKG_VERSION=$( get_package_version libxml2)
92+ PYTHON_PKG_VERSION=$( get_package_version python311)
93+ SQLITE3_PKG_VERSION=$( get_package_version sqlite3)
94+
8195# Create the manifest file. All fields below are required. pkg_create(3)
8296# will add additional fields as part of generating the package.
8397echo " Generating manifest..."
@@ -93,32 +107,20 @@ cat > "$METADATA_STAGING/manifest" <<EOF
93107 "maintainer": "swift-infrastructure@forums.swift.org",
94108 "www": "https://www.swift.org",
95109 "deps": {
96- "e2fsprogs-libuuid": {
97- "version": "1.47.1",
98- "origin": "misc/e2fsprogs-libuuid"
99- },
100- "libffi": {
101- "version": "3.4.6",
102- "origin": "devel/libffi"
110+ "libuuid": {
111+ "version": "$LIBUUID_PKG_VERSION ",
112+ "origin": "misc/libuuid"
103113 },
104114 "libxml2": {
105- "version": "2.11.9 ",
115+ "version": "$LIBXML2_PKG_VERSION ",
106116 "origin": "textproc/libxml2"
107117 },
108- "mpdecimal": {
109- "version": "4.0.0",
110- "origin": "math/mpdecimal",
111- },
112118 "python311": {
113- "version": "3.11.11 ",
119+ "version": "$PYTHON_PKG_VERSION ",
114120 "origin": "lang/python311"
115121 },
116- "readline": {
117- "version": "8.2.13_2",
118- "origin": "devel/readline"
119- },
120122 "sqlite3": {
121- "version": "3.46.1_1,1 ",
123+ "version": "$SQLITE3_PKG_VERSION ",
122124 "origin": "databases/sqlite3"
123125 }
124126 }
0 commit comments