]> git.apps.os.sepia.ceph.com Git - autobuild-ceph.git/commitdiff
reset-modules.sh: deduplicate this boilerplat
authorSage Weil <sage@redhat.com>
Wed, 22 Jun 2016 13:03:57 +0000 (09:03 -0400)
committerSage Weil <sage@redhat.com>
Thu, 23 Jun 2016 19:57:27 +0000 (15:57 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
build-ceph-cmake.sh
build-ceph-deb-native.sh
build-ceph-rpm.sh
build-ceph.sh
reset-modules.sh [new file with mode: 0644]

index 83f72aeb165231c2a5a3a9b8129dccd96d832e9d..afbb98c2f6935579ec6821732243f07c6c11b145 100755 (executable)
@@ -1,23 +1,7 @@
 #!/bin/bash -x
 set -e
 
-git submodule foreach 'git clean -fdx && git reset --hard'
-rm -rf ceph-object-corpus
-rm -rf ceph-erasure-code-corpus
-rm -rf src/gmock
-rm -rf src/leveldb
-rm -rf src/libs3
-rm -rf src/mongoose
-rm -rf src/civetweb
-rm -rf src/rocksdb
-rm -rf src/erasure-code/jerasure/gf-complete
-rm -rf src/erasure-code/jerasure/jerasure
-rm -rf .git/modules/
-git clean -fdx && git reset --hard
-/srv/git/bin/git submodule sync
-/srv/autobuild-ceph/use-mirror.sh
-/srv/git/bin/git submodule update --init --recursive
-git clean -fdx
+. reset-modules.sh
 
 echo --START-IGNORE-WARNINGS
 [ ! -x install-deps.sh ] || ./install-deps.sh
index 67baaa6c526cd0261b5fb79bbc46b551c97d24b7..ee3357f72722f1d5ec6453a5ca349e74883a669d 100755 (executable)
@@ -2,23 +2,8 @@
 set -e
 
 rm -rf out~
-git submodule foreach 'git clean -fdx && git reset --hard'
-rm -rf ceph-object-corpus
-rm -rf ceph-erasure-code-corpus
-rm -rf src/gmock
-rm -rf src/leveldb
-rm -rf src/libs3
-rm -rf src/mongoose
-rm -rf src/civetweb
-rm -rf src/rocksdb
-rm -rf src/erasure-code/jerasure/gf-complete
-rm -rf src/erasure-code/jerasure/jerasure
-rm -rf .git/modules/
-git clean -fdx && git reset --hard
-/srv/git/bin/git submodule sync
-/srv/autobuild-ceph/use-mirror.sh
-/srv/git/bin/git submodule update --init --recursive
-git clean -fdx
+bindir=`dirname $0`
+. $bindir/reset-modules.sh
 
 DIST=`lsb_release -sc`
 
index 6c12fc91ba7fdc51e97ea4bf6c520ce739c44070..6ca9b6f49b4895830efd7c8a0ec039afbc065c72 100755 (executable)
@@ -2,23 +2,8 @@
 set -e
 
 rm -rf rpmbuild
-git submodule foreach 'git clean -fdx && git reset --hard'
-rm -rf ceph-object-corpus
-rm -rf ceph-erasure-code-corpus
-rm -rf src/gmock
-rm -rf src/leveldb
-rm -rf src/libs3
-rm -rf src/mongoose
-rm -rf src/civetweb
-rm -rf src/rocksdb
-rm -rf src/erasure-code/jerasure/gf-complete
-rm -rf src/erasure-code/jerasure/jerasure
-rm -rf .git/modules/
-git clean -fdx && git reset --hard
-/srv/git/bin/git submodule sync
-/srv/autobuild-ceph/use-mirror.sh
-/srv/git/bin/git submodule update --init --recursive
-git clean -fdx
+bindir=`dirname $0`
+. $bindir/reset-modules.sh
 
 DISTS=`cat ../../dists`
 TARGET="$(cat ../../rsync-target)"
index 006a5603aaf58a7522225ffbb014de7aea533013..b13b74d8ee3c6a93aaee9599e19e952e9c9738fd 100755 (executable)
@@ -7,24 +7,8 @@ function print_runtime() {
         printf "Total run time: %d:%02d\n" $((SECONDS / 60 )) $((SECONDS % 60))
 }
 
-git submodule foreach 'git clean -fdx && git reset --hard'
-rm -rf ceph-object-corpus
-rm -rf ceph-erasure-code-corpus
-rm -rf src/gmock
-rm -rf src/leveldb
-rm -rf src/libs3
-rm -rf src/mongoose
-rm -rf src/civetweb
-rm -rf src/rocksdb
-rm -rf src/erasure-code/jerasure/gf-complete
-rm -rf src/erasure-code/jerasure/jerasure
-rm -rf .git/modules/
-git clean -fdx && git reset --hard
-/srv/git/bin/git submodule sync
-/srv/autobuild-ceph/use-mirror.sh
-/srv/git/bin/git submodule update --init
-git clean -fdx
-rm -fr /tmp/*virtualenv*
+bindir=`dirname $0`
+. $bindir/reset-modules.sh
 
 echo --START-IGNORE-WARNINGS
 [ ! -x install-deps.sh ] || ./install-deps.sh
diff --git a/reset-modules.sh b/reset-modules.sh
new file mode 100644 (file)
index 0000000..6331f0b
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash -x
+
+git submodule foreach 'git clean -fdx && git reset --hard'
+rm -rf ceph-object-corpus
+rm -rf ceph-erasure-code-corpus
+rm -rf src/gmock
+rm -rf src/leveldb
+rm -rf src/libs3
+rm -rf src/mongoose
+rm -rf src/civetweb
+rm -rf src/rocksdb
+rm -rf src/erasure-code/jerasure/gf-complete
+rm -rf src/erasure-code/jerasure/jerasure
+rm -rf .git/modules/
+git clean -fdx && git reset --hard
+/srv/git/bin/git submodule sync
+/srv/autobuild-ceph/use-mirror.sh
+/srv/git/bin/git submodule update --init
+git clean -fdx
+rm -fr /tmp/*virtualenv*