collision with debian dir on build-source - FileExistsError: [Errno 17] File exists: 'debian'

Bug #1734657 reported by Christian Ehrhardt  on 2017-11-27
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
usd-importer
High
Nish Aravamudan

Bug Description

Hi,
today it seems I ran into a special case of a conflicting debian dir.

Repro via:
$ git ubuntu clone heartbeat

# note this is currently at 1:3.0.6-6 but I went one version back and had the same
On a subsequent build I get:

$ git ubuntu build-source --verbose --sign
11/27/2017 11:27:59 - DEBUG:Executing: git config gitubuntu.lpuser
11/27/2017 11:27:59 - DEBUG:Executing: grep -q "* -ident" /tmp/heartbeat/.git/info/attributes
11/27/2017 11:27:59 - DEBUG:Executing: grep -q "* -text" /tmp/heartbeat/.git/info/attributes
11/27/2017 11:27:59 - DEBUG:Executing: grep -q "* -eol" /tmp/heartbeat/.git/info/attributes
11/27/2017 11:27:59 - DEBUG:Executing: git config gitubuntu.lpuser
11/27/2017 11:27:59 - DEBUG:Executing: sh -c "dpkg-parsechangelog -l- -n1 -SVersion"
11/27/2017 11:28:00 - DEBUG:Executing: git status --porcelain
11/27/2017 11:28:00 - DEBUG:Executing: sh -c "dpkg-parsechangelog -l- -n1 -SVersion"
11/27/2017 11:28:00 - DEBUG:Executing: sh -c "dpkg-parsechangelog -l- -n1 -o1 -SVersion"
11/27/2017 11:28:00 - DEBUG:Executing: sh -c "dpkg-parsechangelog -l- -SSource"
11/27/2017 11:28:00 - DEBUG:Executing: git worktree add --detach --force /tmp/tmpaa2ghod9 HEAD
11/27/2017 11:28:00 - DEBUG:Executing: dpkg-source --print-format .
11/27/2017 11:28:00 - DEBUG:Executing: git worktree prune
11/27/2017 11:28:00 - DEBUG:Executing: git worktree add --detach --force /tmp/tmpthhzn4e0 abb8cda291a70642c09b253c139e8bbdaa8b780c
11/27/2017 11:28:00 - DEBUG:Executing: dpkg-source --print-format .
11/27/2017 11:28:00 - DEBUG:Executing: git worktree prune
11/27/2017 11:28:00 - DEBUG:Executing: tar -x --strip-components=1 -f /tmp/tmpkk3u6o0k/heartbeat_3.0.6.orig.tar.bz2
Traceback (most recent call last):
  File "/snap/git-ubuntu/338/bin/git-ubuntu", line 11, in <module>
    load_entry_point('gitubuntu==0.6.2', 'console_scripts', 'git-ubuntu')()
  File "/snap/git-ubuntu/338/lib/python3.6/site-packages/gitubuntu/__main__.py", line 243, in main
    sys.exit(args.func(args))
  File "/snap/git-ubuntu/338/lib/python3.6/site-packages/gitubuntu/buildsource.py", line 103, in cli_main
    default_rem_args=default_rem_args,
  File "/snap/git-ubuntu/338/lib/python3.6/site-packages/gitubuntu/build.py", line 701, in cli_main
    retry_backoffs=args.retry_backoffs,
  File "/snap/git-ubuntu/338/lib/python3.6/site-packages/gitubuntu/build.py", line 487, in main
    retry_backoffs,
  File "/snap/git-ubuntu/338/lib/python3.6/site-packages/gitubuntu/build.py", line 1231, in fetch_orig_and_build
    retry_backoffs,
  File "/snap/git-ubuntu/338/lib/python3.6/site-packages/gitubuntu/build.py", line 777, in do_build
    tree_hash = repo.quiltify_and_changelogify_tree_hash(commitish)
  File "/snap/git-ubuntu/338/lib/python3.6/site-packages/gitubuntu/git_repository.py", line 2251, in quiltify_and_changelogify_tree_hash
    quiltify_tree_hash = self._maybe_quiltify_tree_hash(commit_hash)
  File "/snap/git-ubuntu/338/lib/python3.6/site-packages/gitubuntu/git_repository.py", line 2028, in _maybe_quiltify_tree_hash
    'debian',
  File "/snap/git-ubuntu/338/usr/lib/python3.6/shutil.py", line 315, in copytree
    os.makedirs(dst)
  File "/snap/git-ubuntu/338/usr/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
