[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1] tools: fix make rpmball


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Olaf Hering <olaf@xxxxxxxxx>
  • Date: Tue, 30 May 2023 13:18:07 +0200
  • Arc-authentication-results: i=1; strato.com; arc=none; dkim=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1685445490; s=strato-dkim-0002; d=strato.com; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=xpfZUYcz31NZPlJ7xvrja8Wj8g2sszCQGizz7J+CVKA=; b=tWjjzxWF5a+nOA4rwjagKQiarNCa0rHEGz4OyJTKljhdvVvGa59wurx9yMPoEESroO yEfN+oz9jelx73uriFWg7PBSsyIp4ion2SbM9a3nTxLvwNImzAv301IfP/Kr7CfnT9cR +9Uk3wx/qSITfJsk2AjIHfGCWMmS9ibUHuzjCxJUQQBRAnMpFlpQmpqRKd/1oNMbsRO2 KIO3l3iwZ2/8ltPcZe0XQjBUsy3RkmyfAzZOsg4tErRnLs+viurdeTzzxcyOPzzEpo8r 40VhixsLGNmRu6kSL532LJp3e9hJYmw3bRKpGr52iqTDSkErhoqRlkl/36OaoCP+dFly ZZtQ==
  • Arc-seal: i=1; a=rsa-sha256; t=1685445490; cv=none; d=strato.com; s=strato-dkim-0002; b=M3OzKoE3OnXMMuuYeGoewCaszTSTGUvss3H/ly1QRAnB21XWdgXLoZ9ogbh/GLgK7A TJQ/bLC1fuUPgYHKCvKHmV0u5ey/7LMVMXrI/PYUKRLomFuru93Rlt467cdmE0hXSU5o 4OoIejqoTVJt96G7C9u6gpzs5HgZjBd0XH787730mhKxTM4qGGoGJ3hAGVKvNLFOsqES eX22HofL1vlpT9/8WBMz8QIApQnJtmdYYPFSad6/0s53ojn8mN0KAn7O4pnoQebWSVgu pL0fI7O1VvSv72xnsobXdbo+DvyxWl4VAYEzXJvkHB688oh96M69e2qd5t8kVLMhTq7C UslQ==
  • Cc: Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Tue, 30 May 2023 11:18:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Commit 438c5ffa44e99cceb574c0f9946aacacdedd2952 ("rpmball: Adjust to
new rpm, do not require --force") attempted to handle stricter
directory permissions in newer distributions.

This introduced a few issues:
- /boot used to be a constant prior commit
  6475d700055fa952f7671cee982a23de2f5e4a7c ("use BOOT_DIR as xen.gz
  install location"), since this commit the location has to be
  referenced via ${BOOT_DIR}
- it assumed the prefix and the various configurable paths match the
  glob pattern /*/*/*

Adjust the code to build a filelist on demand and filter directories
from an installed filesystem.rpm.

Take the opportunity to replace the usage of $RPM_BUILD_ROOT with
%buildroot, and use pushd/popd pairs.

Fixes: 438c5ffa4 ("rpmball: Adjust to new rpm, do not require --force")

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
---
 tools/misc/mkrpm | 33 ++++++++++++++++++++++++---------
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git a/tools/misc/mkrpm b/tools/misc/mkrpm
index 74f6761bb0..a7bf854197 100644
--- a/tools/misc/mkrpm
+++ b/tools/misc/mkrpm
@@ -50,20 +50,35 @@ uninstall.
 %build
 
 %install
-rm -rf \$RPM_BUILD_ROOT
-mkdir -p \$RPM_BUILD_ROOT
-cd %{_xenroot}
-dist/install.sh \$RPM_BUILD_ROOT/
+rm -rf %buildroot
+mkdir -p %buildroot
+pushd %_xenroot
+dist/install.sh %buildroot
+
+pushd %buildroot
+popd
+rm -f dist/filesystem.txt
+rm -f dist/directories.txt
+rm -f dist/files.txt
+find %buildroot -type d | sed 's|^%buildroot||' | sort > dist/directories.txt
+find %buildroot -type f | sed 's|^%buildroot||' | sort > dist/files.txt
+find %buildroot -type l | sed 's|^%buildroot||' | sort >> dist/files.txt
+if rpm -ql filesystem > dist/filesystem.txt
+then
+  while read
+  do
+    sed -i "s|^\${REPLY}$||" dist/directories.txt
+  done < dist/filesystem.txt
+fi
+sed 's@^@%%dir @' dist/directories.txt >> dist/files.txt
 
-cd \$RPM_BUILD_ROOT
+popd
 
 %clean
-rm -rf \$RPM_BUILD_ROOT
+rm -rf %buildroot
 
-%files
+%files -f %_xenroot/dist/files.txt
 %defattr(-,root,root,-)
-/*/*/*
-/boot/*
 
 %post
 EOF



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.