openSUSE / osc

The Command Line Interface to work with an Open Build Service
http://openbuildservice.org/
GNU General Public License v2.0
170 stars 185 forks source link

osc up broken #1651

Closed bmwiedemann closed 3 weeks ago

bmwiedemann commented 3 weeks ago

Describe the bug osc up fails because a .osc/sources file already exists.

Versions

To Reproduce Steps to reproduce the behavior:

  1. Run command (using old osc) osc co openSUSE:Factory/color-filesystem
  2. Run command (using new osc) cd openSUSE:Factory/color-filesystem && osc up
  3. See error

Expected behavior Packages that contain a sources file should be able to update.

Screenshots, console outputs

# osc st
Traceback (most recent call last):
  File "/usr/bin/osc", line 11, in <module>
    load_entry_point('osc==1.9.2', 'console_scripts', 'osc')()
  File "/usr/lib/python3.6/site-packages/osc/babysitter.py", line 227, in main
    sys.exit(run(commandline.OscMainCommand()))
  File "/usr/lib/python3.6/site-packages/osc/babysitter.py", line 70, in run
    prg.main(argv)
  File "/usr/lib/python3.6/site-packages/osc/commandline.py", line 565, in main
    exit_code = cmd.run(args)  
  File "/usr/lib/python3.6/site-packages/osc/commandline.py", line 248, in run
    self.post_parse_args(args)
  File "/usr/lib/python3.6/site-packages/osc/commandline.py", line 425, in post_parse_args
    args.apiurl = osc_store.Store(Path.cwd()).apiurl
  File "/usr/lib/python3.6/site-packages/osc/obs_scm/store.py", line 47, in __init__
    check_store_version(self.abspath)
  File "/usr/lib/python3.6/site-packages/osc/obs_scm/store.py", line 408, in check_store_version
    os.makedirs(sources_dir, exist_ok=True)
  File "/usr/lib64/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
FileExistsError: [Errno 17] File exists: '/space/osc/openSUSE:Factory/color-filesystem/.osc/sources'

Additional context This issue was found while working on reproducible builds for openSUSE.