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

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

 



On Mon, 2009-03-16 at 15:17 -1000, 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-img'
> and pack it up.  Got tired of having my own local scripts to do
> this.

Looks handy to me. Since you're doing the build tonight you'll be in a
position to fix it if it breaks things.

Ack.

> 
> 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 |   35 +++++++++++++++++++++++++++++++++++
>  1 files changed, 35 insertions(+), 0 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index dd45b29..b2a75c7 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -169,3 +169,38 @@ 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-img 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-img ]; then \
> +		mkdir updates-img ; \
> +	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) \
> +				cp -a $$dn updates-img ; \
> +				find updates-img/$$dn -type f | grep Makefile | xargs rm -f ;; \
> +			*) \
> +				cp -a $$sourcefile updates-img ;; \
> +		esac ; \
> +	done ; \
> +	cd updates-img ; \
> +	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-imgs ; \
> +	fi

_______________________________________________
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