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"},
|
||||
|
||||
"REPO_STASH_DIR" : "/home/pokybuild/git/mirror",
|
||||
"TRASH_DIR" : "/home/pokybuild/git/trash",
|
||||
|
||||
"defaults" : {
|
||||
"NEEDREPOS" : ["poky"],
|
||||
|
|
|
@ -29,12 +29,19 @@ scriptsdir = os.path.dirname(os.path.realpath(__file__))
|
|||
ourconfig = utils.loadconfig(__file__)
|
||||
|
||||
stashdir = ourconfig["REPO_STASH_DIR"]
|
||||
trashdir = ourconfig["TRASH_DIR"]
|
||||
|
||||
needrepos = utils.getconfigvar("NEEDREPOS", ourconfig, target, None)
|
||||
|
||||
with open(repojson) as 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()):
|
||||
if repo not in needrepos:
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue
Block a user