mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-12 23:56:13 +01:00
Link only the needed packages and not the packagecachedir for 'osc build config.kiwi' .
This commit is contained in:
parent
9050882b78
commit
95a935b1dc
41
osc/build.py
41
osc/build.py
@ -9,6 +9,7 @@ import os
|
||||
import re
|
||||
import sys
|
||||
from tempfile import NamedTemporaryFile
|
||||
from shutil import rmtree
|
||||
from osc.fetch import *
|
||||
from osc.core import get_buildinfo, store_read_apiurl, store_read_project, store_read_package, meta_exists, quote_plus, get_buildconfig
|
||||
import osc.conf
|
||||
@ -418,8 +419,44 @@ def main(opts, argv):
|
||||
# now update the package cache
|
||||
fetcher.run(bi)
|
||||
|
||||
if build_type == 'kiwi' and not os.path.exists('repos'):
|
||||
os.symlink(config['packagecachedir'], 'repos')
|
||||
# its bad linking the complete packagecache as createrepo will run over _all_
|
||||
# so lets just link the needed packages
|
||||
if build_type == 'kiwi':
|
||||
if not os.path.exists('repos'):
|
||||
os.mkdir('repos')
|
||||
else:
|
||||
rmtree('repos')
|
||||
os.mkdir('repos')
|
||||
for i in bi.deps:
|
||||
# project
|
||||
pdir = str(i.extproject).replace(':/', ':')
|
||||
# repo
|
||||
rdir = str(i.extrepository).replace(':/', ':')
|
||||
# arch
|
||||
adir = i.repoarch
|
||||
# project/repo
|
||||
prdir = "repos/"+pdir+"/"+rdir
|
||||
# project/repo/arch
|
||||
pradir = prdir+"/"+adir
|
||||
# source fullfilename
|
||||
sffn = i.fullfilename
|
||||
print "Using package: "+sffn
|
||||
# target fullfilename
|
||||
tffn = pradir+"/"+sffn.split("/")[-1]
|
||||
if not os.path.exists(os.path.join(pradir)):
|
||||
os.makedirs(os.path.join(pradir))
|
||||
if not os.path.exists(tffn):
|
||||
os.symlink(sffn, tffn)
|
||||
## or - linking complete arch dirs instead of single files
|
||||
#if not os.path.exists(os.path.join(prdir)):
|
||||
# os.makedirs(os.path.join(prdir))
|
||||
## source dir
|
||||
#sdir = config['packagecachedir']+"/"+pdir+"/"+rdir+"/"+adir
|
||||
#if not os.path.exists(pradir):
|
||||
# os.symlink(sdir, pradir)
|
||||
## old
|
||||
#if build_type == 'kiwi' and not os.path.exists('repos'):
|
||||
# os.symlink(config['packagecachedir'], 'repos')
|
||||
|
||||
if bi.pacsuffix == 'rpm':
|
||||
"""don't know how to verify .deb packages. They are verified on install
|
||||
|
Loading…
Reference in New Issue
Block a user