Compare commits

...

3 Commits
master ... f24

Author SHA1 Message Date
Chris Lumens d7af4da528 Ignore DeprecationWarnings originating in pykickstart itself. 2016-05-24 16:32:11 -04:00
Chris Lumens 5105f3f9a9 Add support for disabling weak dependencies. 2016-05-10 10:38:15 -04:00
Chris Lumens f8ebc81dc7 Add a patch to support file URLs for ostree.
This also results in a source file being more recent than the .pot file,
and we don't have a way to regenerate the .pot file unless
translation-canary is in the source tree.  It isn't, which means fixing
the real issue here would turn into a very large patch.  Instead, attach
another patch that only updates the .pot file.

If any more patches get made here, the same thing will need to be done.
2016-04-19 16:21:28 -04:00
6 changed files with 427 additions and 1 deletions

View File

@ -0,0 +1,40 @@
From 6459d8d25f2deb19fb18e8005ac775a4fe67ea22 Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Tue, 19 Apr 2016 14:06:48 -0400
Subject: [PATCH] Support file URLs for ostree (#1327460).
---
pykickstart/commands/ostreesetup.py | 4 ++--
tests/commands/ostreesetup.py | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/pykickstart/commands/ostreesetup.py b/pykickstart/commands/ostreesetup.py
index baa2325..c01f890 100644
--- a/pykickstart/commands/ostreesetup.py
+++ b/pykickstart/commands/ostreesetup.py
@@ -71,8 +71,8 @@ class F21_OSTreeSetup(KickstartCommand):
if self.remote is None:
self.remote = self.osname
- if not self.url.startswith(("http:", "https:")):
- raise KickstartValueError(formatErrorMsg(self.lineno, msg="ostree repos must use HTTP or HTTPS protocol."))
+ if not self.url.startswith(("file:", "http:", "https:")):
+ raise KickstartValueError(formatErrorMsg(self.lineno, msg="ostree repos must use file, HTTP, or HTTPS protocol."))
return self
diff --git a/tests/commands/ostreesetup.py b/tests/commands/ostreesetup.py
index dac056f..b0b1533 100644
--- a/tests/commands/ostreesetup.py
+++ b/tests/commands/ostreesetup.py
@@ -29,6 +29,7 @@ class F21_TestCase(CommandTest):
def runTest(self):
# pass
self.assert_parse("ostreesetup --osname=fedora-atomic --url=http://example.com/repo --ref=fedora-atomic/sometest/base/core")
+ self.assert_parse("ostreesetup --osname=local-atomic --url=file:///home/ostree --ref=fedora-atomic/sometest/base/core")
cmdstr = "ostreesetup --osname=\"fedora-atomic\" --remote=\"fedora-atomic\" --url=\"http://example.com/repo\" --ref=\"fedora-atomic/sometest/base/core\" --nogpg"
self.assert_parse(cmdstr, cmdstr + '\n')
--
2.4.3

View File

@ -0,0 +1,73 @@
diff -ru a/pykickstart/parser.py b/pykickstart/parser.py
--- a/pykickstart/parser.py 2016-02-05 11:40:37.000000000 -0500
+++ b/pykickstart/parser.py 2016-05-10 10:11:38.135211167 -0400
@@ -341,6 +341,7 @@
%packages section.
instLangs -- A list of languages to install.
multiLib -- Whether to use yum's "all" multilib policy.
+ excludeWeakdeps -- Whether to exclude weak dependencies.
seen -- If %packages was ever used in the kickstart file,
this attribute will be set to True.
@@ -359,6 +360,7 @@
self.packageList = [] # type: List[str]
self.instLangs = None # type: Union[None, List[str]]
self.multiLib = False # type: bool
+ self.excludeWeakdeps = False # type: bool
self.seen = False # type: bool
def __str__(self): # type: (Packages) -> str
@@ -408,6 +410,8 @@
retval += " --instLangs=%s" % self.instLangs
if self.multiLib:
retval += " --multilib"
+ if self.excludeWeakdeps:
+ retval += " --excludeWeakdeps"
if ver >= version.F8:
return retval + "\n" + pkgs + "\n%end\n"
diff -ru a/pykickstart/sections.py b/pykickstart/sections.py
--- a/pykickstart/sections.py 2016-02-05 11:40:37.000000000 -0500
+++ b/pykickstart/sections.py 2016-05-10 10:11:38.136211177 -0400
@@ -33,7 +33,7 @@
KS_SCRIPT_PREINSTALL, KS_MISSING_IGNORE, KS_MISSING_PROMPT
from pykickstart.errors import KickstartParseError, formatErrorMsg
from pykickstart.options import KSOptionParser
-from pykickstart.version import FC4, F7, F9, F18, F21, F22
+from pykickstart.version import FC4, F7, F9, F18, F21, F22, F24
from pykickstart.i18n import _
@@ -258,6 +258,8 @@
default=None, introduced=F9)
op.add_option("--multilib", dest="multiLib", action="store_true",
default=False, introduced=F18)
+ op.add_option("--excludeWeakdeps", dest="excludeWeakdeps", action="store_true",
+ default=False, introduced=F24)
(opts, _extra) = op.parse_args(args=args[1:], lineno=lineno)
@@ -281,4 +283,5 @@
self.handler.packages.nocore = opts.nocore
self.handler.packages.multiLib = opts.multiLib
+ self.handler.packages.excludeWeakdeps = opts.excludeWeakdeps
self.handler.packages.seen = True
diff -ru a/tests/packages.py b/tests/packages.py
--- a/tests/packages.py 2016-02-05 11:40:37.000000000 -0500
+++ b/tests/packages.py 2016-05-10 10:11:38.136211177 -0400
@@ -170,5 +170,14 @@
%end""", str(pkgs).strip())
+class WeakDeps_TestCase(DevelPackagesBase):
+ def runTest(self):
+ pkgs = Packages()
+ pkgs.default = True
+ pkgs.excludeWeakdeps = True
+ self.assertEqual("""%packages --default --excludeWeakdeps
+
+%end""", str(pkgs).strip())
+
if __name__ == "__main__":
unittest.main()

View File

@ -0,0 +1,23 @@
commit 4384233c0d7553ba6d8a1f966e498327d8e08237
Author: David Shea <dshea@redhat.com>
Date: Tue May 3 15:11:55 2016 -0400
Add documentation for --excludeWeakdeps
diff --git a/docs/kickstart-docs.rst b/docs/kickstart-docs.rst
index 997981c..1ece508 100644
--- a/docs/kickstart-docs.rst
+++ b/docs/kickstart-docs.rst
@@ -2339,6 +2339,12 @@ header:
**Omitting the core group can produce a system that is not bootable or that cannot finish the install. Use with caution.**
+``--excludeWeakdeps``
+
+ Do not install packages from weak dependencies. These are packages linked
+ to the selected package set by Recommends and Supplements flags. By default
+ weak dependencies will be installed.
+
Group-level options
-------------------

View File

@ -0,0 +1,21 @@
commit cf1da553452aa9df198253139f5d1b066dadffd0
Author: Chris Lumens <clumens@redhat.com>
Date: Wed Apr 6 13:59:54 2016 -0400
Ignore DeprecationWarnings originating in pykickstart itself.
Users of pykickstart only care about deprecation warnings in their own
code, not internal to pykickstart. So ignore all those.
diff --git a/pykickstart/__init__.py b/pykickstart/__init__.py
index aefb9e2..92a45c5 100644
--- a/pykickstart/__init__.py
+++ b/pykickstart/__init__.py
@@ -1,2 +1,6 @@
+# Ignore PendingDeprecationWarnings in the pykickstart module itself. There's
+# nothing users of pykickstart can do about those. Instead just print out ones
+# for users of the code.
import warnings
-warnings.simplefilter("module", PendingDeprecationWarning)
+warnings.filterwarnings("once", category=PendingDeprecationWarning)
+warnings.filterwarnings("ignore", category=PendingDeprecationWarning, module="pykickstart")

View File

@ -1,6 +1,6 @@
Name: pykickstart
Version: 2.25
Release: 1%{?dist}
Release: 4%{?dist}
License: GPLv2 and MIT
Group: System Environment/Libraries
Summary: Python utilities for manipulating kickstart files.
@ -9,6 +9,11 @@ Url: http://fedoraproject.org/wiki/pykickstart
# our distribution. Thus the source is only available from
# within this srpm.
Source0: %{name}-%{version}.tar.gz
Patch0: 0001-Support-file-URLs-for-ostree-1327460.patch
Patch1: 0002-Add-support-for-excludeWeakdeps.patch
Patch2: 0003-Add-documentation-for-excludeWeakdeps.patch
Patch3: 0004-Ignore-DeprecationWarnings.patch
Patch10: update-potfile.patch
BuildArch: noarch
@ -56,6 +61,11 @@ the pykickstart package.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch10 -p1
rm -rf %{py3dir}
mkdir %{py3dir}
@ -116,6 +126,16 @@ popd
%{python3_sitelib}/pykickstart/locale/
%changelog
* Tue May 24 2016 Chris Lumens <clumens@redhat.com> 2.25-4
- Ignore DeprecationWarnings originating in pykickstart itself (#1339272).
* Tue May 10 2016 Chris Lumens <clumens@redhat.com> 2.25-3
- Add support for --excludeWeakdeps option to %packages. (jantill)
- Add documentation for --excludeWeakdeps. (dshea)
* Tue Apr 19 2016 Chris Lumens <clumens@redhat.com> 2.25-2
- Support file URLs for ostree (#1327460) (clumens)
* Fri Feb 05 2016 Chris Lumens <clumens@redhat.com> - 2.25-1
- Use the correct branch in zanata. (clumens)
- Improved method.py test coverage (jikortus)

249
update-potfile.patch Normal file
View File

@ -0,0 +1,249 @@
--- pykickstart-2.25.orig/po/pykickstart.pot 2016-05-24 16:29:16.700598963 -0400
+++ pykickstart-2.25/po/pykickstart.pot 2016-05-24 16:30:19.838143705 -0400
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-02-05 11:33-0500\n"
+"POT-Creation-Date: 2016-05-24 16:30-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -103,11 +103,11 @@
msgid "Error copying file: %s"
msgstr ""
-#: ../pykickstart/sections.py:265
+#: ../pykickstart/sections.py:267
msgid "--default and --nobase cannot be used together"
msgstr ""
-#: ../pykickstart/sections.py:267
+#: ../pykickstart/sections.py:269
msgid "--default and --nocore cannot be used together"
msgstr ""
@@ -134,21 +134,21 @@
msgid "Unable to open %%ksappend file: %s"
msgstr ""
-#: ../pykickstart/parser.py:133 ../pykickstart/parser.py:801
+#: ../pykickstart/parser.py:133 ../pykickstart/parser.py:805
#, python-format
msgid "Unable to open input kickstart file: %s"
msgstr ""
-#: ../pykickstart/parser.py:425
+#: ../pykickstart/parser.py:429
msgid "Group cannot specify both --nodefaults and --optional"
msgstr ""
-#: ../pykickstart/parser.py:605 ../pykickstart/parser.py:646
+#: ../pykickstart/parser.py:609 ../pykickstart/parser.py:650
#, python-format
msgid "Section %s does not end with %%end."
msgstr ""
-#: ../pykickstart/parser.py:740
+#: ../pykickstart/parser.py:744
#, python-format
msgid "Unknown kickstart section: %s"
msgstr ""
@@ -157,7 +157,7 @@
#. NullSection for the header we just saw. Then nothing else
#. needs to change. You can turn this warning into an error via
#. ksvalidator, or the warnings module.
-#: ../pykickstart/parser.py:746
+#: ../pykickstart/parser.py:750
#, python-format
msgid "Potentially unknown section seen at line %(lineno)s: %(sectionName)s"
msgstr ""
@@ -171,8 +171,8 @@
msgstr ""
#: ../pykickstart/commands/firewall.py:117 ../pykickstart/commands/repo.py:183
-#: ../pykickstart/commands/fcoe.py:115 ../pykickstart/commands/iscsi.py:144
-#: ../pykickstart/commands/xconfig.py:98
+#: ../pykickstart/commands/xconfig.py:98 ../pykickstart/commands/fcoe.py:115
+#: ../pykickstart/commands/iscsi.py:144
#, python-format
msgid "Unexpected arguments to %(command)s command: %(options)s"
msgstr ""
@@ -218,11 +218,11 @@
msgstr ""
#: ../pykickstart/commands/lilocheck.py:50 ../pykickstart/commands/cdrom.py:50
-#: ../pykickstart/commands/skipx.py:50 ../pykickstart/commands/upgrade.py:56
-#: ../pykickstart/commands/upgrade.py:93 ../pykickstart/commands/eula.py:63
+#: ../pykickstart/commands/upgrade.py:56 ../pykickstart/commands/upgrade.py:93
#: ../pykickstart/commands/autopart.py:45
-#: ../pykickstart/commands/zerombr.py:66
+#: ../pykickstart/commands/zerombr.py:66 ../pykickstart/commands/eula.py:63
#: ../pykickstart/commands/unsupported_hardware.py:51
+#: ../pykickstart/commands/skipx.py:50
#: ../pykickstart/commands/displaymode.py:59
#: ../pykickstart/commands/mediacheck.py:49
#: ../pykickstart/commands/interactive.py:50
@@ -230,9 +230,9 @@
msgid "Kickstart command %s does not take any arguments"
msgstr ""
-#: ../pykickstart/commands/iscsiname.py:51 ../pykickstart/commands/key.py:59
-#: ../pykickstart/commands/keyboard.py:57 ../pykickstart/commands/mouse.py:62
-#: ../pykickstart/commands/lang.py:50
+#: ../pykickstart/commands/iscsiname.py:51 ../pykickstart/commands/mouse.py:62
+#: ../pykickstart/commands/keyboard.py:57 ../pykickstart/commands/lang.py:50
+#: ../pykickstart/commands/key.py:59
#, python-format
msgid "Kickstart command %s requires one argument"
msgstr ""
@@ -255,11 +255,10 @@
"ignoredisk command."
msgstr ""
-#: ../pykickstart/commands/sshkey.py:89
+#: ../pykickstart/commands/sshkey.py:89 ../pykickstart/commands/timezone.py:60
+#: ../pykickstart/commands/sshpw.py:127
#: ../pykickstart/commands/keyboard.py:127
-#: ../pykickstart/commands/sshpw.py:127 ../pykickstart/commands/rootpw.py:64
-#: ../pykickstart/commands/rootpw.py:111
-#: ../pykickstart/commands/timezone.py:60
+#: ../pykickstart/commands/rootpw.py:64 ../pykickstart/commands/rootpw.py:111
#, python-format
msgid "A single argument is expected for the %s command"
msgstr ""
@@ -291,16 +290,16 @@
msgid "The volgroup and autopart commands can't be used at the same time"
msgstr ""
+#: ../pykickstart/commands/timezone.py:135
+msgid "Options --nontp and --ntpservers are mutually exclusive"
+msgstr ""
+
#: ../pykickstart/commands/upgrade.py:96
#, python-format
msgid ""
"Kickstart command %(command)s does not accept empty parameter %(parameter)s"
msgstr ""
-#: ../pykickstart/commands/eula.py:66
-msgid "Kickstart command eula expects the --agreed option"
-msgstr ""
-
#. allow for translation of the error message
#: ../pykickstart/commands/autopart.py:180
#: ../pykickstart/commands/autopart.py:338
@@ -324,6 +323,10 @@
"kickstart. Please modify your kickstart file to remove any options."
msgstr ""
+#: ../pykickstart/commands/eula.py:66
+msgid "Kickstart command eula expects the --agreed option"
+msgstr ""
+
#: ../pykickstart/commands/bootloader.py:247
msgid "--boot-drive accepts only one argument"
msgstr ""
@@ -337,6 +340,11 @@
msgid "One of --disabled or --enabled must be provided."
msgstr ""
+#: ../pykickstart/commands/monitor.py:66
+#, python-format
+msgid "Unexpected arguments to %(cmd)s command: %(options)s"
+msgstr ""
+
#: ../pykickstart/commands/dmraid.py:90
#, python-format
msgid ""
@@ -344,12 +352,6 @@
"been defined."
msgstr ""
-#: ../pykickstart/commands/keyboard.py:132
-msgid ""
-"One of --xlayouts, --vckeymap options with value(s) or argument is expected "
-"for the keyboard command"
-msgstr ""
-
#: ../pykickstart/commands/driverdisk.py:116
#: ../pykickstart/commands/driverdisk.py:148
msgid "Only one partition may be specified for driverdisk command."
@@ -381,20 +383,6 @@
"command."
msgstr ""
-#: ../pykickstart/commands/device.py:97
-msgid "device command requires two arguments: module type and name"
-msgstr ""
-
-#: ../pykickstart/commands/device.py:123
-#, python-format
-msgid "%(command)s command requires a single argument: %(argument)s"
-msgstr ""
-
-#: ../pykickstart/commands/device.py:132
-#, python-format
-msgid "A module with the name %s has already been defined."
-msgstr ""
-
#: ../pykickstart/commands/zfcp.py:110
msgid "A zfcp with this information has already been defined."
msgstr ""
@@ -443,6 +431,20 @@
msgid "--mkfsoptions and --fsprofile cannot be used together."
msgstr ""
+#: ../pykickstart/commands/device.py:97
+msgid "device command requires two arguments: module type and name"
+msgstr ""
+
+#: ../pykickstart/commands/device.py:123
+#, python-format
+msgid "%(command)s command requires a single argument: %(argument)s"
+msgstr ""
+
+#: ../pykickstart/commands/device.py:132
+#, python-format
+msgid "A module with the name %s has already been defined."
+msgstr ""
+
#: ../pykickstart/commands/logvol.py:405
#, python-format
msgid ""
@@ -557,6 +559,12 @@
msgid "A group with the name %s has already been defined."
msgstr ""
+#: ../pykickstart/commands/keyboard.py:132
+msgid ""
+"One of --xlayouts, --vckeymap options with value(s) or argument is expected "
+"for the keyboard command"
+msgstr ""
+
#: ../pykickstart/commands/network.py:373
#, python-format
msgid "A network device with the name %s has already been defined."
@@ -593,11 +601,6 @@
msgid "The vlan id is out of the %(minimum)d-%(maximum)d vlan id range."
msgstr ""
-#: ../pykickstart/commands/monitor.py:66
-#, python-format
-msgid "Unexpected arguments to %(cmd)s command: %(options)s"
-msgstr ""
-
#: ../pykickstart/commands/multipath.py:97
#, python-format
msgid "Device '%(device)s' is already used in multipath '%(multipathdev)s'"
@@ -628,10 +631,6 @@
msgid "--mkfsoptions with --noformat or --useexisting has no effect."
msgstr ""
-#: ../pykickstart/commands/timezone.py:135
-msgid "Options --nontp and --ntpservers are mutually exclusive"
-msgstr ""
-
#: ../tools/ksflatten:35
msgid "Path to kickstart config file"
msgstr ""