Only query precacher repos if one is passed in (#6342)
This commit is contained in:
Родитель
421da173c4
Коммит
ff133d6c92
|
@ -10,6 +10,7 @@ precache_state_dir = $(CACHED_RPMS_DIR)/precache
|
|||
precache_downloaded_files = $(precache_state_dir)/downloaded_files.txt
|
||||
repo_urls_file = $(precache_state_dir)/repo_urls.txt
|
||||
precache_chroot_dir = $(precache_state_dir)/chroot
|
||||
precache_logs_path = $(LOGS_DIR)/precache/precache.log
|
||||
|
||||
$(call create_folder,$(precache_state_dir))
|
||||
$(call create_folder,$(remote_rpms_cache_dir))
|
||||
|
@ -39,7 +40,7 @@ $(STATUS_FLAGS_DIR)/precache.flag: $(go-precacher) $(chroot_worker) $(rpms_snaps
|
|||
$(foreach repofile,$(REPO_LIST), --repo-file "$(repofile)") \
|
||||
--worker-tar $(chroot_worker) \
|
||||
--worker-dir $(precache_chroot_dir) \
|
||||
--log-file=$(SRPM_BUILD_LOGS_DIR)/precacher.log \
|
||||
--log-file=$(precache_logs_path) \
|
||||
--log-level=$(LOG_LEVEL) \
|
||||
--cpu-prof-file=$(PROFILE_DIR)/precacher.cpu.pprof \
|
||||
--mem-prof-file=$(PROFILE_DIR)/precacher.mem.pprof \
|
||||
|
|
|
@ -174,12 +174,16 @@ func getAllRepoData(repoURLs, repoFiles []string, workerTar, buildDir, repoUrlsF
|
|||
}
|
||||
|
||||
var packageRepoUrls []string
|
||||
err = queryChroot.Run(func() (chrootErr error) {
|
||||
packageRepoUrls, chrootErr = getPackageRepoUrlsFromRepoFiles()
|
||||
return chrootErr
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
// Only run repoquery if we have repo files to query. --enablerepo=* will not work if there are no repo files
|
||||
// and will return "Error: Unknown repo: '*'"
|
||||
if len(repoFiles) > 0 {
|
||||
err = queryChroot.Run(func() (chrootErr error) {
|
||||
packageRepoUrls, chrootErr = getPackageRepoUrlsFromRepoFiles()
|
||||
return chrootErr
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
allPackageURLs = append(allPackageURLs, packageRepoUrls...)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче