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

eopkg exits with error on upgrade when directory gets replaced with file #98

Open
Staudey opened this issue Nov 10, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@Staudey
Copy link
Member

Staudey commented Nov 10, 2024

eopkg can't handle the case when some path in that package that previously referred to a directory refers to a file of the same name in the updated package. On upgrade the following error occurs:

System error. Program terminated.
[Errno 21] Is a directory: <path>

For example:
getsolus/packages#2545

Test case:

  1. Create test package release 1 with this recipe and install it:
name       : test-upgrade
version    : 1
release    : 1
source     :
    - https://sources.getsol.us/README.Solus : 65dcffb5d782abf60609195cc3e00eb55a9f02cb200441f498e4e30c11d1009e
homepage   : PLEASE FILL ME IN
extract    : no
license    : GPL-2.0-or-later # CHECK ME
component  : PLEASE FILL ME IN
summary    : PLEASE FILL ME IN
description: |
    PLEASE FILL ME IN
install    : |
    install -dm00644 $installdir/test
  1. Create test package release 2 with this recipe and (try to) install it:
name       : test-upgrade
version    : 1
release    : 2
source     :
    - https://sources.getsol.us/README.Solus : 65dcffb5d782abf60609195cc3e00eb55a9f02cb200441f498e4e30c11d1009e
homepage   : PLEASE FILL ME IN
extract    : no
license    : GPL-2.0-or-later # CHECK ME
component  : PLEASE FILL ME IN
summary    : PLEASE FILL ME IN
description: |
    PLEASE FILL ME IN
install    : |
    cp $sources/README.Solus ./test
    install -Dm00755 test $installdir/test

(3. Uninstall the package so you don't have any leftover files)

@malfisya malfisya added the enhancement New feature or request label Nov 10, 2024
@ermo
Copy link
Contributor

ermo commented Nov 10, 2024

@Staudey would you mind running this with debug info turned on, so it shows the backtrace for future reference...?

@Staudey
Copy link
Member Author

Staudey commented Nov 10, 2024

λ sudo eopkg it -d test-upgrade-1-2-1-x86_64.eopkg 
DEBUG: InstallDB initialized in 0.00701999664307.
DEBUG: PackageDB initialized in 0.0597290992737.
DEBUG: RepoDB initialized in 0.000324964523315.
DEBUG: HistoryDB initialized in 0.120959043503.
DEBUG: A = ['test-upgrade-1-2-1-x86_64.eopkg']
digraph G {
test_upgrade[ label = "test-upgrade(1,2)" ];


}
Installation order: test-upgrade 
Installing test-upgrade, version 1, release 2
DEBUG: FilesDB /var/lib/eopkg/info/files.db check result:
DEBUG: > file_exists = True
DEBUG: > can_write = True
DEBUG: > db_type = gdbm
DEBUG: > flag = w
DEBUG: > valid_shelve = True
DEBUG: > version = 3
DEBUG: => force_rebuild = False
DEBUG: => needs_rebuild = False
DEBUG: => please_rebuild_manually = None
DEBUG: FilesDB initialized in 0.00040602684021.
DEBUG: InstallDB initialized in 0.00590801239014.
Upgrading to new distribution release
Extracting the files of test-upgrade
 [✓] Syncing filesystems                                                success
System error. Program terminated.
<type 'exceptions.IOError'>: [Errno 21] Is a directory: 'test'
Please use 'eopkg help' for general help.

Traceback:
  File "/usr/bin/eopkg", line 78, in <module>
    cli.run_command()
  File "/usr/lib/python2.7/site-packages/pisi/cli/pisicli.py", line 138, in run_command
    self.command.run()
  File "/usr/lib/python2.7/site-packages/pisi/cli/install.py", line 109, in run
    pisi.api.install(packages, ctx.get_option('reinstall') or reinstall)
  File "/usr/lib/python2.7/site-packages/pisi/api.py", line 65, in wrapper
    ret = func(*__args,**__kw)
  File "/usr/lib/python2.7/site-packages/pisi/api.py", line 450, in install
    return pisi.operations.install.install_pkg_files(packages, reinstall)
  File "/usr/lib/python2.7/site-packages/pisi/operations/install.py", line 280, in install_pkg_files
    raise e


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

No branches or pull requests

3 participants