Opened 4 years ago

Last modified 10 months ago

#4503 closed defect

ensure_dependencies.py fails for git submodule — at Version 1

Reported by: asmirnov Assignee: asmirnov
Priority: P4 Milestone:
Module: Automation Keywords:
Cc: fhd, sebastian, kvas Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29356341/
https://codereview.adblockplus.org/29370933/

Description

Environment

ensure_dependencies script is used to extract required dependencies from git/mercurial repositories. However it fails for git submodules. Git submodules is widely used to extract dependencies, f.e. https://github.com/4ntoine/Lightning-Browser/blob/dev/.gitmodules. Since we're working on integrating libadblockplus-android into 3rd-party projects it would be good to fix it.

How to reproduce

  1. git submodule add https://github.com/4ntoine/libadblockplus-android.git
  2. cd ./libadblockplus-android
  3. ./ensure_dependencies.py
  4. make sure error is thrown:
    MBA-Anton:libadblockplus-android asmirnov$ ./ensure_dependencies.py 
    INFO: Cloning repository https://github.com/adblockplus/libadblockplus-binaries into ./libadblockplus-android/jni/libadblockplus-binaries
    Traceback (most recent call last):
      File "./ensure_dependencies.py", line 299, in <module>
        resolve_deps(repo)
      File "./ensure_dependencies.py", line 245, in resolve_deps
        ensure_repo(repodir, target, config.get("_root", {}), revisions["_source"])
      File "./ensure_dependencies.py", line 200, in ensure_repo
        repo.ignore(target, parentrepo)
      File "./ensure_dependencies.py", line 105, in ignore
        _ensure_line_exists(exclude_file, module)
      File "./ensure_dependencies.py", line 275, in _ensure_line_exists
        with open(path, 'a+') as f:
    IOError: [Errno 20] Not a directory: './.git/info/exclude'
    

...

Observed behaviour

it's extracted without error

Expected behaviour

extraction error

Change History (1)

comment:1 Changed 4 years ago by asmirnov

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing
Note: See TracTickets for help on using tickets.