From f7cbcc781211e0717306d6da24420c4c1aa0d24a Mon Sep 17 00:00:00 2001 From: mpl Date: Thu, 21 Sep 2017 16:25:16 +0200 Subject: [PATCH] app/publisher/js/zsearch.go: do not track in git If we keep app/publisher/js/zsearch.go, when running make.go, it first gets mirrored into CAMLI_ROOT/tmp/build-gopath-nosqlite/src/camlistore.org/app/publisher/js/zsearch.go , with the same modtime as app/publisher/js/zsearch.go. Then in genSearchTypes, CAMLI_ROOT/tmp/build-gopath-nosqlite/src/camlistore.org/app/publisher/js/zsearch.go gets regenerated anyway, because its modtime is older than that of CAMLI_ROOT/tmp/build-gopath-nosqlite/src/camlistore.org/pkg/search/describe.go Then in a subsequent run of make.go, the mirroring overwrites the newly regenerated file, because its modtime is different (indeed, it is newer) than that of app/publisher/js/zsearch.go And the cycle repeats ad vitam eternam. I think if we added app/publisher/js/zsearch.go to mirrorIgnored, it might fix the problem, but I don't see the point in even keeping zearch.go in git at all, so I propose with this CL to simply remove it. If removed, it is simply generated at the first make.go run, and never again afterwards (except if pkg/search/describe.go changes). Fixes #957 Change-Id: Ia6fcc50ce33513a2003809783fc323ab36a60b52 --- app/publisher/js/zsearch.go | 83 ------------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 app/publisher/js/zsearch.go diff --git a/app/publisher/js/zsearch.go b/app/publisher/js/zsearch.go deleted file mode 100644 index 7d3d592a0..000000000 --- a/app/publisher/js/zsearch.go +++ /dev/null @@ -1,83 +0,0 @@ -// generated by gensearchtypes.go; DO NOT EDIT - -/* -Copyright 2016 The Camlistore Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "net/url" - "time" - - "camlistore.org/pkg/blob" - "camlistore.org/pkg/types/camtypes" -) - -// Duplicating the search pkg types in here - since we only use them for json -// decoding - , instead of importing them through the search package, which would -// bring in more dependencies, and hence a larger js file. -// To give an idea, the generated publisher.js is ~3.5MB, whereas if we instead import -// camlistore.org/pkg/search to use its types instead of the ones below, we grow to -// ~5.7MB. - -type SearchResult struct { - Blobs []*SearchResultBlob `json:"blobs"` - Describe *DescribeResponse `json:"description"` - - // Continue optionally specifies the continuation token to to - // continue fetching results in this result set, if interrupted - // by a Limit. - Continue string `json:"continue,omitempty"` -} - -type SearchResultBlob struct { - Blob blob.Ref `json:"blob"` -} - -type DescribeResponse struct { - Meta MetaMap `json:"meta"` -} - -type MetaMap map[string]*DescribedBlob - -type DescribedBlob struct { - BlobRef blob.Ref `json:"blobRef"` - CamliType string `json:"camliType,omitempty"` - Size int64 `json:"size,"` - - // if camliType "permanode" - Permanode *DescribedPermanode `json:"permanode,omitempty"` - - // if camliType "file" - File *camtypes.FileInfo `json:"file,omitempty"` - // if camliType "directory" - Dir *camtypes.FileInfo `json:"dir,omitempty"` - // if camliType "file", and File.IsImage() - Image *camtypes.ImageInfo `json:"image,omitempty"` - // if camliType "file" and media file - MediaTags map[string]string `json:"mediaTags,omitempty"` - - // if camliType "directory" - DirChildren []blob.Ref `json:"dirChildren,omitempty"` - - // Stub is set if this is not loaded, but referenced. - Stub bool `json:"-"` -} - -type DescribedPermanode struct { - Attr url.Values `json:"attr"` // a map[string][]string - ModTime time.Time `json:"modtime,omitempty"` -}