FileExistsError: [Errno 17] File exists: 'debian'

Maybe the reason in this case is that the main orig tarball already has a debian Dir?

$ tar -tf heartbeat_3.0.6.orig.tar.bz2 | grep debian
Heartbeat-3-0-958e11be8686/debian/Makefile.am
Heartbeat-3-0-958e11be8686/debian/changelog
Heartbeat-3-0-958e11be8686/debian/clean
Heartbeat-3-0-958e11be8686/debian/compat
Heartbeat-3-0-958e11be8686/debian/control
Heartbeat-3-0-958e11be8686/debian/copyright
Heartbeat-3-0-958e11be8686/debian/heartbeat-dev.dirs
Heartbeat-3-0-958e11be8686/debian/heartbeat-dev.install
Heartbeat-3-0-958e11be8686/debian/heartbeat.dirs
Heartbeat-3-0-958e11be8686/debian/heartbeat.install
Heartbeat-3-0-958e11be8686/debian/heartbeat.postinst
Heartbeat-3-0-958e11be8686/debian/heartbeat.postrm
Heartbeat-3-0-958e11be8686/debian/heartbeat.preinst
Heartbeat-3-0-958e11be8686/debian/libheartbeat2-dev.install
Heartbeat-3-0-958e11be8686/debian/libheartbeat2.install
Heartbeat-3-0-958e11be8686/debian/libheartbeat2.lintian-overrides
Heartbeat-3-0-958e11be8686/debian/patches/01_docbook_path.dpatch
Heartbeat-3-0-958e11be8686/debian/patches/libtoolize_check.patch
Heartbeat-3-0-958e11be8686/debian/patches/series
Heartbeat-3-0-958e11be8686/debian/rules
Heartbeat-3-0-958e11be8686/debian/source/format

$ tar -tf heartbeat_3.0.6-6.debian.tar.xz | grep debian
debian/
debian/Makefile.am
debian/changelog
debian/clean
debian/compat
debian/control
debian/copyright
debian/heartbeat-dev.dirs
debian/heartbeat-dev.install
debian/heartbeat.dirs
debian/heartbeat.install
debian/heartbeat.lintian-overrides
debian/heartbeat.postinst
debian/heartbeat.postrm
debian/heartbeat.preinst
debian/libheartbeat2-dev.install
debian/libheartbeat2.install
debian/libheartbeat2.lintian-overrides
debian/patches/
debian/patches/01_docbook_path.dpatch
debian/patches/drbd.patch
debian/patches/fix-ftbfs-lp1188428.patch
debian/patches/libtoolize_check.patch
debian/patches/portblock.patch
debian/patches/reproducible.patch
debian/patches/series
debian/rules
debian/source/
debian/source/format
debian/tests/
debian/tests/control
debian/tests/heartbeat

Related branches

I could not more details with "--keep-build-env", but since it is reproducible I think the bug is good for you to take a look at.

Changed in usd-importer:
importance: Undecided → High
Robie Basak (racb) wrote :

12:38 <rbasak> cpaelzer: based on the code I think that's a valid bug
12
:39 <rbasak> It needs an rmtree in debian/ if it already exists first
12:39 <rbasak> I can't remember why we aren't using dpkg-source -x already but IIRC there's a good reason

Robie Basak (racb) on 2017-11-28
tags: added: build
Andreas Hasenack (ahasenack) wrote :

ocfs2-tools is also affected

Nish Aravamudan (nacc) wrote :

Also affects ocfs2-tools.

Nish Aravamudan (nacc) on 2018-01-06
Changed in usd-importer:
status: New → In Progress
assignee: nobody → Nish Aravamudan (nacc)
milestone: none → future
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers