Re: [PATCH] Create a Makefile target to generate updates.img automatically.

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

 



Ignore this patch, newer one coming.

On 03/16/2009 03:13 PM, David Cantrell wrote:
Based on what's changed in the repo since the last release tag.
Copy everything necessary for the updates.img in './updates' and
pack it up.  Got tired of having my own local scripts to do this.

LIMITATIONS:  Will not copy in dependent libraries or figure out
if a new _isys.so needs to be built.  Pass KEEP=y if you want the
updates staging directory kept so you can dump other things in to
it.  Run 'make updates KEEP=y' over and over to supplement your
updates image.
---
  Makefile |   37 +++++++++++++++++++++++++++++++++++++
  1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index dd45b29..4dbaa01 100644
--- a/Makefile
+++ b/Makefile
@@ -169,3 +169,40 @@ bumpver:

  install-buildrequires:
  	yum install $$(grep BuildRequires: anaconda.spec | cut -d ' ' -f 2)
+
+# Generate an updates.img based on the changed files since the release
+# was tagged.  Updates are copied to ./updates and then the image is
+# created.  By default, the updates subdirectory is removed after the
+# image is made, but if you want to keep it around, run:
+#     make updates.img KEEP=y
+# And since shell is both stupid and amusing, I only match the first
+# character to be a 'y' or 'Y', so you can do:
+#     make updates.img KEEP=yosemite
+# Ahh, shell.
+updates:
+	@if [ ! -d updates ]; then \
+		mkdir updates ; \
+	fi ; \
+	git diff --stat $(ARCHIVE_TAG) | grep " | " | \
+	grep -v "^\ loader\/" | grep -v "\.spec" | grep -v "Makefile" | \
+	grep -v "^\ po\/" | grep -v "^\ scripts\/" | \
+	while read sourcefile stuff ; do \
+		dn="$$(dirname $$sourcefile)" ; \
+		case $$dn in \
+			installclasses|storage|booty) \
+				if [ ! -d updates/$$dn ]; then \
+					cp -a $$dn updates ; \
+					find updates/$$dn -type f | grep Makefile | xargs rm -f ; \
+				fi ;; \
+			*) \
+				cp -a $$sourcefile updates ;; \
+		esac ; \
+	done ; \
+	cd updates ; \
+	echo -n "Creating updates.img..." ; \
+	( find . | cpio -c -o | gzip -9c )>  ../updates.img ; \
+	cd .. ; \
+	keep="$$(echo $(KEEP) | cut -c1 | tr [a-z] [A-Z])" ; \
+	if [ ! "$$keep" = "Y" ]; then \
+		rm -rf updates ; \
+	fi


--
David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux