[Notes] [Git][BuildStream/debsrc2bst][master] 2 commits: Add command-line arg --base-build-depend



Title: GitLab

Agustin Benito Bethencourt pushed to branch master at BuildStream / debsrc2bst

Commits:

2 changed files:

Changes:

  • debsrc2bst.py
    ... ... @@ -25,6 +25,8 @@ if __name__ == "__main__":
    25 25
         parser = argparse.ArgumentParser(description="Generate bst files from a set of repositories")
    
    26 26
         parser.add_argument("-b", "--debian-base", required=True,
    
    27 27
                             help="Element path that all dpkg-build elements use as 'base'")
    
    28
    +    parser.add_argument("--base-build-depend", action="store_true",
    
    29
    +                        help="Whether the 'base' element is of type 'build'. If not, it will be of type 'all'")
    
    28 30
         parser.add_argument("-o", "--output-dir", required=True,
    
    29 31
                             help="Directory to generate output bst files in")
    
    30 32
         parser.add_argument("-p", "--element-prefix", help="Prefix to prepend to all generated element paths")
    
    ... ... @@ -34,7 +36,8 @@ if __name__ == "__main__":
    34 36
             "debian-base": args.debian_base,
    
    35 37
             "output-dir": args.output_dir,
    
    36 38
             "repositories": args.repository,
    
    37
    -        "element-prefix": args.element_prefix or None
    
    39
    +        "element-prefix": args.element_prefix or None,
    
    40
    +        "base-build-depend": args.base_build_depend or None
    
    38 41
         }
    
    39 42
         validate(argdata)
    
    40 43
         generate(argdata)

  • debsrc2bst/generate.py
    ... ... @@ -86,10 +86,12 @@ def calculate_depends(providedata, sourcedata):
    86 86
                 if providedata[d] not in depends:
    
    87 87
                     depends[providedata[d]] = {
    
    88 88
                         "filename": providedata[d],
    
    89
    -                    "type": "run"
    
    89
    +                    "type": "runtime"
    
    90 90
                     }
    
    91
    -            elif depends[providedata[d]]["type"] == "build":
    
    92
    -                depends[providedata[d]]["type"] = "all"
    
    91
    +            elif (type(depends[providedata[d]]) == dict and depends[providedata[d]]["type"] == "build"):
    
    92
    +                # buildstream doesn't read depends of type 'all'
    
    93
    +                # instead, they are defined without type.
    
    94
    +                depends[providedata[d]] = providedata[d]
    
    93 95
             elif d:
    
    94 96
                 unmet_depends.add(d)
    
    95 97
     
    
    ... ... @@ -108,7 +110,11 @@ def calculate_bst_contents(args, sourcedata, providedata):
    108 110
         bst_content['kind'] = "dpkg_build"
    
    109 111
         bst_content['description'] = ("dpkg build based on {}"
    
    110 112
                                       .format(sourcedata["source"]["Source"]))
    
    111
    -    bst_content['depends'] = [args["debian-base"]]
    
    113
    +    if args.get("base-build-depend", False):
    
    114
    +        bst_content['depends'] = [{"filename": args["debian-base"],
    
    115
    +                                 "type": "build"}]
    
    116
    +    else:
    
    117
    +        bst_content['depends'] = [args["debian-base"]]
    
    112 118
         bst_content['depends'] += calculate_depends(providedata, sourcedata)
    
    113 119
     
    
    114 120
         if os.path.exists(os.path.join(sourcedata['repository'], ".git")):
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]