"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "go/pkg/removefrom/remove-from-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.

remove-from-netspoc.go  (Netspoc-6.025):remove-from-netspoc.go  (Netspoc-6.026)
skipping to change at line 76 skipping to change at line 76
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program; if !, write to the Free Software Foundation, Inc., with this program; if !, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
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"
"regexp" "regexp"
"strings" "strings"
) )
var validType = map[string]bool{ var validType = map[string]bool{
skipping to change at line 195 skipping to change at line 195
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)
for _, n := range nodes { for _, n := range nodes {
n.Order() n.Order()
} }
copy := printer.File(nodes, source) copy := printer.File(nodes, source)
return fileop.Overwrite(path, copy) return fileop.Overwrite(path, copy)
} }
func readObjects(path string) error { func readObjects(path string) error {
bytes, err := ioutil.ReadFile(path) bytes, err := ioutil.ReadFile(path)
if err != nil { if err != nil {
 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)