forked from Mirror/pmbootstrap
aportgen: shorten hasatrr checks with getattr (MR 2271)
This commit is contained in:
parent
883be0f119
commit
416781d2c2
2 changed files with 2 additions and 2 deletions
|
@ -165,7 +165,7 @@ def get_upstream_aport(args, pkgname, arch=None):
|
||||||
pmb.helpers.git.clone(args, "aports_upstream")
|
pmb.helpers.git.clone(args, "aports_upstream")
|
||||||
aports_upstream_path = args.work + "/cache_git/aports_upstream"
|
aports_upstream_path = args.work + "/cache_git/aports_upstream"
|
||||||
|
|
||||||
if hasattr(args, "fork_alpine_retain_branch") and args.fork_alpine_retain_branch:
|
if getattr(args, "fork_alpine_retain_branch", False):
|
||||||
logging.info("Not changing aports branch as --fork-alpine-retain-branch was "
|
logging.info("Not changing aports branch as --fork-alpine-retain-branch was "
|
||||||
"used.")
|
"used.")
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -937,7 +937,7 @@ def arguments():
|
||||||
setattr(args, "from_argparse", copy.deepcopy(args))
|
setattr(args, "from_argparse", copy.deepcopy(args))
|
||||||
setattr(args.from_argparse, "from_argparse", args.from_argparse)
|
setattr(args.from_argparse, "from_argparse", args.from_argparse)
|
||||||
|
|
||||||
if hasattr(args, "fork_alpine_retain_branch") and args.fork_alpine_retain_branch:
|
if getattr(args, "fork_alpine_retain_branch", False):
|
||||||
# fork_alpine_retain_branch largely matches the behaviour of fork_alpine, so
|
# fork_alpine_retain_branch largely matches the behaviour of fork_alpine, so
|
||||||
# just set fork_alpine here to reduce repetition.
|
# just set fork_alpine here to reduce repetition.
|
||||||
args.fork_alpine = args.fork_alpine_retain_branch
|
args.fork_alpine = args.fork_alpine_retain_branch
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue