aboutsummaryrefslogtreecommitdiff
path: root/bundles
diff options
context:
space:
mode:
authorPaul Sokolovsky <paul.sokolovsky@linaro.org>2013-11-11 21:28:41 +0200
committerPaul Sokolovsky <paul.sokolovsky@linaro.org>2013-11-11 21:45:41 +0200
commit98a2b14067012d0fc4463b6834ef7a850de4fd26 (patch)
tree9a88ce60d0cb17b73c18382d5cbb6f7849977274 /bundles
parenta607145259ef8313b1b0cf7e6a17142a125017da (diff)
create-bundle: Support (dynamic) per-host configuration, and dry-run mode.
Use different configs for android.git vs staging.git .
Diffstat (limited to 'bundles')
-rwxr-xr-xbundles/create-bundle34
1 files changed, 25 insertions, 9 deletions
diff --git a/bundles/create-bundle b/bundles/create-bundle
index d87b11f..ef084fc 100755
--- a/bundles/create-bundle
+++ b/bundles/create-bundle
@@ -14,16 +14,29 @@
# You should have received a copy of the GNU General Public License
# along with Linaro Image Tools. If not, see <http://www.gnu.org/licenses/>.
-# Top-level base of git repo tree, for convenience
+# BASE: Top-level base of git repo tree, for convenience
BASE=/srv/repositories
-# We allow to create bundles only for repos in specific subtree(s), just list
-# them space-saparated in SUBTREES below. For example, to add
+# SUBTREES: We allow to create bundles only for repos in specific subtree(s),
+# just list them space-saparated in SUBTREES below. For example, to add
# `/srv/repositories/foo/bar', just add `$BASE/foo/bar':
# SUBTREE="$BASE/lava $BASE/foo/bar"
-SUBTREES="$BASE/lava"
-# grep pattern of repository paths to exclude
-#EXCLUDE="repo\.git"
-EXCLUDE=""
+# EXCLUDE: grep pattern of repository paths to exclude
+
+HOSTTYPE=$(cat /etc/linaro/hosttype)
+if [ "$HOSTTYPE" = "git-main" ]; then
+ SUBTREES="$BASE/lava"
+elif [ "$HOSTTYPE" = "git-android" ]; then
+ SUBTREES="$BASE"
+ EXCLUDE="repo\.git"
+else
+ echo "Unknown hosttype. Make sure /etc/linaro/hosttype is set up."
+ exit 1
+fi
+
+DRYRUN=0
+if [ "$1" == "--dry-run" ]; then
+ DRYRUN=1
+fi
function create_bundle() {
git bundle create clone.bundle.tmp master 1>/dev/null
@@ -38,7 +51,10 @@ do
echo Skipping $repository
continue
fi
- cd $repository
- create_bundle
+ if [ $DRYRUN -eq 1 ]; then
+ echo $repository
+ else
+ (cd $repository; create_bundle)
+ fi
done
done