Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: cipd/client/cipd/local/deployer.go

Issue 2684133002: [cipd] ignore .cipd/* while extracting. (Closed)
Patch Set: fix nits Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cipd/client/cipd/local/reader.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cipd/client/cipd/local/deployer.go
diff --git a/cipd/client/cipd/local/deployer.go b/cipd/client/cipd/local/deployer.go
index a9499dc7e754bbfb6c0bbb1d0c54a6184a91364a..01ee547bc00bce1ced439b723321438576805caa 100644
--- a/cipd/client/cipd/local/deployer.go
+++ b/cipd/client/cipd/local/deployer.go
@@ -63,6 +63,10 @@ type Deployer interface {
// It unpacks the package into <base>/.cipd/pkgs/*, and rearranges
// symlinks to point to unpacked files. It tries to make it as "atomic" as
// possible. Returns information about the deployed instance.
+ //
+ // Due to a historical bug, if inst contains any files which are intended to
+ // be deployed to `.cipd/*`, they will not be extracted and you'll see
+ // warnings logged.
DeployInstance(ctx context.Context, subdir string, inst PackageInstance) (common.Pin, error)
// CheckDeployed checks whether a given package is deployed at the given
@@ -168,8 +172,18 @@ func (d *deployerImpl) DeployInstance(ctx context.Context, subdir string, inst P
return common.Pin{}, err
}
+ svcDir := SiteServiceDir + "/"
+ filterCipd := func(f File) bool {
+ name := f.Name()
+ if strings.HasPrefix(name, svcDir) {
+ logging.Warningf(ctx, "[non-fatal] ignoring internal file: %s", name)
+ return true
+ }
+ return false
+ }
+
destPath := filepath.Join(pkgPath, pin.InstanceID)
- if err := ExtractInstance(ctx, inst, NewFileSystemDestination(destPath, d.fs)); err != nil {
+ if err := ExtractInstance(ctx, inst, NewFileSystemDestination(destPath, d.fs), filterCipd); err != nil {
return common.Pin{}, err
}
newManifest, err := d.readManifest(ctx, destPath)
« no previous file with comments | « no previous file | cipd/client/cipd/local/reader.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698