Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"FileNotFoundError: [Errno 2] No such file or directory:" when trying to commit metadata.xml only change with new ebuild pending #82

Open
thesamesam opened this issue Aug 12, 2022 · 1 comment

Comments

@thesamesam
Copy link
Member

thesamesam commented Aug 12, 2022

I tried to bump strace by copying the old ebuild to the new one, but decided to update metadata.xml with a new remote-id first. With the new strace-5.19.ebuild sitting locally (but not staged), when trying to commit the new metadata.xml, I get the following backtrace:

$ pkgdev commit
dev-util/strace
  RedundantVersion: version 5.18: slot(0) keywords are overshadowed by version: 5.19
  StableRequest: version 5.18: slot(0) no change in 54 days for unstable keywords: [ ~amd64, ~arm, ~arm64, ~hppa, ~ppc, ~ppc64, ~sparc, ~x86 ]
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.11/pkgdev", line 4, in <module>
    scripts.run(basename(__file__))
  File "/usr/lib/python3.11/site-packages/pkgdev/scripts/__init__.py", line 38, in run
    sys.exit(tool())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/snakeoil/cli/tool.py", line 79, in __call__
    ret = self.main()
          ^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pkgdev/cli.py", line 22, in main
    return super().main()
           ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/snakeoil/cli/tool.py", line 185, in main
    self.handle_exec_exception(e)
  File "/usr/lib/python3.11/site-packages/snakeoil/cli/tool.py", line 170, in main
    exitstatus = func(self.options, self.out, self.err)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pkgdev/scripts/pkgdev_commit.py", line 814, in _commit
    args = determine_msg_args(options, changes)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pkgdev/scripts/pkgdev_commit.py", line 689, in determine_msg_args
    message.append(changes.prefix + changes.summary)
                                    ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/snakeoil/klass.py", line 176, in __get__
    obj = self.function(instance)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pkgdev/scripts/pkgdev_commit.py", line 592, in summary
    return str(MetadataSummary(self._options, self.pkg_changes))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pkgdev/scripts/pkgdev_commit.py", line 246, in __str__
    if s := self.status_funcs[statuses](self):
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pkgdev/scripts/pkgdev_commit.py", line 269, in modify
    old_pkg = self.old_repo.match(atom)[0]
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pkgcore/repository/prototype.py", line 232, in match
    return list(self.itermatch(atom, **kwds))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pkgcore/repository/prototype.py", line 300, in _internal_match
    for pkg in self._internal_gen_candidates(candidates, **kwargs):
  File "/usr/lib/python3.11/site-packages/pkgcore/repository/prototype.py", line 297, in _internal_gen_candidates
    yield from sorter(pkg_filter(pkgs))
  File "/usr/lib/python3.11/site-packages/pkgcore/ebuild/repository.py", line 495, in _pkg_filter
    if not pkg.is_supported:
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/snakeoil/klass.py", line 355, in __call__
    return self.getter(obj)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pkgcore/package/base.py", line 97, in dynamic_getattr_dict
    val = functor(self)
          ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pkgcore/ebuild/ebuild_src.py", line 246, in eapi
    i = fileutils.readlines_utf8(ebuild.path)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/snakeoil/_fileutils.py", line 78, in native_readlines
    handle = open(mypath, mode, encoding=encoding)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpgortpowf/dev-util/strace/strace-5.19.ebuild'
$ cat ~/.config/pkgdev/pkgdev.conf
[DEFAULT]
commit.scan = true
commit.signoff = true
push.ask = true
showkw.format = simple

[gentoo]
commit.signoff = true
$ pkgdev --version
pkgdev 0.2.1-4-g98cfd69 -- Tue, 9 Aug 2022 21:59:07 +0100
$ pkgcheck --version
pkgcheck 0.10.13-14-g2a73cc6 -- Tue, 9 Aug 2022 21:57:35 +0100
$ git --version
git version 2.37.2

Steps to reproduce:

  1. Checkout a0902118f3bc304e303f0b059ce769275d906e2f~1 in gentoo.git (it's the commit before the strace-5.19 bump)
  2. cp strace-5.18.ebuild strace-5.19.ebuild && pkgdev manifest
  3. Apply this diff to metadata.xml:
diff --git a/dev-util/strace/metadata.xml b/dev-util/strace/metadata.xml
index cb7988b3fb88..50e8e39652ba 100644
--- a/dev-util/strace/metadata.xml
+++ b/dev-util/strace/metadata.xml
@@ -1,23 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-  <maintainer type="project">
-    <email>base-system@gentoo.org</email>
-    <name>Gentoo Base System</name>
-  </maintainer>
-  <use>
-    <flag name="aio">
-      Enable <pkg>dev-libs/libaio</pkg> support for tracing Asynchronous I/O operations
-    </flag>
-    <flag name="unwind">
-      Enable stack backtraces (-k flag) via <pkg>sys-libs/libunwind</pkg>
-    </flag>
-    <flag name="elfutils">
-      Enable stack backtraces (-k flag) via <pkg>dev-libs/elfutils</pkg>
-    </flag>
-  </use>
-  <upstream>
-    <remote-id type="github">strace/strace</remote-id>
-    <remote-id type="sourceforge">strace</remote-id>
-  </upstream>
+       <maintainer type="project">
+               <email>base-system@gentoo.org</email>
+               <name>Gentoo Base System</name>
+       </maintainer>
+       <use>
+               <flag name="aio">
+                       Enable <pkg>dev-libs/libaio</pkg> support for tracing Asynchronous I/O operations
+               </flag>
+               <flag name="unwind">
+                       Enable stack backtraces (-k flag) via <pkg>sys-libs/libunwind</pkg>
+               </flag>
+               <flag name="elfutils">
+                       Enable stack backtraces (-k flag) via <pkg>dev-libs/elfutils</pkg>
+               </flag>
+       </use>
+       <upstream>
+               <remote-id type="github">strace/strace</remote-id>
+               <remote-id type="gitlab">strace/strace</remote-id>
+               <remote-id type="sourceforge">strace</remote-id>
+       </upstream>
 </pkgmetadata>
  1. git add metadata.xml && pkgdev commit
@tillschaefer
Copy link

I can confirm the issue. I would like to add that modified files are working without an issue, but as soon an untracked file is present the commit fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants