Blame SOURCES/0001-win-reg-Fix-output-of-virt-win-reg-version.patch

a82958
From 83de85e717ad525423b0eabe153b48ff8af90bd1 Mon Sep 17 00:00:00 2001
a82958
From: "Richard W.M. Jones" <rjones@redhat.com>
a82958
Date: Mon, 17 May 2021 15:18:04 +0100
3fcca0
Subject: [PATCH 1/5] win-reg: Fix output of virt-win-reg --version
a82958
a82958
Before we split libguestfs and guestfs-tools the version of programs
a82958
was exactly the same as the version of libguestfs.  This was
a82958
convenient for virt-win-reg where it is difficult to encode the
a82958
version into the script, because virt-win-reg could simply use the
a82958
version from Sys::Guestfs (ie. libguestfs).  However after the split
a82958
this no longer applies, so we must do the difficult thing.
a82958
a82958
After this change virt-win-reg will print both the version of
a82958
guestfs-tools and the version of libguestfs, eg:
a82958
a82958
    $ virt-win-reg --version
a82958
    virt-win-reg 1.47.1
a82958
    libguestfs 1.45.5fedora=35,release=1.fc35,libvirt
a82958
a82958
Reported-by: Yongkui Guo
a82958
Fixes: commit 4354a3126152a2748cc9097cba139b3908ccc342
a82958
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1961160
a82958
(cherry picked from commit 9e9eeeaf4c4b478eca82bf0d4c3e680a624d6d91)
a82958
---
a82958
 .gitignore                                |  1 +
a82958
 configure.ac                              |  2 ++
a82958
 po-docs/podfiles                          |  2 +-
a82958
 po/POTFILES-pl                            |  2 +-
a82958
 po/guestfs-tools.pot                      | 18 +++++++++---------
a82958
 win-reg/Makefile.am                       |  6 ------
a82958
 win-reg/{virt-win-reg => virt-win-reg.in} |  5 +++--
a82958
 7 files changed, 17 insertions(+), 19 deletions(-)
a82958
 rename win-reg/{virt-win-reg => virt-win-reg.in} (99%)
a82958
a82958
diff --git a/.gitignore b/.gitignore
3fcca0
index 006042a8..6bc509fa 100644
a82958
--- a/.gitignore
a82958
+++ b/.gitignore
a82958
@@ -163,3 +163,4 @@ Makefile.in
a82958
 /test-data/phony-guests/windows-software
a82958
 /test-data/phony-guests/windows-system
