Puller entrance warning

This commit is contained in:
Jakob Borg 2014-08-11 07:52:03 +02:00
parent c7dde9499f
commit a418771c04

View File

@ -2,6 +2,25 @@
// All rights reserved. Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
/*
__ __ _ _
\ \ / /_ _ _ __ _ __ (_)_ __ __ _| |
\ \ /\ / / _` | '__| '_ \| | '_ \ / _` | |
\ V V / (_| | | | | | | | | | | (_| |_|
\_/\_/ \__,_|_| |_| |_|_|_| |_|\__, (_)
|___/
The code in this file is a piece of crap. Don't base anything on it.
Refactorin ongoing in new-puller branch.
__ __ _ _
\ \ / /_ _ _ __ _ __ (_)_ __ __ _| |
\ \ /\ / / _` | '__| '_ \| | '_ \ / _` | |
\ V V / (_| | | | | | | | | | | (_| |_|
\_/\_/ \__,_|_| |_| |_|_|_| |_|\__, (_)
|___/
*/
package model
import (
@ -441,8 +460,8 @@ func (p *puller) handleBlock(b bqBlock) bool {
err = os.MkdirAll(dirName, 0777)
} else {
// We need to make sure the directory is writeable so we can create files in it
if (dirName != p.repoCfg.Directory) {
err = os.Chmod(dirName, 0777)
if dirName != p.repoCfg.Directory {
err = os.Chmod(dirName, 0777)
}
}
if err != nil {
@ -606,8 +625,8 @@ func (p *puller) handleEmptyBlock(b bqBlock) {
// Ensure the file and the directory it is in is writeable so we can remove the file
dirName := filepath.Dir(of.filepath)
os.Chmod(of.filepath, 0666)
if (dirName != p.repoCfg.Directory) {
os.Chmod(dirName, 0777)
if dirName != p.repoCfg.Directory {
os.Chmod(dirName, 0777)
}
if p.versioner != nil {
if debug {