mirror of
https://github.com/syncthing/syncthing.git
synced 2025-12-23 22:18:14 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0945304a79 | ||
|
|
9703dd9f57 | ||
|
|
259e9ef08e | ||
|
|
6a0c6128d8 |
11
.github/workflows/release-syncthing.yaml
vendored
11
.github/workflows/release-syncthing.yaml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.ref }} # https://github.com/actions/checkout/issues/882
|
||||
token: ${{ secrets.STRELEASE_GITHUB_TOKEN }}
|
||||
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
run: |
|
||||
go run ./script/relnotes.go --new-ver "$NEXT" --branch "$GITHUB_REF_NAME" --prev-ver "$PREV" > notes.md
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.STRELEASE_GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
|
||||
|
||||
- name: Create and push tag
|
||||
run: |
|
||||
@@ -51,3 +51,10 @@ jobs:
|
||||
git config --global user.email 'release@syncthing.net'
|
||||
git tag -a -F notes.md --cleanup=whitespace "$NEXT"
|
||||
git push origin "$NEXT"
|
||||
|
||||
- name: Trigger the build
|
||||
uses: benc-uk/workflow-dispatch@v1
|
||||
with:
|
||||
workflow: build-syncthing.yaml
|
||||
ref: refs/tags/${{ env.NEXT }}
|
||||
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
|
||||
|
||||
@@ -849,9 +849,13 @@ func unixOwnershipEqual(a, b *UnixData) bool {
|
||||
if a == nil || b == nil {
|
||||
return false
|
||||
}
|
||||
ownerEqual := a.OwnerName == "" || b.OwnerName == "" || a.OwnerName == b.OwnerName
|
||||
groupEqual := a.GroupName == "" || b.GroupName == "" || a.GroupName == b.GroupName
|
||||
return a.UID == b.UID && a.GID == b.GID && ownerEqual && groupEqual
|
||||
if a.UID == b.UID && a.GID == b.GID {
|
||||
return true
|
||||
}
|
||||
if a.OwnerName == b.OwnerName && a.GroupName == b.GroupName {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func windowsOwnershipEqual(a, b *WindowsData) bool {
|
||||
|
||||
@@ -196,6 +196,42 @@ func TestIsEquivalent(t *testing.T) {
|
||||
b: FileInfo{Type: FileInfoTypeFile, SymlinkTarget: []byte("b")},
|
||||
eq: true,
|
||||
},
|
||||
// Unix Ownership should be the same
|
||||
{
|
||||
a: FileInfo{Platform: PlatformData{Unix: &UnixData{OwnerName: "A", GroupName: "A", UID: 1000, GID: 1000}}},
|
||||
b: FileInfo{Platform: PlatformData{Unix: &UnixData{OwnerName: "A", GroupName: "A", UID: 1000, GID: 1000}}},
|
||||
eq: true,
|
||||
},
|
||||
// ... but matching ID is enough
|
||||
{
|
||||
a: FileInfo{Platform: PlatformData{Unix: &UnixData{OwnerName: "A", GroupName: "A", UID: 1000, GID: 1000}}},
|
||||
b: FileInfo{Platform: PlatformData{Unix: &UnixData{OwnerName: "B", GroupName: "B", UID: 1000, GID: 1000}}},
|
||||
eq: true,
|
||||
},
|
||||
// ... or matching name
|
||||
{
|
||||
a: FileInfo{Platform: PlatformData{Unix: &UnixData{OwnerName: "A", GroupName: "A", UID: 1000, GID: 1000}}},
|
||||
b: FileInfo{Platform: PlatformData{Unix: &UnixData{OwnerName: "A", GroupName: "A", UID: 1001, GID: 1001}}},
|
||||
eq: true,
|
||||
},
|
||||
// ... or empty name
|
||||
{
|
||||
a: FileInfo{Platform: PlatformData{Unix: &UnixData{OwnerName: "A", GroupName: "A", UID: 1000, GID: 1000}}},
|
||||
b: FileInfo{Platform: PlatformData{Unix: &UnixData{OwnerName: "", GroupName: "", UID: 1000, GID: 1000}}},
|
||||
eq: true,
|
||||
},
|
||||
// ... but not different ownership
|
||||
{
|
||||
a: FileInfo{Platform: PlatformData{Unix: &UnixData{OwnerName: "A", GroupName: "A", UID: 1000, GID: 1000}}},
|
||||
b: FileInfo{Platform: PlatformData{Unix: &UnixData{OwnerName: "B", GroupName: "B", UID: 1001, GID: 1001}}},
|
||||
eq: false,
|
||||
},
|
||||
// or missing ownership
|
||||
{
|
||||
a: FileInfo{Platform: PlatformData{Unix: &UnixData{OwnerName: "A", GroupName: "A", UID: 1000, GID: 1000}}},
|
||||
b: FileInfo{Platform: PlatformData{}},
|
||||
eq: false,
|
||||
},
|
||||
}
|
||||
|
||||
if build.IsWindows {
|
||||
|
||||
@@ -440,7 +440,7 @@ func (a *aggregator) updateConfig(folderCfg config.FolderConfiguration) {
|
||||
if maxDelay := folderCfg.FSWatcherTimeoutS; maxDelay > 0 {
|
||||
// FSWatcherTimeoutS is set explicitly so use that, but it also
|
||||
// can't be lower than FSWatcherDelayS
|
||||
a.notifyTimeout = time.Duration(max(maxDelay, folderCfg.FSWatcherDelayS)) * time.Second
|
||||
a.notifyTimeout = time.Duration(max(maxDelay, folderCfg.FSWatcherDelayS) * float64(time.Second))
|
||||
} else {
|
||||
// Use the default FSWatcherTimeoutS calculation
|
||||
a.notifyTimeout = notifyTimeout(folderCfg.FSWatcherDelayS)
|
||||
@@ -471,10 +471,10 @@ func notifyTimeout(eventDelayS float64) time.Duration {
|
||||
longDelayTimeout = time.Minute
|
||||
)
|
||||
if eventDelayS < shortDelayS {
|
||||
return time.Duration(eventDelayS*shortDelayMultiplicator) * time.Second
|
||||
return time.Duration(eventDelayS * shortDelayMultiplicator * float64(time.Second))
|
||||
}
|
||||
if eventDelayS < longDelayS {
|
||||
return longDelayTimeout
|
||||
}
|
||||
return time.Duration(eventDelayS) * time.Second
|
||||
return time.Duration(eventDelayS * float64(time.Second))
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ func main() {
|
||||
// We want the next prerelease. We are already on a prerelease. If
|
||||
// it's the correct prerelease compared to the logs we just got, we
|
||||
// should just bump the prerelease counter.
|
||||
if next.LessThan(*latest) {
|
||||
if next.Major == latest.Major && next.Minor == latest.Minor && next.Patch == latest.Patch {
|
||||
parts := latest.PreRelease.Slice()
|
||||
for i, p := range parts {
|
||||
if v, err := strconv.Atoi(p); err == nil {
|
||||
|
||||
Reference in New Issue
Block a user