From 99c563d97c54458acae29dfb906c5fb7a22ec145 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 2 Dec 2020 12:57:18 +0000 Subject: [PATCH] Miscellanous cleanups. - Remove obsolete "bump-and-build.sh" script. - Bring the README replacement file up to date. - Add copy-patches script from RHEL. --- README-replacement.in | 15 ++++++------ bump-and-build.sh | 10 -------- copy-patches.sh | 56 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 18 deletions(-) delete mode 100755 bump-and-build.sh create mode 100755 copy-patches.sh diff --git a/README-replacement.in b/README-replacement.in index 6392cb4..388dc34 100644 --- a/README-replacement.in +++ b/README-replacement.in @@ -8,8 +8,7 @@ list: http://www.redhat.com/mailman/listinfo/libguestfs -This Fedora package comes with a lot of help and examples to get you -started. +This package comes with a lot of help and examples to get you started. The first place to start are the manual pages. Type: @@ -20,19 +19,19 @@ The first place to start are the manual pages. Type: man virt-cat # and other virt-* tools If you install the libguestfs-devel package, then in the -/usr/share/doc/libguestfs-devel/ directory you will also -find: +/usr/share/doc/libguestfs-devel/ directory you will find other +documentation including: - BUGS: list of open bugs in this version - - ChangeLog: the detailed list of changes in this version + - ChangeLog.gz: the detailed list of changes in this version - - ROADMAP: the roadmap for future versions + - HACKING: how to extend libguestfs - TODO: ideas for extending libguestfs - *.c: example C programs using the API - - *.xml: example virt-inspector output + - *.xml.gz: example virt-inspector output (compressed) - - *.rng: virt-inspector RelaxNG schema + - virt-inspector.rng: virt-inspector RelaxNG schema diff --git a/bump-and-build.sh b/bump-and-build.sh deleted file mode 100755 index 975db37..0000000 --- a/bump-and-build.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - - -set -e - -rpmdev-bumpspec -c "- Bump and rebuild." libguestfs.spec -git diff ||: -echo "Press ENTER to commit, push and rebuild." -read line -fedpkg commit -m "Bump and rebuild." -p -fedpkg build diff --git a/copy-patches.sh b/copy-patches.sh new file mode 100755 index 0000000..46b1f33 --- /dev/null +++ b/copy-patches.sh @@ -0,0 +1,56 @@ +#!/bin/bash - + +set -e + +# Maintainer script to copy patches from the git repo to the current +# directory. It's normally only used downstream (ie. in RHEL). Use +# it like this: +# ./copy-patches.sh + +rhel_version=9.0.0 + +# Check we're in the right directory. +if [ ! -f libguestfs.spec ]; then + echo "$0: run this from the directory containing 'libguestfs.spec'" + exit 1 +fi + +git_checkout=$HOME/d/libguestfs-rhel-$rhel_version +if [ ! -d $git_checkout ]; then + echo "$0: $git_checkout does not exist" + echo "This script is only for use by the maintainer when preparing a" + echo "libguestfs release on RHEL." + exit 1 +fi + +# Get the base version of libguestfs. +version=`grep '^Version:' libguestfs.spec | awk '{print $2}'` +tag="v$version" + +# Remove any existing patches. +git rm -f [0-9]*.patch ||: +rm -f [0-9]*.patch + +# Get the patches. +(cd $git_checkout; rm -f [0-9]*.patch; git format-patch -N --submodule=diff $tag) +mv $git_checkout/[0-9]*.patch . + +# Remove any not to be applied. +rm -f *NOT-FOR-RPM*.patch + +# Add the patches. +git add [0-9]*.patch + +# Print out the patch lines. +echo +echo "--- Copy the following text into libguestfs.spec file" +echo + +echo "# Patches." +for f in [0-9]*.patch; do + n=`echo $f | awk -F- '{print $1}'` + echo "Patch$n: $f" +done + +echo +echo "--- End of text"