a82958
 /website/*.html
a82958
+/win-reg/virt-win-reg
a82958
diff --git a/configure.ac b/configure.ac
3fcca0
index 56cfef57..ef412670 100644
a82958
--- a/configure.ac
a82958
+++ b/configure.ac
a82958
@@ -99,6 +99,8 @@ AC_CONFIG_FILES([podwrapper.pl],
a82958
                 [chmod +x,-w podwrapper.pl])
a82958
 AC_CONFIG_FILES([run],
a82958
                 [chmod +x,-w run])
a82958
+AC_CONFIG_FILES([win-reg/virt-win-reg],
a82958
+                [chmod +x,-w win-reg/virt-win-reg])
a82958
 
a82958
 AC_CONFIG_FILES([Makefile
a82958
                  align/Makefile
a82958
diff --git a/po-docs/podfiles b/po-docs/podfiles
3fcca0
index d7ef1389..6b0c481f 100644
a82958
--- a/po-docs/podfiles
a82958
+++ b/po-docs/podfiles
a82958
@@ -26,4 +26,4 @@ sparsify/virt-sparsify.pod
a82958
 sysprep/sysprep-extra-options.pod
a82958
 sysprep/sysprep-operations.pod
a82958
 sysprep/virt-sysprep.pod
a82958
-win-reg/virt-win-reg
a82958
+win-reg/virt-win-reg.in
a82958
diff --git a/po/POTFILES-pl b/po/POTFILES-pl
3fcca0
index 47d30fc8..c6520cea 100644
a82958
--- a/po/POTFILES-pl
a82958
+++ b/po/POTFILES-pl
a82958
@@ -1 +1 @@
a82958
-win-reg/virt-win-reg
a82958
+win-reg/virt-win-reg.in
a82958
diff --git a/po/guestfs-tools.pot b/po/guestfs-tools.pot
3fcca0
index a3be1b95..d7e9a3a7 100644
a82958
--- a/po/guestfs-tools.pot
a82958
+++ b/po/guestfs-tools.pot
a82958
@@ -9,7 +9,7 @@ msgstr ""
a82958
 "Project-Id-Version: guestfs-tools 1.46.1\n"
a82958
 "Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
a82958
 "component=libguestfs&product=Virtualization+Tools\n"
a82958
-"POT-Creation-Date: 2021-05-08 08:57+0100\n"
a82958
+"POT-Creation-Date: 2021-05-17 15:25+0100\n"
a82958
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
a82958
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
a82958
 "Language-Team: LANGUAGE <LL@li.org>\n"
a82958
@@ -4213,11 +4213,11 @@ msgstr ""
a82958
 msgid "%s: subprocess failed\n"
a82958
 msgstr ""
a82958
 
a82958
-#: win-reg/virt-win-reg:260
a82958
+#: win-reg/virt-win-reg.in:261
a82958
 msgid "no libvirt domain name or disk image given\n"
a82958
 msgstr ""
a82958
 
a82958
-#: win-reg/virt-win-reg:316
a82958
+#: win-reg/virt-win-reg.in:317
a82958
 #, perl-brace-format
a82958
 msgid ""
a82958
 "{prog}: No operating system could be detected inside this disk image.\n"
a82958
@@ -4230,33 +4230,33 @@ msgid ""
a82958
 "information about the disk image as possible.\n"
a82958
 msgstr ""
a82958
 
a82958
-#: win-reg/virt-win-reg:320
a82958
+#: win-reg/virt-win-reg.in:321
a82958
 #, perl-brace-format
a82958
 msgid "{prog}: multiboot operating systems are not supported.\n"
a82958
 msgstr ""
a82958
 
a82958
-#: win-reg/virt-win-reg:342
a82958
+#: win-reg/virt-win-reg.in:343
a82958
 msgid ""
a82958
 "expecting 1 or 2 more parameters, subkey path and optionally the value to "
a82958
 "export\n"
a82958
 msgstr ""
a82958
 
a82958
-#: win-reg/virt-win-reg:502
a82958
+#: win-reg/virt-win-reg.in:503
a82958
 #, perl-brace-format
a82958
 msgid "virt-win-reg: {p}: cannot find user directory\n"
a82958
 msgstr ""
a82958
 
a82958
-#: win-reg/virt-win-reg:507
a82958
+#: win-reg/virt-win-reg.in:508
a82958
 #, perl-brace-format
a82958
 msgid "virt-win-reg: {p}: not a supported Windows Registry path\n"
a82958
 msgstr ""
a82958
 
a82958
-#: win-reg/virt-win-reg:580
a82958
+#: win-reg/virt-win-reg.in:581
a82958
 #, perl-brace-format
a82958
 msgid "virt-win-reg: {p}: could not download registry file: {err}\n"
a82958
 msgstr ""
a82958
 
a82958
-#: win-reg/virt-win-reg:597
a82958
+#: win-reg/virt-win-reg.in:598
a82958
 #, perl-brace-format
a82958
 msgid "virt-win-reg: {p}: could not upload registry file: {err}\n"
a82958
 msgstr ""
a82958
diff --git a/win-reg/Makefile.am b/win-reg/Makefile.am
3fcca0
index 22a22db4..61ec066a 100644
a82958
--- a/win-reg/Makefile.am
a82958
+++ b/win-reg/Makefile.am
a82958
@@ -17,8 +17,6 @@
a82958
 
a82958
 include $(top_srcdir)/subdir-rules.mk
a82958
 
a82958
-EXTRA_DIST = virt-win-reg
a82958
-
a82958
 bin_SCRIPTS = virt-win-reg
a82958
 
a82958
 # Manual pages and HTML files for the website.
a82958
@@ -36,7 +34,3 @@ stamp-virt-win-reg.pod: virt-win-reg
a82958
 	  --warning custom \
a82958
 	  $<
a82958
 	touch $@
a82958
-
a82958
-all-local:
a82958
-	for f in virt-win-reg; do echo win-reg/$$f; done \
a82958
-	    > $(top_srcdir)/po/POTFILES-pl
a82958
diff --git a/win-reg/virt-win-reg b/win-reg/virt-win-reg.in
a82958
similarity index 99%
a82958
rename from win-reg/virt-win-reg
a82958
rename to win-reg/virt-win-reg.in
3fcca0
index 1a936c5d..6d9d0a28 100755
a82958
--- a/win-reg/virt-win-reg
a82958
+++ b/win-reg/virt-win-reg.in
a82958
@@ -1,6 +1,6 @@
a82958
 #!/usr/bin/env perl
a82958
 # virt-win-reg
a82958
-# Copyright (C) 2010 Red Hat Inc.
a82958
+# Copyright (C) 2010-2021 Red Hat Inc.
a82958
 #
a82958
 # This program is free software; you can redistribute it and/or modify
a82958
 # it under the terms of the GNU General Public License as published by
a82958
@@ -234,9 +234,10 @@ my %opts = ("help|?" => \$help,
a82958
 GetOptions (%opts) or pod2usage (2);
a82958
 pod2usage (1) if $help;
a82958
 if ($version) {
a82958
+    print "virt-win-reg @PACKAGE_VERSION@\n";
a82958
     my $g = Sys::Guestfs->new ();
a82958
     my %h = $g->version ();
a82958
-    print "virt-win-reg $h{major}.$h{minor}.$h{release}$h{extra}\n";
a82958
+    print "libguestfs $h{major}.$h{minor}.$h{release}$h{extra}\n";
a82958
     exit
a82958
 }
a82958
 
a82958
-- 
a82958
2.31.1
a82958