mirror of
git://git.yoctoproject.org/yocto-autobuilder-helper.git
synced 2025-07-19 20:59:02 +02:00
shared-repo-pack: Move out any existing build directory to the trash delection handler
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
98f101ee93
commit
f92af9cb9a
|
@ -6,6 +6,7 @@
|
||||||
"BUILD_HISTORY_FORKPUSH" : {"poky-contrib:ross/mut" : "poky:master", "poky:master-next" : "poky:master"},
|
"BUILD_HISTORY_FORKPUSH" : {"poky-contrib:ross/mut" : "poky:master", "poky:master-next" : "poky:master"},
|
||||||
|
|
||||||
"REPO_STASH_DIR" : "/home/pokybuild/git/mirror",
|
"REPO_STASH_DIR" : "/home/pokybuild/git/mirror",
|
||||||
|
"TRASH_DIR" : "/home/pokybuild/git/trash",
|
||||||
|
|
||||||
"defaults" : {
|
"defaults" : {
|
||||||
"NEEDREPOS" : ["poky"],
|
"NEEDREPOS" : ["poky"],
|
||||||
|
|
|
@ -29,12 +29,19 @@ scriptsdir = os.path.dirname(os.path.realpath(__file__))
|
||||||
ourconfig = utils.loadconfig(__file__)
|
ourconfig = utils.loadconfig(__file__)
|
||||||
|
|
||||||
stashdir = ourconfig["REPO_STASH_DIR"]
|
stashdir = ourconfig["REPO_STASH_DIR"]
|
||||||
|
trashdir = ourconfig["TRASH_DIR"]
|
||||||
|
|
||||||
needrepos = utils.getconfigvar("NEEDREPOS", ourconfig, target, None)
|
needrepos = utils.getconfigvar("NEEDREPOS", ourconfig, target, None)
|
||||||
|
|
||||||
with open(repojson) as f:
|
with open(repojson) as f:
|
||||||
repos = json.load(f)
|
repos = json.load(f)
|
||||||
|
|
||||||
|
# Move any existing directory to the trash collection directory (deferred ionice deletion)
|
||||||
|
if os.path.exists(targetdir):
|
||||||
|
trashdest = trashdir + "/" + target + "/" + str(int(time.time())) + '-' + str(random.randrange(100, 100000, 2))
|
||||||
|
utils.mkdir(trashdest)
|
||||||
|
subprocess.check_call(['mv', targetdir, trashdest])
|
||||||
|
|
||||||
for repo in sorted(repos.keys()):
|
for repo in sorted(repos.keys()):
|
||||||
if repo not in needrepos:
|
if repo not in needrepos:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue
Block a user