Skip to content

Commit

Permalink
Order the check for len(self.opts)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickysarraf committed Jun 4, 2024
1 parent 6325d7e commit dbcf7db
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions apt_offline_core/AptOfflineCoreLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,17 +723,19 @@ def __init__(self, gpgv=None, keyring=None, Simulate=False):
)
self.opts.extend(["--keyring", eachGPG])

if len(self.opts) == 1:
log.err(
"No valid keyring paths found in: %s\n"
% (", ".join(self.defaultPaths))
)

if keyring:
for eachFile in os.listdir(keyring):
extraKeyringFile = os.path.join(keyring, eachFile)
log.verbose("extraKeyringFile is %s" % extraKeyringFile)
self.opts.extend(["--keyring", extraKeyringFile, "--ignore-time-conflict"])
self.opts.extend(
["--keyring", extraKeyringFile, "--ignore-time-conflict"]
)

if len(self.opts) == 1:
log.err(
"No valid keyring paths found in: %s\n" % (
", ".join(self.defaultPaths))
)

def DearmorSig(self, asciiSig):
gpgCmd = []
Expand Down Expand Up @@ -2216,8 +2218,10 @@ def displayBugs(self, dataType=None):
sys.exit(1)

def verifyAptFileIntegrity(self, FileList):
self.AptSecure = APTVerifySigs(keyring=InstallerInstance.extra_keyring,
Simulate=InstallerInstance.Bool_TestWindows)
self.AptSecure = APTVerifySigs(
keyring=InstallerInstance.extra_keyring,
Simulate=InstallerInstance.Bool_TestWindows,
)

self.lFileList = FileList
self.lFileList.sort()
Expand Down

0 comments on commit dbcf7db

Please sign in to comment.