"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "go/pkg/rename/rename-netspoc.go" between
Netspoc-6.025.tar.gz and Netspoc-6.026.tar.gz

About: NetSPoC is a network security policy compiler (using its own description language) to manage all the packet filter devices inside your network topology.

rename-netspoc.go  (Netspoc-6.025):rename-netspoc.go  (Netspoc-6.026)
package rename package rename
import ( import (
"fmt" "fmt"
"github.com/hknutzen/Netspoc/go/pkg/ast" "github.com/hknutzen/Netspoc/go/pkg/ast"
"github.com/hknutzen/Netspoc/go/pkg/conf" "github.com/hknutzen/Netspoc/go/pkg/conf"
"github.com/hknutzen/Netspoc/go/pkg/diag"
"github.com/hknutzen/Netspoc/go/pkg/fileop" "github.com/hknutzen/Netspoc/go/pkg/fileop"
"github.com/hknutzen/Netspoc/go/pkg/filetree" "github.com/hknutzen/Netspoc/go/pkg/filetree"
"github.com/hknutzen/Netspoc/go/pkg/info"
"github.com/hknutzen/Netspoc/go/pkg/parser" "github.com/hknutzen/Netspoc/go/pkg/parser"
"github.com/hknutzen/Netspoc/go/pkg/printer" "github.com/hknutzen/Netspoc/go/pkg/printer"
"github.com/spf13/pflag" "github.com/spf13/pflag"
"io/ioutil" "io/ioutil"
"os" "os"
"strings" "strings"
) )
var globalType = map[string]bool{ var globalType = map[string]bool{
"router": true, "router": true,
skipping to change at line 269 skipping to change at line 269
path := input.Path path := input.Path
nodes, err := parser.ParseFile(source, path) nodes, err := parser.ParseFile(source, path)
if err != nil { if err != nil {
return err return err
} }
count := processFile(nodes) count := processFile(nodes)
if count == 0 { if count == 0 {
return nil return nil
} }
diag.Info("%d changes in %s", count, path) info.Msg("%d changes in %s", count, path)
copy := printer.File(nodes, source) copy := printer.File(nodes, source)
err = fileop.Overwrite(path, copy) err = fileop.Overwrite(path, copy)
return err return err
} }
func setupPairs(pattern []string) error { func setupPairs(pattern []string) error {
for len(pattern) > 0 { for len(pattern) > 0 {
old := pattern[0] old := pattern[0]
if len(pattern) < 2 { if len(pattern) < 2 {
return fmt.Errorf("Missing replace string for '%s'", old) return fmt.Errorf("Missing replace string for '%s'", old)
 End of changes. 3 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)