[libvirt] [PATCH] spec: Delete .git after applying patches

Cole Robinson crobinso at redhat.com
Tue Oct 6 20:06:05 UTC 2015

I'm hitting this little annoyance in fedora's package repo:

$ fedpkg prep
Downloading libvirt-1.2.20.tar.gz
+ /usr/bin/gzip -dc /home/crobinso/src/fedora/libvirt/libvirt-1.2.20.tar.gz
$ git clean -xdf
Removing libvirt-1.2.20.tar.gz
Skipping repository libvirt-1.2.20/

We git-ify the libvirt directory as part of applying patches in the spec
file, but 'git clean' will ignore subfolders that appear to be standalone
git repos.

Let's just delete the .git directory after we're done with it.
 libvirt.spec.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libvirt.spec.in b/libvirt.spec.in
index ed401f7..9dff994 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1256,6 +1256,7 @@ if [ $COUNT -gt 0 ]; then
 echo "Applied $COUNT patches"
+rm -rf .git
 %if ! %{with_xen}

More information about the libvir-list mailing list