コミットメタ情報

リビジョン12ba69bbee2f01800fa4bf11b4f36868cb2e6483 (tree)
日時2014-06-10 03:33:24
作者umorigu <umorigu@gmai...>
コミッターumorigu

ログメッセージ

Support Git repository

変更サマリ

差分

--- a/release.sh
+++ b/release.sh
@@ -22,6 +22,9 @@ usage(){
2222 warn " -z|--zip Create *.zip archive"
2323 warn " --move-dist Move *.ini.php => *.ini-dist.php"
2424 warn " --copy-dist Move, and Copy *.ini.php <= *.ini-dist.php"
25+ warn " --git Use git repository"
26+ warn " --repo <repository> Git repository_url"
27+ warn " --name <distname> package_name"
2528 return 1
2629 }
2730
@@ -88,6 +91,9 @@ getopt(){ _arg=noarg
8891 --copy-dist ) echo _copy_dist 1 ;;
8992 --move-dist ) echo _move_dist 1 ;;
9093 -d ) echo _CVSROOT 2 ; _arg="$2" ;;
94+ --git ) echo _git 1 ;;
95+ --repo ) echo _gitrepo 2 ; _arg="$2" ;;
96+ --name ) echo _pkg_name 2 ; _arg="$2" ;;
9197 -* ) warn "Error: Unknown option \"$1\"" ; return 1 ;;
9298 * ) echo OTHER ;;
9399 esac
@@ -114,6 +120,8 @@ while [ $# -gt 0 ] ; do
114120 _help ) usage ;;
115121
116122 _CVSROOT) CVSROOT="$2" ;;
123+ _gitrepo) gitrepo="$2" ;;
124+ _pkg_name) pkg_name="$2" ;;
117125
118126 _* ) eval "_$ch"=on ;;
119127 * ) break 2 ;;
@@ -170,15 +178,19 @@ fi > /dev/null
170178 # Argument check --------------------------------------------
171179
172180 rel="$1"
173-tag="` check_versiontag "$rel" `" || exit 1
174-pkg_dir="${mod}-${rel}"
175181
176-if [ "$__utf8" ] ; then
177- pkg_dir="${pkg_dir}_utf8"
182+if [ "$pkg_name" ] ; then
183+ pkg_dir="$pkg_name"
184+ tag="$rel"
185+else
186+ tag="` check_versiontag "$rel" `" || exit 1
187+ pkg_dir="${mod}-${rel}"
188+ if [ "$__utf8" ] ; then
189+ pkg_dir="${pkg_dir}_utf8"
190+ fi
178191 fi
179192
180193 # Export the module -----------------------------------------
181-
182194 test ! -d "$pkg_dir" || err "There's already a directory: $pkg_dir"
183195
184196 if [ -z "$__checkout" ]
@@ -186,17 +198,28 @@ then cmd="export"
186198 else cmd="checkout"
187199 fi
188200
189-echo cvs -z3 -d "$CVSROOT" -q "$cmd" -r "$tag" -d "$pkg_dir" "$mod"
190- cvs -z3 -d "$CVSROOT" -q "$cmd" -r "$tag" -d "$pkg_dir" "$mod"
201+if [ "$__git" ] ; then
202+ echo git clone --depth 10 --branch "$tag" "$gitrepo" "$pkg_dir"
203+ git clone --depth 10 --branch "$tag" "$gitrepo" "$pkg_dir"
204+else
205+ exit
206+ echo cvs -z3 -d "$CVSROOT" -q "$cmd" -r "$tag" -d "$pkg_dir" "$mod"
207+ cvs -z3 -d "$CVSROOT" -q "$cmd" -r "$tag" -d "$pkg_dir" "$mod"
208+fi
191209
192210 test -d "$pkg_dir" || err "There isn't a directory: $pkg_dir"
193211
194212 # Remove '.cvsignore' if exists -----------------------------
195213 test -z "$__noremove" && {
214+ if [ "$__git" ] ; then
215+ echo rm -rf "$pkg_dir/.git"
216+ rm -rf "$pkg_dir/.git"
217+ fi
196218 echo find "$pkg_dir" -type f -name '.cvsignore' "| xargs rm -f"
197219 find "$pkg_dir" -type f -name '.cvsignore' | xargs rm -f
198220 }
199221
222+
200223 # Conversion ------------------------------------------------
201224
202225 if [ "$__utf8" ] ; then
旧リポジトリブラウザで表示