Re: [Rpm-maint] [rpm-software-management/rpm] %exclude should not permit files to bypass check-files and be omitted from all packages built from spec (#994)

2020-11-21 Thread Miro Hrončok
> Maybe it's not horrible, only pretty bad :)

It is horrible. See 
https://github.com/rpm-software-management/rpm/pull/1442#issuecomment-731554917

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/994#issuecomment-731554963___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Require everything in buildroot to be packaged (#994) (#1442)

2020-11-21 Thread Miro Hrončok
261 packages failed to build for unrelated reason (such as timed out after 20 
minutes or had an already existing problem), that leaves 1414 packages that I 
have actually tested.

* 537 packages built successfully, that is ~38%
* 877 packages failed with unpackaged files, that is ~62%

That is quite a large number. I'd say a stop gap measure is needed for this 
(such as a macro that we can mass inject to the spec files not to break them, 
like `%define rpm_legacy_exclude 1`).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1442#issuecomment-731554917___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Require everything in buildroot to be packaged (#994) (#1442)

2020-11-20 Thread Miro Hrončok
OK. I have a copr setup with this: 
https://copr.fedorainfracloud.org/coprs/churchyard/rpm-exclude-change/builds/

And a dirty reporting script (adapted from our Python 3.10 monitoring script): 
https://github.com/hroncok/mini-mass-rebuild/blob/rpm-exclude/monitor_check_rpm.py

I've identified 1675 Fedora packages with `%exclude` in the spec. There might 
be false positives (`%%exclude`) and false negatives (`%include`) but as a 
sample, it works.

I will build all the packages (possibly with 20 minutes timeout not to waste 
resources) once the appdata generation (at least)  is disabled, see 
https://pagure.io/copr/copr/issue/1584

We should see how many packages will fail with `error: Installed (but 
unpackaged) file(s) found:` in the build.log. I suppose there are not that many 
packages that already fail with this error in rawhide, but if we want, I can 
recheck the failed ones in a control copr without the rpm snapshot.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1442#issuecomment-731234416___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] %exclude should not permit files to bypass check-files and be omitted from all packages built from spec (#994)

2020-11-19 Thread Miro Hrončok
I think there is no point in arguing. I understand both sides. Let's try 
measure the impact of this? Maybe it's not horrible, only pretyy bad :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/994#issuecomment-730376448___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Require everything in buildroot to be packaged (#994) (#1442)

2020-11-19 Thread Miro Hrončok
Is there a nighly copr with RPM, so I can measure the impact of this change in 
Fedora? I am worried that it will be enormous.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1442#issuecomment-730331744___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-11-10 Thread Miro Hrončok
Oh, I've been alerted by @torsava that my suggestions have been addressed. 
Nice, thanks! The code looks good to me. If the external tests still pass, 
let's ship it?

We can probably test this in Fedora before merging if we want more testing (but 
this is not necessary).

Thank you @s-t-e-v-e-n-k!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#issuecomment-724646250___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-10-21 Thread Miro Hrončok
@hroncok commented on this pull request.

Those are my final thoughts. They are not serious, but I thought I'd share them 
as suggestions.

> +try:
+from importlib.metadata import PathDistribution
+except ImportError:
+from importlib_metadata import PathDistribution
+
+try:
+from pathlib import Path
+except ImportError:
+from pathlib2 import Path
+
+
+class Req(Requirement):
+def __init__(self, requirement_string):
+super(Req, self).__init__(requirement_string)
+self.normalized_name = normalize_name(self.name)
+self.legacy_normalized_name = legacy_normalize_name(self.name)

It's confusing for me to not see the functions defined before this class.

>  from warnings import warn
 
+try:
+from importlib.metadata import PathDistribution
+except ImportError:
+from importlib_metadata import PathDistribution
+
+try:
+from pathlib import Path
+except ImportError:
+from pathlib2 import Path
+
+
+class Req(Requirement):

This naming is confusing to me. Why not import Requirement as Requirement_ and 
call this Requirement?

> +super(Distribution, self).__init__(Path(path))
+self.name = self.metadata['Name']
+self.normalized_name = normalize_name(self.name)
+self.legacy_normalized_name = legacy_normalize_name(self.name)
+self.requirements = [Req(r) for r in self.requires or []]
+self.extras = [
+v for k, v in self.metadata.items() if k == 'Provides-Extra']
+self.py_version = self._parse_py_version(path)
+
+def _parse_py_version(self, path):
+# Try to parse the Python version from the path the metadata
+# resides at (e.g. /usr/lib/pythonX.Y/site-packages/...)
+res = re.search(r"/python(?P\d+\.\d+)/", path)
+if res:
+return res.group('pyver')
+# If that hasn't worked, attempt to parse it from the directory name

```suggestion
# If that hasn't worked, attempt to parse it from the metadata 
directory name
```

> +return chain.from_iterable(
+[self.requirements_for_extra(extra) for extra in self.extras])

```suggestion
return chain(self.requirements_for_extra(e) for e in self.extras)
```

(untested)

> @@ -143,10 +201,30 @@ def convert(name, operator, version_id):
 
 def normalize_name(name):
 """https://www.python.org/dev/peps/pep-0503/#normalized-names"";
-import re

Why is this no longer lazy? Because the performance impact was negligible?

>  
 if args.majorver_provides or args.majorver_provides_versions or \
 args.majorver_only or args.legacy_provides or args.legacy:
 # Get the Python major version
 pyver_major = dist.py_version.split('.')[0]
 if args.provides:
 # If egg/dist metadata says package name is python, we provide 
python(abi)
-if dist.key == 'python':
+if dist.legacy_normalized_name == 'python':

```suggestion
if dist.normalized_name == 'python':
```

This does the same, but reads easier.

> @@ -324,7 +363,7 @@ def normalize_name(name):
 if args.requires or (args.recommends and dist.extras):
 name = 'python(abi)'
 # If egg/dist metadata says package name is python, we don't 
add dependency on python(abi)
-if dist.key == 'python':
+if dist.legacy_normalized_name == 'python':

```suggestion
if dist.normalized_name == 'python':
```

>  (lower.endswith('.egg') or
  lower.endswith('.egg-info'))):
-# stick them first so any more specific requirement 
overrides it
-deps.insert(0, Requirement.parse('setuptools'))
+groups = set([ep.group for ep in dist.entry_points])

```suggestion
groups = {ep.group for ep in dist.entry_points}
```

Unless we want to support Python 2.6 which I'd rather not (and most likely we 
already don't).

>  (lower.endswith('.egg') or
  lower.endswith('.egg-info'))):
-# stick them first so any more specific requirement 
overrides it
-deps.insert(0, Requirement.parse('setuptools'))
+groups = set([ep.group for ep in dist.entry_points])
+if set(["console_scripts", "gui_scripts"]) & groups:

```suggestion
if {"console_scripts", "gui_scripts"} & groups:
```

> -py_deps[name] = []
-spec = ('==', spec[1])
-if spec not in py_deps[name]:
-py_deps[name].append(spec)
-
-names = list(py_deps.keys())
-names.sort()
-for name in names:
+for dep in dist.requirements + dist.extra_requirements:
+for spec in dep.specifier:
+  

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-19 Thread Miro Hrončok
Indeed, either 1 string or 1 list (table) sounds more natural to me.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1398#issuecomment-711887349___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Miro Hrončok
> There's ample potential for bikeshedding here (eg what to call the global 
> table)

Indeed :) `m` is nice and short, but possibly a bit too much? What about 
including it in the `rpm` namespace as `rpm.m`?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1398#issuecomment-707653054___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-10-13 Thread Miro Hrončok
@hroncok commented on this pull request.



> @@ -142,9 +210,23 @@ def convert(name, operator, version_id):
 
 
 def normalize_name(name):

Happy to adapt that script when we integrate this. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#discussion_r503740667___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-10-12 Thread Miro Hrončok
@hroncok commented on this pull request.



> +@classmethod
+def normalize_name(klass, name):
+"""https://www.python.org/dev/peps/pep-0503/#normalized-names"";
+return re.sub(r'[-_.]+', '-', name).lower()
+
+@classmethod
+def legacy_normalize_name(klass, name):
+"""Like pkg_resources Distribution.key property"""
+return re.sub(r'[-_]+', '-', name).lower()

I wonder why it is a classmethod and not a staticmethod (when it does not use 
the "kalss" attribute at all). I would make it a property, but initialized 
value is fine as well.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#discussion_r503325494___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-09 Thread Miro Hrončok
The provided example looks excellent, thank you!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1383#issuecomment-706087800___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: pass parametric macro options and arguments to Lua natively (#1092)

2020-10-08 Thread Miro Hrončok
I assume option without argument would be true while option with argument would 
be string with its value? 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1092#issuecomment-705395114___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: pass parametric macro options and arguments to Lua natively (#1092)

2020-10-06 Thread Miro Hrončok
Do you have an example of usage? It's hard to find for me in the tests.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1092#issuecomment-704199944___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-24 Thread Miro Hrončok
@hroncok commented on this pull request.



>  from warnings import warn
 
+try:
+from importlib.metadata import PathDistribution
+except ImportError:
+from importlib_metadata import PathDistribution
+
+try:
+from pathlib import Path
+except ImportError:
+from pathlib2 import Path
+
+
+class Req(Requirement):
+@property
+def key(self):
+return self.name.lower().replace('_', '-')

massive layering violation?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#discussion_r494314287___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-24 Thread Miro Hrončok
@hroncok commented on this pull request.



>  from warnings import warn
 
+try:
+from importlib.metadata import PathDistribution
+except ImportError:
+from importlib_metadata import PathDistribution
+
+try:
+from pathlib import Path
+except ImportError:
+from pathlib2 import Path
+
+
+class Req(Requirement):
+@property
+def key(self):
+return self.name.lower().replace('_', '-')

Instead, I'd create two properties here:

```python
class Req(Requirement):
@property
def legacy_normalized_name(self):
"""Like pkg_resources key property"""
if not self._legacy_normalized_name:
self._legacy_normalized_name = re.sub(r'[-_]+', '-', 
self.name).lower()
   return self._legacy_normalized_name

@property
   def normalized_name(self):
"""PEP 503 normalized name"""
if not self._normalized_name:
self._normalized_name = re.sub(r'[-_.]+', '-', self.name).lower()
   return self._normalized_name
```

"key" is not very descriptive.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#discussion_r494237504___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-24 Thread Miro Hrončok
@hroncok commented on this pull request.



>  from warnings import warn
 
+try:
+from importlib.metadata import PathDistribution
+except ImportError:
+from importlib_metadata import PathDistribution
+
+try:
+from pathlib import Path
+except ImportError:
+from pathlib2 import Path
+
+
+class Req(Requirement):
+@property
+def key(self):
+return self.name.lower().replace('_', '-')

That really depends on `self.name` value. I don't see that from the code here.

In pkg_resources, key is based on `self.project_name` and that [is set 
to](https://github.com/pypa/setuptools/blob/73e379cc55ac1e9ec63c4ac30b75ecc82418f513/pkg_resources/__init__.py#L2564)
 `safe_name(project_name)`.

In packaging, I believe `self.name` is not pre-processed. See:

```pycon
>>> import pkg_resources
>>> pkg_resources.safe_name("Tree-_-FALLING.Down").lower()
'tree-falling.down'
>>> from packaging.requirements import Requirement
>>> Requirement("Tree-_-FALLING.Down").name.lower().replace('_', '-')
'tree---falling.down'
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#discussion_r494234076___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-24 Thread Miro Hrončok
@hroncok commented on this pull request.



>  from warnings import warn
 
+try:
+from importlib.metadata import PathDistribution
+except ImportError:
+from importlib_metadata import PathDistribution
+
+try:
+from pathlib import Path
+except ImportError:
+from pathlib2 import Path
+
+
+class Req(Requirement):
+@property
+def key(self):
+return self.name.lower().replace('_', '-')

@torsava This is the implementation of key. I don't believe it matches the 
original key value in all cases.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#pullrequestreview-495454542___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-24 Thread Miro Hrončok
@hroncok commented on this pull request.



>  if normalized_names_require_pep503:
-dep_normalized_name = normalize_name(dep.project_name)
+dep_normalized_name = normalize_name(dep.name)
 else:
 dep_normalized_name = dep.key

In that case, I don't get the question :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#discussion_r494210959___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-24 Thread Miro Hrončok
@hroncok commented on this pull request.



>  else:
-dep_normalized_name = dep.key
+dep_normalized_name = dep.key.replace('_', '-')

The code allows both naming conventions. We need to preserve that. ideally, we 
would have our own regexes for that to avoid changes based on 3rd party 
changes. We have `normalize_name()` function. What about having 
`normalize_name(kind="legacy"/"pep503")`?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#discussion_r494174964___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-23 Thread Miro Hrončok
@hroncok commented on this pull request.



>  else:
-dep_normalized_name = dep.key
+dep_normalized_name = dep.key.replace('_', '-')

Be careful with manual replaces for normalized names. There are two regexes 
that this code supported before. The PEP 503 regex and the regex imported from 
setuptools ([described in 
here](https://github.com/pypa/setuptools/issues/1597)). 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#discussion_r493384880___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-22 Thread Miro Hrončok
@hroncok commented on this pull request.



>  
-names = list(py_deps.keys())
-names.sort()
-for name in names:
+for name in sorted(list(py_deps.keys())):

```suggestion
for name in sorted(py_deps.keys()):
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#pullrequestreview-493603639___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-22 Thread Miro Hrončok
@hroncok commented on this pull request.



>  from warnings import warn
 
+try:
+from importlib.metadata import PathDistribution
+from pathlib import Path
+except ImportError:
+from importlib_metadata import PathDistribution
+from pathlib2 import Path

I'd rather have those two split, to use pathlib + importlib_metadata on e.g. 
Python 3.7.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#pullrequestreview-493511637___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: elfdeps: Filter Python subdirectories (#1227)

2020-09-01 Thread Miro Hrončok
I was thinking how to handle this today. I've only figured out *wrong* 
solutions:

1. Modify `%__global_provides_exclude_from` to include 
`%{_libdir}/python\d+\.\d+/.+\.so`.
This obviously has several problems: I cannot really do it from Python macros, 
so the information would need to be kept in the general macros file. Also, if 
we ever start providing something from those `.so` files, this would no longer 
work. Also, it does not scale well.

2. Negate the entire ELF generator on the specific paths and provide alternate 
ELF *requires* generator (without *provides*) for them. That seems like an 
awful "copy paste stuff around" hack, ale not sure how to detect the need to do 
this.

3. Extend RPM generators to be able to specify different 
`%__NAME_provides_exclude_path`, `%__NAME_requires_exclude_path` instead of 
general `%__NAME_exclude_path` and set  `%__elf_provides_exclude_path` to 
`%{_libdir}/python\d+\.\d+/.+\.so`. This should work but requires a lot of 
work. Also obviously, if more things want to set 
`%__elf_provides_exclude_path`, they would need to figure out how or have a 
shared place to configure it.

4. Use `%{_rpmconfigdir}/elfdeps --provides 
%{?__elf_provides_exclude_path:--exclude '%{__elf_provides_exclude_path}'}` in 
`%__elf_provides` to simulate the above. However, the problem continues: If 
both Perl and Python want to set `%__elf_provides_exclude_path` to "their" 
path, they would need to have a shared place to configure it.

:/

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1227#issuecomment-684717757___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Lua rpm.error() function (#1218)

2020-09-01 Thread Miro Hrončok
Also, `rpm.with("foo")` and `rpm.without("foo")` would be lovely.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1218#issuecomment-684631129___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Prevent automatic garbage collection in git based %autosetup macros (#1336)

2020-08-20 Thread Miro Hrončok
Right? It happened here BTW 
https://koschei.fedoraproject.org/package/pypy3?collection=f33

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1336#issuecomment-677433082___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Prevent automatic garbage collection in git based %autosetup macros (#1336)

2020-08-19 Thread Miro Hrončok
The garbage collection happens in background, based on heuristic.
This means that sometimes, when subsequent commands run,
some files might disappear in the middle of an action.

For example, when a find is used in %prep:

+ /usr/bin/git commit -m ... --author rpm-build rpm-build
Auto packing the repository in background for optimum performance.
See git help gc for manual housekeeping.
...
+ find ...
find: ./.git/objects/47: No such file or directory
find: ./.git/objects/46: No such file or directory
find: ./.git/objects/49: No such file or directory
find: ./.git/objects/4d: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.xx (%prep)
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/1336

-- Commit Summary --

  * Prevent automatic garbage collection in git based %autosetup macros

-- File Changes --

M macros.in (1)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/1336.patch
https://github.com/rpm-software-management/rpm/pull/1336.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1336
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-08-14 Thread Miro Hrončok
Note that the tests are with 
https://fedoraproject.org/wiki/Changes/PythonExtras which was not yet 
backported here.

Take 
[something](https://src.fedoraproject.org/rpms/python-rpm-generators/commits/master)
 before [this 
commit](https://src.fedoraproject.org/rpms/python-rpm-generators/c/3b1100ba1f5cbf1b1ebde65adec82d13d6cc62a6?branch=master).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#issuecomment-673973395___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Disable Python hash seed randomization in brp-python-bytecompile (#1320)

2020-07-24 Thread Miro Hrončok
As always, I suggest to put the description to the commit message, not just the 
PR description.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1320#issuecomment-663511918___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Disable Python hash seed randomization in brp-python-bytecompile (#1320)

2020-07-24 Thread Miro Hrončok
@hroncok approved this pull request.

I've already approved this in Fedora and I've asked @frenzymadness to bring it 
here as well.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1320#pullrequestreview-454841473___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-07-23 Thread Miro Hrončok
@torsava PTAL on the code and possibly run it trough the tests.

I ma not happy that we would need to rething the bootstrap sequence of 
setuptools/pyparsing/six/packaging but OTOH setutpools indeed bundles all of 
those.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#issuecomment-662885087___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-07-23 Thread Miro Hrončok
> and you've not noticed because setuptools vendors it.

We have noticed ;)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#issuecomment-662882711___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] pythondistdeps.py: Adapt Python version marker workaround for setuptools 42+ (#1308)

2020-07-10 Thread Miro Hrončok
See https://bugzilla.redhat.com/show_bug.cgi?id=1853597#c11

pkg_resources from setuptools 42+ no longer only use platform.python_version(),
but also platform.python_version_tuple() -- this was updated in packaging 19.1+.

This fix makes it work again with both new and old setuptools,
hopefully for some while.

https://github.com/pypa/setuptools/commit/bf069fe9ddcadaa2c029067601d06a07d037d4f7
https://github.com/pypa/packaging/commit/86a443f3185024edd0b826afdd91d8f9a4917022
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/1308

-- Commit Summary --

  * pythondistdeps.py: Adapt Python version marker workaround for setuptools 42+

-- File Changes --

M scripts/pythondistdeps.py (1)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/1308.patch
https://github.com/rpm-software-management/rpm/pull/1308.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1308
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Sync python dependency conversion with pyreq2rpm. (#1299)

2020-07-06 Thread Miro Hrončok
See my review in https://github.com/gordonmessmer/pyreq2rpm/pull/7

The changes here make sense, yes.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1299#issuecomment-654288456___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Sync python dependency conversion with pyreq2rpm. (#1299)

2020-07-06 Thread Miro Hrončok
@hroncok approved this pull request.





-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1299#pullrequestreview-443152346___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Files in %_docdir are not passed to dependency generators (#1297)

2020-07-01 Thread Miro Hrončok
Ah I wanted to add links. See 
https://lists.fedoraproject.org/archives/list/de...@lists.fedoraproject.org/thread/KY2PV6ENHUIO6OYOL3LWSNYEZJIAUHPZ/#KY2PV6ENHUIO6OYOL3LWSNYEZJIAUHPZ

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1297#issuecomment-652386941___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Files in %_docdir are not passed to dependency generators (#1297)

2020-07-01 Thread Miro Hrončok
See also 
https://github.com/rpm-software-management/rpm/issues/713#issuecomment-652366245

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1297#issuecomment-652366358___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Have file attributes for %license and %doc (#713)

2020-07-01 Thread Miro Hrončok
I think that for most common cases, [people don't want dependency generators 
for `%doc` and `%license`](https://bugzilla.redhat.com/show_bug.cgi?id=964126). 
Hence it might make sense to not process such files by default at all and add 
an attr flag that can enable to process them, such as:

```
%__NAME_flags doc license
```

That would still *not* expose the attributes to the generator but OTOH it 
doesn't need a new API.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/713#issuecomment-652366245___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Files in %_docdir are not passed to dependency generators (#1297)

2020-07-01 Thread Miro Hrončok
This was done in 816c7cf3fdae5c45de02a42a2245549778e2ca80

I wonder if you would accept applying the regex as the default value for 
`%__NAME_exclude_path` instead. That should still [fix the original 
problem](https://bugzilla.redhat.com/show_bug.cgi?id=964126) while it would 
allow dependency generators to opt out.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1297#issuecomment-652364687___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Files in %_docdir are not passed to dependency generators (#1297)

2020-07-01 Thread Miro Hrončok
There is this default:

https://github.com/rpm-software-management/rpm/blob/262d4855cd460048d106eb948fc677e6e435ed6e/macros.in#L208-L213

It prevents *any* dependency generator to see files in `%_docdir`. While I 
agree that this makes a good default as the majority of the dependency 
generators don't need to generate deps for files in there, I would like to make 
it possible to write a generator that does this. Currently, it is not possible 
without altering the behavior for all generators.

I have a use case for a generator that needs to see a css file shipped from 
`%_docdir`. I was able to "make it work" via:

```
%__global_requires_exclude_from %{quote:}
```

However, this is obviously dangerous for other generators. Is there any way out 
of this?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1297___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Fix python(abi) requires generator, it picked files from almost good directories (#1272)

2020-06-25 Thread Miro Hrončok
> To be clear, `%__foo_path` and `%__foo_magic` filters are a union, not an 
> intersection? That's actually somewhat surprising behavior...

Union by default but can be switched with `magic_and_path` flag in 
`%__foo_flags` to intersection.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1272#issuecomment-649484434___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Fix python(abi) requires generator, it picked files from almost good directories (#1272)

2020-06-25 Thread Miro Hrončok
Ack. I'll ping people. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1272#issuecomment-649284471___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Fix python(abi) requires generator, it picked files from almost good directories (#1272)

2020-06-24 Thread Miro Hrončok
Is this good to be merged?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1272#issuecomment-649113390___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Discussion: How to handle Python extras (#1061)

2020-06-23 Thread Miro Hrončok
We have proposed this in Fedora: 
https://fedoraproject.org/wiki/Changes/PythonExtras

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1061#issuecomment-648082385___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-06-18 Thread Miro Hrončok
Would you accept a pull request that that adds a `rpmlua` executable and makes 
it behave more or less like my Python script?

Note that my C skills are rusty and my autotools skills are almost nonexistent, 
so I will probably need some guidance.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1215#issuecomment-646019565___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Fix python(abi) requires generator, it picked files from almost good directories (#1272)

2020-06-18 Thread Miro Hrončok
Commit message amended.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1272#issuecomment-645958035___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Fix python(abi) requires generator, it picked files from almost good directories (#1272)

2020-06-18 Thread Miro Hrončok
Indeed! This makes much more sense now, thanks. I'll amend the commit message.

Before (file-5.38-6.fc33):

```
 sh-5.0# file -z -e tokens 
/opt/usr/lib/python3.8/site-packages/{__pycache__/,}file*
/opt/usr/lib/python3.8/site-packages/__pycache__/file.cpython-38.opt-1.pyc: data
/opt/usr/lib/python3.8/site-packages/__pycache__/file.cpython-38.pyc:   data
/opt/usr/lib/python3.8/site-packages/file.py:   
ASCII text
```

After (file-5.39-1.fc33):

```
 sh-5.0# file -z -e tokens 
/opt/usr/lib/python3.8/site-packages/{__pycache__/,}file*
/opt/usr/lib/python3.8/site-packages/__pycache__/file.cpython-38.opt-1.pyc: 
python 3.8 byte-compiled
/opt/usr/lib/python3.8/site-packages/__pycache__/file.cpython-38.pyc:   
python 3.8 byte-compiled
/opt/usr/lib/python3.8/site-packages/file.py:   
ASCII text
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1272#issuecomment-645952329___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Fix python(abi) requires generator, it picked files from almost good directories (#1272)

2020-06-18 Thread Miro Hrončok
> sounds more like a libmagic change than rpm one.

Let me test that actually.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1272#issuecomment-645949664___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Fix python(abi) requires generator, it picked files from almost good directories (#1272)

2020-06-17 Thread Miro Hrončok
Downstream discovery in 
https://src.fedoraproject.org/rpms/python-rpm-generators/pull-request/20

I wonder, what changed in RPM?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1272#issuecomment-645402304___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Fix python(abi) requires generator, it picked files from almost good directories (#1272)

2020-06-17 Thread Miro Hrončok
The %__python_magic filter suddenly got suppressed by the magic filter.
Hence, the generator started to pick files like:

/opt/usr/lib/python3.X/...

Required python(abi). We dont need to filter the files by file magic, so 
we drop it.

Previously, it seems that the behavior was flaky.
The path filter was more important than the magic one somehow.

Now we can choose if the filters are applied as OR or AND.
However, we dont want either.

We actually want to mach any files in Python directories.
We *could* filter by file type (and executable bit) for provides,
but that would require us to split the attr files into two.
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/1272

-- Commit Summary --

  * Fix python(abi) requires generator, it picked files from almost good 
directories

-- File Changes --

M fileattrs/python.attr (1)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/1272.patch
https://github.com/rpm-software-management/rpm/pull/1272.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1272
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-06-13 Thread Miro Hrončok
This gets the job done:

```python
librpm = cdll.LoadLibrary("librpm.so.9")

# Load general configuration (such as macros defined in standard places)
# Second argument is target platform, NULL is the default
librpm.rpmReadConfigFiles(librpm.rpmcliRcfile, None)
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1215#issuecomment-643676287___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-06-04 Thread Miro Hrončok
My script doesn't seem to see system defined macros. Do I need to call 
something explicitly to load them?

```
$ rpmlua 

RPM Interactive Lua 5.3 Interpreter
> print(rpm.expand("%python3"))
%python3
> rpm.define("test b")
> print(rpm.expand("%test"))
b
> 


$ rpm --eval "%{lua:rpm.interactive()}"

RPM Interactive Lua 5.3 Interpreter
> print(rpm.expand("%python3"))
> 
/usr/bin/python3
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1215#issuecomment-638770015___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: Various updates and fixes (no test suite) (#1242)

2020-05-26 Thread Miro Hrončok
> I would move `import re` to the top imports and just be done with it.

We can discuss this in a separate issue. It hasn't changed here.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1242#issuecomment-634131378___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: New test suite and various updates and fixes (#1195)

2020-05-26 Thread Miro Hrončok
As a short term thing, we just need to merge in the code, so other changes 
don't diverge too much.

Not having the tests here is something that I'd rather avoid -- how do we 
expect everybody to remember that the tests are somewhere else?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1195#issuecomment-633852867___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Discussion: How to handle Python extras (#1061)

2020-05-19 Thread Miro Hrončok
Here's my idea:

```lua
%python_extras_subpkg(n:i:f:) %{expand:%{lua:
local value_n = rpm.expand('%{-n*}')
local value_i = rpm.expand('%{-i*}')
local value_f = rpm.expand('%{-f*}')
local args = rpm.expand('%{*}')
if value_n == '' then
rpm.expand('%{error:%%%0: missing option -n (name of the base 
package)}')
end
if value_i == '' and value_f == '' then
rpm.expand('%{error:%%%0: missing option -i (buildroot path to 
metadata) or -f (builddir path to a filelist)}')
end
if value_i ~= '' and value_f ~= '' then
rpm.expand('%{error:%%%0: simultaneous -i (buildroot path to metadata) 
and -f (builddir path to a filelist) is not supported}')
end
if args == '' then
rpm.expand('%{error:%%%0 requires at least one argument with "extras" 
name}')
end
local requires = 'Requires: ' .. value_n .. ' = 
%{?epoch:%{epoch}:}%{version}-%{release}'
for extras in args:gmatch('%w+') do
local rpmname = value_n .. '+' .. extras
local pyname = value_n .. '[' .. extras .. ']'
local pkgdef = '%package -n ' .. rpmname
local summary = 'Summary: Metapackage requiring requires for ' .. pyname
local description = '%description -n ' .. rpmname .. '\\\n' ..
'This is a metapackage bringing in requires for ' 
.. pyname .. '.\\\n' ..
'It contains no code, just makes sure the 
dependencies are installed.\\\n'
local files
if value_i ~= '' then
files = '%files -n ' .. rpmname .. '\\\n' .. '%ghost ' .. value_i
else
files = '%files -n ' .. rpmname .. ' -f ' .. value_f
end
for i, line in ipairs({pkgdef, summary, requires, description, files, 
''}) do
print(line .. '\\\n')
end
end
}}
```

You'd put this to your specfile near other subpackage declarations:

```
%python_extras_subpkg -n python3-setuptools_scm -i 
%{python3_sitelib}/*.egg-info toml
```

It expands to:

```
%package -n python3-setuptools_scm+toml
Summary: Metapackage requiring requires for python3-setuptools_scm[toml]
Requires: python3-setuptools_scm = %{?epoch:%{epoch}:}%{version}-%{release}
%description -n python3-setuptools_scm+toml
This is a metapackage bringing in requires for python3-setuptools_scm[toml].
It contains no code, just makes sure the dependencies are installed.

%files -n python3-setuptools_scm+toml
%ghost /usr/lib/python3.8/site-packages/*.egg-info
```

The rest would be handled by the Python dist dependency generator (taking 
package name as argument, parsing out the `+toml` part of it, and finding 
extras named `toml` in the package, eventually providing 
`python3dist(setuptools_scm[toml]) = 1.2.3` and requiring whatever that 
requires. If extras `toml` is not found, the dependency generator will error 
([somehow](https://github.com/rpm-software-management/rpm/issues/1183)).

Side note: The `-f` option allows to do:

```
%python_extras_subpkg -n python3-setuptools_scm -f %{python_extras_filelist} 
toml
```

When other automation is at play.

Side note 2: The subpackage should really require 
`python3-setuptools_scm%{?_isa}` if arched, but I am unsure how to detect if 
`python3-setuptools_scm` is arched or noarch, so I will just hope for the best 
:crossed_fingers: 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1061#issuecomment-631023401___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Support rpm version comparison in expressions (#1233)

2020-05-19 Thread Miro Hrončok
@hroncok commented on this pull request.



> @@ -241,15 +241,17 @@ newline is deleted). Note the 2nd % needed to escape 
> the arguments to
 
 Expression expansion can be performed using "%[expression]".  An
 expression consists of terms that can be combined using
-operators.  Rpm supports two kinds of terms, numbers made up
-from digits and strings enclosed in double quotes.  Rpm will
-expand macros when evaluating terms.
+operators.  Rpm supports three kinds of terms, numbers made up
+from digits, strings enclosed in double quotes (eg "somestring") and
+versions enclosed in double quotes preceded by (eg v"3:1.2-1").

```suggestion
versions enclosed in double quotes preceded by v (eg v"3:1.2-1").
```

>  
 You can use the standard operators to combine terms: logical
 operators &&, ||, !, relational operators !=, ==, <, > , <=, >=,
 arithmetic operators +, -, /, *, the ternary operator ? :, and
 parentheses.  For example, "%[ 3 + 4 * (1 + %two) ]" will expand
-to "15" if "%two" expands to "2".
+to "15" if "%two" expands to "2". Version terms are compared using
+rpm version comparison algorith, rather than regular string comparison.

```suggestion
rpm epoch:version-release comparison algorithm, rather than regular string 
comparison.
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1233#pullrequestreview-414441468___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Support rpm version comparison in expressions (#1233)

2020-05-19 Thread Miro Hrončok
So, this basically compares evrs, correct?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1233#issuecomment-630815654___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: elfdeps: Filter Python subdirectories (#1227)

2020-05-18 Thread Miro Hrončok
However of course, in this particular case, we only want the provides to be 
filtered, not requires. If 
`/usr/lib64/python3.8/site-packages/libiscsi.cpython-38-x86_64-linux-gnu.so` 
links to `libiscsi.so.0`, we still want the package to require it. So setting a 
negative path filter in `elf.attr` would not work as intended :(

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1227#issuecomment-630320420___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: elfdeps: Filter Python subdirectories (#1227)

2020-05-18 Thread Miro Hrončok
```
%__NAME_path_exclude
```

?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1227#issuecomment-630211602___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: elfdeps: Filter Python subdirectories (#1227)

2020-05-18 Thread Miro Hrončok
anti-classifier directive is totally fine by me.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1227#issuecomment-630131791___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] RFE: elfdeps: Filter Python subdirectories (#1227)

2020-05-17 Thread Miro Hrončok
I'd like the 
[elfdeps](https://github.com/rpm-software-management/rpm/blob/master/tools/elfdeps.c)
 to filter out certain directories, namely anything in 
`/usr/lib(64)?/pythonX.Y/`.

Context:

 - historically, all Python extension modules needed to use 
`%filter_provides_in %{python_sitearch}/.*\.so$` to avoid getting useless 
provides
 - later, this practice shifted to `%global __provides_exclude_from 
^(%{python_sitearch}/.*\\.so)$`
 - later (73bd9636d0e76a4d255776b7733667198b9ef585), Python extension modules 
that don't start with `lib...` are no longer needed to be filtered out, hence 
this practice slowly dies

But we cannot get rid of this historical cruft totally, because some packages 
have Python extension modules named "lib...":

```
/usr/lib64/python3.8/site-packages/libexiv2python.cpython-38-x86_64-linux-gnu.so
/usr/lib64/python3.8/site-packages/libhivexmod.cpython-38-x86_64-linux-gnu.so
/usr/lib64/python3.8/site-packages/libxtwrapper.cpython-38-x86_64-linux-gnu.so
/usr/lib64/python3.8/site-packages/libiscsi.cpython-38-x86_64-linux-gnu.so
/usr/lib64/python3.8/site-packages/libxml2mod.so
/usr/lib64/python3.8/site-packages/liblo.cpython-38-x86_64-linux-gnu.so
/usr/lib64/python3.8/site-packages/libPyROOT.cpython-38-x86_64-linux-gnu.so
/usr/lib64/python3.8/site-packages/libtorrent.cpython-38-x86_64-linux-gnu.so
```

An in turn they either need to filter the provides (which most current Python 
packagers don't know, unless they have some historical background of 7+ years), 
or they have bogus provides:

```
libexiv2python.cpython-38-x86_64-linux-gnu.so()(64bit)
libhivexmod.cpython-38-x86_64-linux-gnu.so()(64bit)
libxtwrapper.cpython-38-x86_64-linux-gnu.so()(64bit)
libiscsi.cpython-38-x86_64-linux-gnu.so()(64bit)
libxml2mod.so()(64bit)
liblo.cpython-38-x86_64-linux-gnu.so()(64bit)
libPyROOT.so.6.20()(64bit)
libtorrent.cpython-38-x86_64-linux-gnu.so()(64bit)
```

I'd like that no such provides are generated. Easiest way forward is to simply 
ignore the directories. I am fine with working on a pull request for this, but 
I'd like to discuss first on what level we should have the directories defined. 
Would it work if the tool had an `--exclude` argument that would take a path 
regex to exclude and we would define that to 
`^%{_prefix}/lib(64)?/python\d+\.\d+/` in `elf.attr`?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1227___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFC: support rpm version comparison in expression parser (#1220)

2020-05-15 Thread Miro Hrončok
`%{version:1.2.3}` would be my choice as well, if only it would not be 
confusing with `%{version}`. That' why I proposed `%{ver:5.6}`

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1220#issuecomment-629144265___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Convenient version comparison macro (#1217)

2020-05-14 Thread Miro Hrončok
While `@1.2@ < @1.0@` looks quite OK, when combined with macros, it's not very 
readable either:

```spec
%if @%{php_version}@ < @5.6@
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1217#issuecomment-628651033___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFC: support rpm version comparison in expression parser (#1220)

2020-05-14 Thread Miro Hrončok
Listed in 
https://github.com/rpm-software-management/rpm/issues/1217#issuecomment-628526414

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1220#issuecomment-628650303___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-14 Thread Miro Hrončok
Here is my draft blog post about how to get a nicer console 
https://hackmd.io/@hroncok/SyNjuxcqL

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1215#issuecomment-628586104___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFC: support rpm version comparison in expression parser (#1220)

2020-05-14 Thread Miro Hrončok
Thank you!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1220#issuecomment-628557926___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: New test suite and various updates and fixes (#1195)

2020-05-14 Thread Miro Hrončok
Since the high level discussion of whether this shall be split or not, can we 
please merge this for now to avoid the base diverging?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1195#issuecomment-628550526___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Convenient version comparison macro (#1217)

2020-05-14 Thread Miro Hrončok
Reopened #1217.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1217#event-3335805799___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Convenient version comparison macro (#1217)

2020-05-14 Thread Miro Hrončok
Closed #1217.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1217#event-3335805261___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Convenient version comparison macro (#1217)

2020-05-14 Thread Miro Hrončok
So, here are couple examples. I haven't checked if they don't collide with 
existing syntax.

```spec
# int comparison, fallbacks to version comparison if at least one operand has 
nondigits?
%if %{php_version} < 5.6

# string comparison, produces incorrect results some time
%if "%{php_version}" < "5.6"

# single quotes (easy, but it doesn't actually scream *this is version 
comparison*)
%if '%{php_version}' < '5.6'

# backticks (easy, as above, but at least screams "I am special")
%if `%{php_version}` < `5.6`

# string prefixes (see Python f-strings, b-strings and r-strings; confusing to 
non-Python people)
%if v"%{php_version}" < v"5.6"

# square brackets (special enough, but screams "I am an array with 1 element" 
to me)
%if [%{php_version}] < [5.6]

# square brackets  around the whole thing (why? screams "wtf")
%if [%{php_version} < 5.6]

# special %if like %ifarch (maybe too much?)
%ifver %{php_version} < 5.6

# a prefix without quotes (both confusing)
%if @%{php_version} < @5.6
%if $%{php_version} < $5.6

# a special macro (easy to understand a bit more complicated to write) 
%if %{vercmp %{php_version} < 5.6}

# a special macro to mark the values as versions (a bit more complicated to 
write as well)
%if %{ver:%{php_version}} < %{ver:5.6}

# golging the above (a bit more complicated to read)
%if %{V:%{php_version}} < %{V:5.6}
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1217#issuecomment-628526414___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Convenient %version without tilde macro (#1219)

2020-05-14 Thread Miro Hrončok
technically, since we are at RPM level, I wouldn't mind having this syntax:

%{version//~}

To remove whatever symbols I like.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1219#issuecomment-628496489___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Convenient version comparison macro (#1217)

2020-05-14 Thread Miro Hrončok
also "01" == "1"

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1217#issuecomment-628493078___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Convenient version comparison macro (#1217)

2020-05-14 Thread Miro Hrončok
right. ok then, comparing `""` as stings works for me \o/ Obviously, that'll be 
4.16+ only, so in Fedora terms, rawhide+.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1217#issuecomment-628481897___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Convenient %version without tilde macro (#1219)

2020-05-14 Thread Miro Hrončok
> As for passing passing empty strings (or strings with spaces etc) as a macro 
> argument, use %{quote:}

Thanks. Ugly, but works.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1219#issuecomment-628475121___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Convenient %version without tilde macro (#1219)

2020-05-14 Thread Miro Hrončok
I get your point. But before we come ou with a concept of native "pre/post 
tag", I think we should have a way to address this in a common way. I like 
`%{bare_version}` (not "ursine" please).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1219#issuecomment-628475009___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: pass parametric macro options and arguments to Lua natively (#1092)

2020-05-14 Thread Miro Hrončok
I was about to explore this as well, thanks for filing this.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1092#issuecomment-628473072___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Convenient version comparison macro (#1217)

2020-05-14 Thread Miro Hrončok
OTOH this is backwards incompatible and a bit weird.

What if `""` would still compare strings, but without `""` would compare 
versions? That is backwards compatible with comparing integers.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1217#issuecomment-628472204___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-14 Thread Miro Hrončok
I meant something a bit more sophisticated. I have so far:

```python
#!/usr/bin/python3
import sys
from ctypes import cdll, c_char_p


librpmio = cdll.LoadLibrary("librpmio.so.9")

adjust_path = b"""
if os.getenv("LUA_PATH") then
package.path =  os.getenv("LUA_PATH") .. ";" .. package.path
end
"""

# first argument is an "rpmlua" pointer, but uses global one when NULL
# second argument is code
# third argument is "name", used in errors, reasonable default when NULL
librpmio.rpmluaRunScript(None, c_char_p(adjust_path), None)

if len(sys.argv) > 1:
sys.argv[-1] = '/dev/stdin' if sys.argv[-1] == '-' else sys.argv[-1]
# first argument as above, second argument is path
librpmio.rpmluaRunScriptFile(None, c_char_p(sys.argv[-1].encode("utf-8")))
else:
librpmio.rpmluaRunScript(None, c_char_p(b"rpm.interactive()"), None)
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1215#issuecomment-628471186___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-14 Thread Miro Hrončok
I have it all figured out. Blog post coming. Would you consider adding 
something like the above to rpm itself? 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1215#issuecomment-628455808___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-13 Thread Miro Hrončok
This gets the job done:

```python
from ctypes import cdll, c_char_p
librpmio = cdll.LoadLibrary("librpmio.so.9")
librpmio.rpmluaRunScript(None, c_char_p(b"rpm.interactive()"), None)
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1215#issuecomment-628278283___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] RFE: Convenient %version without tilde macro (#1219)

2020-05-13 Thread Miro Hrončok
@ignatenkobrain has has created this in Fedora's rust-srpm-macros:

```lua
%version_no_tilde() %{lua:
local sep = rpm.expand('%1')
local ver = rpm.expand('%2')
\
if sep == '%1' then
sep = '-'
end
\
if ver == '%2' then
ver = rpm.expand('%version')
end
ver = ver:gsub('~', sep)
\
print(ver)
}
```

I'd like to have something like this part of the standard issued macros. 
**However**, I think the default should be empty separator for 2 reasons:

 - the name of this macro suggests there is no tilde, not that the tilde is 
replaced with anything
 - it seem incredibly hard to pass an empty string as a macro argument (I 
haven't figured out how to do that yet)

WDYT?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1219___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] RFE: Lua rpm.error() function (#1218)

2020-05-13 Thread Miro Hrončok
I'd kindly like to request that the following Lua/RPM code:

```lua
rpm.expand("%{error:...}")
```

Could be made simpler with something like:
```lua
rpm.error("...")
```

Please do let me know if there is an existing better idiom for this.

(Possibly also with `warn` and `echo`.)


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1218___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] RFE: Convenient version comparison macro (#1217)

2020-05-13 Thread Miro Hrončok
Hello. I had a recent discussion with @Conan-Kudo about version comparison in 
spec conditionals.

https://lists.fedoraproject.org/archives/list/python-de...@lists.fedoraproject.org/message/467NMLL3DTRZQBEX5LPFU6ZD5P56SSF3/

So I dug a bit and found the excellent `rpm.vercmp()` Lua function. 
Unfortunatelly, using this in spec seems a bit complicated:

```spec
%if %{lua:print(rpm.vercmp(rpm.expand("%python3_version"), "3.9"))} >= 0
```

Hence, I was thinking there might be a `%vercmp` convenient macro.

It could either just expose the Lua function:

```spec
%if %{vercmp %{python3_version} 3.9} >= 0
```

However, while at it, it could be even more clever:

```spec
%if %{vercmp %{python3_version} >= 3.9}
```

I have come up with this, which is not very nice code, but it gets the job done 
apparently:

```lua
%vercmp() %{lua:
local first = rpm.expand("%1")
local op = rpm.expand("%2")
local second = rpm.expand("%3")
if (first == "%1") or (op == "%2") or (second == "%3") then
rpm.expand("%{error:%%vercmp needs three argument}")
end
if not (op:match("^[<>=!]?=$") or op:match("^[<>=]$")) then
rpm.expand("%{error:%%vercmp second argument must be a comparison 
operator}")
end
local cmp = rpm.vercmp(first, second)
print(((cmp == 0 and op:match("^[<>=]?=$")) or (cmp == -1 and op:match("<=?")) 
or
  (cmp == 1 and op:match(">=?"))or (cmp ~= 0 and op == "!=")) and 1 or 0)
}
```

So I was wondering whether such macro could be added to the standard macro 
selection. If this is not the place, I'll offer it to redhat-rpm-config macros.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1217___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-13 Thread Miro Hrončok
Can I do anything to have the interneter not in the macro expansion mode?

Dne st 13. 5. 2020 11:03 uživatel Michael Schroeder <
notificati...@github.com> napsal:

> This happens because you're in a macro expansion, so all the output is
> collected and returned to the macro engine.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> ,
> or unsubscribe
> 
> .
>


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1215#issuecomment-627859734___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-12 Thread Miro Hrončok
I'd liek to use the interactive Lua console, however, it doesn't seem to be 
very... interactive.

```
$ rpm --eval "%{lua:rpm.interactive()}"

RPM Interactive Lua 5.3 Interpreter
>
```

So far so good...

```
> print"a"
> 
```

Nothing...

```
> print"a"
> print"a"
> print"a"
> print"a"
>
```

Nothing...

```
> ^D
a
```

Is there a way to receive the output as I put the input?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1215___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Discussion: splitting language specifics out of rpm core (#1199)

2020-05-04 Thread Miro Hrončok
> For example a Bugzilla, where a bug can be easily reassigned to a different 
> component .

GitHub can do this as well (it's a beta feature).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1199#issuecomment-623425055___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Discussion: splitting language specifics out of rpm core (#1199)

2020-04-28 Thread Miro Hrončok
> I know that Miro has expressed concerns about splitting language-specific 
> tools into different repos because it tends to be more difficult to get those 
> tools into broad use if they're separate releases.

I believe that was Neal.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1199#issuecomment-620766530___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Don't define global variables from Python generator (#1200)

2020-04-28 Thread Miro Hrončok
I havent tested this yet, but I believe this should work.
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/1200

-- Commit Summary --

  * Dont define global variables from Python generator

-- File Changes --

M fileattrs/python.attr (4)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/1200.patch
https://github.com/rpm-software-management/rpm/pull/1200.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1200
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Discussion: splitting language specifics out of rpm core (#1199)

2020-04-28 Thread Miro Hrončok
> Well, nothing prevents you having extensive testsuite for python, rust and 
> whatnot in one repo.

Bad maintainability?

--

I think we need to have some sort of distro-wide SIGs that can own things. I 
will take Python as an example (and we can pyoneer (hehe) this with Python and 
see what breaks).

The following steps need to be taken IMHO:

 1. reach out to known distros that use RPM, ask for relevant representatives 
of their Python RPM ecosystem
 2. collect the representatives of interested distros to an informal "RPM 
Python SIG"
 3. have this discussion with them (e.g. currently it is Fedora people talking 
to Fedora people)


--

An as a matter of separate repo or not, I think it can work both ways. GitHub 
supports code owners and groups. We can make the Python things "owned" by the 
"RPM Python SIG" in this repo, or we can have a separate repo and make sure the 
distros know this (trough their "RPM Python SIG" representatives).


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1199#issuecomment-620527744___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: New test suite and various updates and fixes (#1195)

2020-04-27 Thread Miro Hrončok
@hroncok commented on this pull request.



> @@ -11,6 +11,10 @@
 # RPM python dependency generator, using .egg-info/.egg-link/.dist-info data
 #
 
+# Please know:
+# - Notes from an attempted rewrite from pkg_resources to importlib.metadata in
+#   2020 can be found in the message of the commit that added this line.

I see this by a wrong comment, but +1.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1195#discussion_r415943074___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: New test suite and various updates and fixes (#1195)

2020-04-27 Thread Miro Hrončok
@hroncok commented on this pull request.



> @@ -11,6 +11,10 @@
 # RPM python dependency generator, using .egg-info/.egg-link/.dist-info data
 #
 
+# Please know:
+# - Notes from an attempted rewrite from pkg_resources to importlib.metadata in
+#   2020 can be found in the message of the commit that added this line.

Possible meanings of the emoji:

 - @Conan-Kudo is sad about the conclusion, but respects the way it was figured 
out.
 - The way this information is presented is making @Conan-Kudo sad.
 - @Conan-Kudo doesn't agree with the arguments presented in that commit 
message.
 - @Conan-Kudo is sad about current world situation and presented it here by 
accident.

I hope it is the first listed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1195#discussion_r415687829___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: New test suite and various updates and fixes (#1195)

2020-04-27 Thread Miro Hrončok
@hroncok commented on this pull request.



> +
+
+if __name__ == "__main__":
+"""To allow this script to be importable (and its classes/functions
+   reused), actions are performed only when run as a main script."""
+
+parser = argparse.ArgumentParser(prog=argv[0])
+group = parser.add_mutually_exclusive_group(required=True)
+group.add_argument('-P', '--provides', action='store_true', help='Print 
Provides')
+group.add_argument('-R', '--requires', action='store_true', help='Print 
Requires')
+group.add_argument('-r', '--recommends', action='store_true', help='Print 
Recommends')
+group.add_argument('-C', '--conflicts', action='store_true', help='Print 
Conflicts')
+group.add_argument('-E', '--extras', action='store_true', help='Print 
Extras')
+group_majorver = parser.add_mutually_exclusive_group()
+group_majorver.add_argument('-M', '--majorver-provides', 
action='store_true', help='Print extra Provides with Python major version only')
+group_majorver.add_argument('--majorver-provides-versions', action='store',

I agree that we don't *need* it. How big difference it is if we *support* it?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1195#discussion_r415685949___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: New test suite and various updates and fixes (#1195)

2020-04-27 Thread Miro Hrončok
Totally fine by me. @torsava @Conan-Kudo @gordonmessmer @ignatenkobrain 
@s-t-e-v-e-n-k WDYT?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1195#issuecomment-619859881___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: New test suite and various updates and fixes (#1195)

2020-04-27 Thread Miro Hrončok
> We talk about upstreaming changes like this, but to me the situation looks 
> pretty much the opposite: this has an active upstream of its own and we're 
> merely syncing it from time to time, which is doing double work for ... I 
> don't know what.

We are happy to maintain this ourselves. The idea was that if this lives here, 
other distros will use it (see the recent contribution by SUSE).

Maybe there might be a compromise by having a separate repo in the 
rpm-software-management namespace?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1195#issuecomment-619841494___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: New test suite and various updates and fixes (#1195)

2020-04-24 Thread Miro Hrončok
@hroncok approved this pull request.

FWIW I've reviewed this before the PR was opened.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1195#pullrequestreview-400271090___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RPM generators errors are ignored (#1183)

2020-04-20 Thread Miro Hrončok
@torsava OK, let's wait for the next unexpected error. But wrapping everything 
in try-except and failing with useful error message is not a bad idea.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1183#issuecomment-616514455___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RPM generators errors are ignored (#1183)

2020-04-20 Thread Miro Hrončok
The almost-backwards-compatible way would be to have a specific exit code that 
should abort the build. E.g. "exit with 66 to abort the build".

Technically, I think it is possible to abort the build by generating an invalid 
dependency, but that is hardly an API.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1183#issuecomment-616513539___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Handle all-zero versions without crashing. (#1184)

2020-04-20 Thread Miro Hrončok
Fedora backport: 
https://src.fedoraproject.org/rpms/python-rpm-generators/pull-request/12

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1184#issuecomment-616505304___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Python dist RPM generators errors are silently ignored (#1183)

2020-04-20 Thread Miro Hrončok
Thanks.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1183#issuecomment-616505628___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Python dist RPM generators errors are silently ignored + 0 version fail (#1183)

2020-04-20 Thread Miro Hrončok
That fixes the particular problem. But the two remaining points still stand:

 - the exception when the conversion fails is not telling anything useful
 - the rpmbuild continues (can we abort the build from a dependency generator?)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1183#issuecomment-616502404___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


  1   2   3   >