From d71797f1826d529d3e109f1e9167f7682f9c848c Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Fri, 20 Jan 2017 15:38:47 +0800 Subject: [PATCH] (*)fixed import path --- build/crosscompile.bash | 74 -------------------- build/travis-build.sh | 145 ---------------------------------------- main.go | 5 +- routers/router.go | 2 +- 4 files changed, 4 insertions(+), 222 deletions(-) delete mode 100644 build/crosscompile.bash delete mode 100755 build/travis-build.sh diff --git a/build/crosscompile.bash b/build/crosscompile.bash deleted file mode 100644 index 8ea767f..0000000 --- a/build/crosscompile.bash +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash -# Copyright 2012 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -# support functions for go cross compilation - -type setopt >/dev/null 2>&1 && setopt shwordsplit -PLATFORMS="darwin/386 darwin/amd64 openbsd/386 openbsd/amd64 netbsd/386 netbsd/amd64 dragonfly/386 dragonfly/amd64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm windows/386 windows/amd64" - -function go-alias { - GOOS=${1%/*} - GOARCH=${1#*/} - eval "function go-${GOOS}-${GOARCH} { ( GOOS=${GOOS} GOARCH=${GOARCH} go \"\$@\" ) }" -} - -function go-crosscompile-build { - GOOS=${1%/*} - GOARCH=${1#*/} - cd $(go env GOROOT)/src ; GOOS=${GOOS} GOARCH=${GOARCH} ./make.bash --no-clean 2>&1 -} - -function go-crosscompile-build-all { - FAILURES="" - for PLATFORM in $PLATFORMS; do - CMD="go-crosscompile-build ${PLATFORM}" - echo "$CMD" - $CMD || FAILURES="$FAILURES $PLATFORM" - done - if [ "$FAILURES" != "" ]; then - echo "*** go-crosscompile-build-all FAILED on $FAILURES ***" - return 1 - fi -} - -function go-all { - FAILURES="" - for PLATFORM in $PLATFORMS; do - GOOS=${PLATFORM%/*} - GOARCH=${PLATFORM#*/} - GOARM=6 - CMD="go-${GOOS}-${GOARCH} $@" - echo "$CMD" - $CMD || FAILURES="$FAILURES $PLATFORM" - done - if [ "$FAILURES" != "" ]; then - echo "*** go-all FAILED on $FAILURES ***" - return 1 - fi -} - -function go-build-all { - FAILURES="" - for PLATFORM in $PLATFORMS; do - GOOS=${PLATFORM%/*} - GOARCH=${PLATFORM#*/} - SRCFILENAME=`echo $@ | sed 's/\.go//'` - CURDIRNAME=${PWD##*/} - OUTPUT=${SRCFILENAME:-$CURDIRNAME} # if no src file given, use current dir name - CMD="go-${GOOS}-${GOARCH} build -o ./prebuilt/$OUTPUT-${GOOS}-${GOARCH} $@" - echo "$CMD" - $CMD || FAILURES="$FAILURES $PLATFORM" - done - if [ "$FAILURES" != "" ]; then - echo "*** go-build-all FAILED on $FAILURES ***" - return 1 - fi -} - -for PLATFORM in $PLATFORMS; do - go-alias $PLATFORM -done - -unset -f go-alias diff --git a/build/travis-build.sh b/build/travis-build.sh deleted file mode 100755 index c4c5743..0000000 --- a/build/travis-build.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash -######################################################################### -# File Name: travis-build.sh -# Author: Fan Yang -# mail: missdeer@dfordsoft.com -# Created Time: 六 1/10 10:30:41 2015 -######################################################################### - -set -e - -SUDO=sudo -GO_VER=go1.7.3 -GO_TAR=${GO_VER}.linux-amd64.tar.gz -GO_URL="https://storage.googleapis.com/golang/${GO_TAR}" - -: ${GITHUB_REPO:="missdeer/ifconfig"} -GITHUB_HOST="github.com" -GITHUB_CLONE="git://${GITHUB_HOST}/${GITHUB_REPO}" -GITHUB_URL="https://${GITHUB_HOST}/${GITHUB_PUSH-${GITHUB_REPO}}" - -# if not set, ignore password -#GIT_ASKPASS="${TRAVIS_BUILD_DIR}/gh_ignore_askpass.sh" - -skip() { - echo "$@" 1>&2 - echo "Exiting..." 1>&2 - exit 0 -} - -abort() { - echo "Error: $@" 1>&2 - echo "Exiting..." 1>&2 - exit 1 -} - -# TRAVIS_BUILD_DIR not set, exiting -[ -d "${TRAVIS_BUILD_DIR-/nonexistent}" ] || \ - abort '${TRAVIS_BUILD_DIR} not set or nonexistent.' - -# check for pull-requests -[ "${TRAVIS_PULL_REQUEST}" = "false" ] || \ - skip "Not running Doxygen for pull-requests." - -# check for branch name -[ "${TRAVIS_BRANCH}" = "master" ] || \ - skip "Running Doxygen only for updates on 'master' branch (current: ${TRAVIS_BRANCH})." - -# check for job number -[ "${TRAVIS_JOB_NUMBER}" = "${TRAVIS_BUILD_NUMBER}.1" ] || \ - skip "Running Doxygen only on first job of build ${TRAVIS_BUILD_NUMBER} (current: ${TRAVIS_JOB_NUMBER})." - -# install doxygen binary distribution -go_install() -{ - wget -O - "${GO_URL}" | \ - tar xz -C ${TMPDIR-/tmp} - export GOROOT=${TMPDIR-/tmp}/go - export PATH=${TMPDIR-/tmp}/go/bin/:$PATH -} - -go_run() -{ - cd "${TRAVIS_BUILD_DIR}"; - GOARCH=amd64 GOOS=linux go build -ldflags="-s" -o prebuild/ifconfig-linux-amd64 - GOARCH=386 GOOS=linux go build -ldflags="-s" -o prebuild/ifconfig-linux-386 - GOARCH=arm GOOS=linux go build -ldflags="-s" -o prebuild/ifconfig-linux-arm - GOARCH=arm64 GOOS=linux go build -ldflags="-s" -o prebuild/ifconfig-linux-arm64 - GOARCH=ppc64 GOOS=linux go build -ldflags="-s" -o prebuild/ifconfig-linux-ppc64 - GOARCH=ppc64le GOOS=linux go build -ldflags="-s" -o prebuild/ifconfig-linux-ppc64le - GOARCH=amd64 GOOS=dragonfly go build -ldflags="-s" -o prebuild/ifconfig-dragonfly-amd64 - GOARCH=amd64 GOOS=freebsd go build -ldflags="-s" -o prebuild/ifconfig-freebsd-amd64 - GOARCH=386 GOOS=freebsd go build -ldflags="-s" -o prebuild/ifconfig-freebsd-amd64 - GOARCH=arm GOOS=freebsd go build -ldflags="-s" -o prebuild/ifconfig-freebsd-amd64 - GOARCH=amd64 GOOS=netbsd go build -ldflags="-s" -o prebuild/ifconfig-netbsd-amd64 - GOARCH=386 GOOS=netbsd go build -ldflags="-s" -o prebuild/ifconfig-netbsd-amd64 - GOARCH=arm GOOS=netbsd go build -ldflags="-s" -o prebuild/ifconfig-netbsd-amd64 - GOARCH=amd64 GOOS=openbsd go build -ldflags="-s" -o prebuild/ifconfig-openbsd-amd64 - GOARCH=386 GOOS=openbsd go build -ldflags="-s" -o prebuild/ifconfig-openbsd-amd64 - GOARCH=arm GOOS=openbsd go build -ldflags="-s" -o prebuild/ifconfig-openbsd-amd64 - GOARCH=amd64 GOOS=darwin go build -o prebuild/ifconfig-darwin-amd64 - GOARCH=386 GOOS=darwin go build -o prebuild/ifconfig-darwin-amd64 - GOARCH=amd64 GOOS=windows go build -o prebuild/ifconfig-windows-amd64 - GOARCH=386 GOOS=windows go build -o prebuild/ifconfig-windows-386 -} - -prebuilt_prepare() -{ - cd "${TRAVIS_BUILD_DIR}"; - git --version - git clone --single-branch -b prebuilt "${GITHUB_CLONE}" prebuilt - cd prebuilt - # setup git config (with defaults) - git config user.name "${GIT_NAME}" - git config user.email "${GIT_EMAIL}" - # clean working dir - rm -f .git/index - git clean -df -} - -prebuilt_commit() { - cd "${TRAVIS_BUILD_DIR}/prebuilt"; - pwd - ls - git add --all; - git add -f ./ifconfig-* - git commit -m "Automatic pre build by travis at $(date)"; -} - -gh_setup_askpass() { - cat > ${GIT_ASKPASS} < ${HOME}/.git-credentials ; \ - chmod go-rw ${HOME}/.git-credentials ) ) - # push to GitHub - git push origin prebuilt -} - -go_install -prebuilt_prepare -go_run -prebuilt_commit -prebuilt_push - diff --git a/main.go b/main.go index 5057908..5c7befb 100644 --- a/main.go +++ b/main.go @@ -1,9 +1,10 @@ package main import ( - "github.com/astaxie/beego" - _ "github.com/missdeer/ifconfig/routers" "os" + + "github.com/astaxie/beego" + _ "github.com/dfordsoft/ifconfig/routers" ) const ( diff --git a/routers/router.go b/routers/router.go index 17646ae..21dd710 100644 --- a/routers/router.go +++ b/routers/router.go @@ -2,7 +2,7 @@ package routers import ( "github.com/astaxie/beego" - "github.com/missdeer/ifconfig/controllers" + "github.com/dfordsoft/ifconfig/controllers" ) func init() {