Skip to content

Commit 3c32727

Browse files
committed
Remove target when copying assets
1 parent 69e46e7 commit 3c32727

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

PBuild/AssetMgr.pm

+3
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,11 @@ sub copy_assets {
245245
my $adir = "$assetdir/".substr($assetid, 0, 2);
246246
die("asset $assetid is gone\n") unless -e "$adir/$assetid";
247247
if ($asset->{'isdir'} && $unpack) {
248+
PBuild::Util::rm_rf("$srcdir/$file");
248249
unpack_obscpio_asset($assetmgr, "$adir/$assetid", $srcdir, $file);
249250
next;
250251
}
252+
unlink($asset->{'isdir'} ? "$srcdir/$file.obscpio" : "$srcdir/$file");
251253
PBuild::Util::cp("$adir/$assetid", $asset->{'isdir'} ? "$srcdir/$file.obscpio" : "$srcdir/$file");
252254
}
253255
if (has_mutable_assets($assetmgr, $p) && update_srcmd5($assetmgr, $p)) {
@@ -269,6 +271,7 @@ sub move_assets {
269271
die("asset $assetid is gone\n") unless -e "$adir/$assetid";
270272
if ($asset->{'isdir'}) {
271273
if ($unpack && ! -d "$adir/$assetid") {
274+
PBuild::Util::rm_rf("$srcdir/$file");
272275
unpack_obscpio_asset($assetmgr, "$adir/$assetid", $srcdir, $file);
273276
next;
274277
}

PBuild/RepoMgr.pm

+3-1
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,12 @@ sub getremoteproductbinaries {
154154
}
155155

156156
#
157-
# Setup the repo/containers directories used for image/container builds
157+
# Setup the repos/containers directories used for image/container builds
158158
#
159159
sub copyimagebinaries {
160160
my ($repos, $bins, $dstdir) = @_;
161+
PBuild::Util::rm_rf("$dstdir/repos");
162+
PBuild::Util::rm_rf("$dstdir/containers");
161163
PBuild::Util::mkdir_p("$dstdir/repos/pbuild/pbuild");
162164
my %provenance;
163165
for my $q (@$bins) {

0 commit comments

Comments
 (0)