From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 12 May 2006 13:59:53 +0300 From: "Kirill A. Shutemov" To: ALT Devel discussion list Message-ID: <20060512105953.GO23131@pc152.sam-solutions.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p6hDAtPN9q+ZnUca" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-OriginalArrivalTime: 12 May 2006 10:59:46.0100 (UTC) FILETIME=[2E2DFF40:01C675B3] Subject: [devel] =?koi8-r?b?79DDydEgLS1sb2NhbCDEzNEgZ2Vhcg==?= X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.7 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 May 2006 10:59:47 -0000 Archived-At: List-Archive: List-Post: --p6hDAtPN9q+ZnUca Content-Type: multipart/mixed; boundary="OwXh6gFRjCd3qPCM" Content-Disposition: inline --OwXh6gFRjCd3qPCM Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable =D0=C1=D4=DE =D7 =C1=D4=D4=C1=DE=C5 --=20 Kirill A. Shutemov Belarus, Minsk E-mail: k.shutemov (AT) sam-solutions.net JID: kas (AT) altlinux.org ICQ: 152302675 >=F0=CF=C4=D3=CB=C1=D6=C9 =D4=C5 =DE=D4=CF =CD=CF=D6=C5=D4 =C2=D9=D4=D8 =D3= firefox'=CF=CD >=D0=CF=D3=CC=C5 =CF=C4=CE=CF=C7=CF =C9=DA =CF=C2=CE=CF=D7=CC=C5=CE=C9=D1 (= dist-upgrade) firefox =D0=C5=D2=C5=D3=D4=C1=CC =DA=C1=D0=D5=D3=CB=C1=D4=D8= =D3=D1, >=D4=CF=DE=CE=C5=C5 =CF=D4=CF=C2=D2=C1=D6=C1=D4=D8 =CF=CB=CE=CF =ED=CF=D6=CE=CF =C5=DD=C5 =D4=CF=DE=CE=C5=C5 =CF=D0=C9=D3=C1=D4=D8 =D0=D2= =CF=C2=CC=C5=CD=D5? -- legion in sisyphus@ --OwXh6gFRjCd3qPCM Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-Option-local-added.txt" Content-Transfer-Encoding: quoted-printable =46rom nobody Mon Sep 17 00:00:00 2001 From: Kirill A. Shutemov Date: Fri, 12 May 2006 13:49:51 +0300 Subject: [PATCH] Option --local added --- gear | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) 4b3aee96f66d2517c28f3109820ab89ef7b314ae diff --git a/gear b/gear index 87b69e9..a53a86d 100755 --- a/gear +++ b/gear @@ -109,6 +109,7 @@ Options: --export-dir=3DDIRNAME write source files to specified directory; -r, --rules=3DFILENAME name of file with rules, default is .$PROG-r= ules; -t, --tree-ish=3DID tree, commit or tag object name; + -l, --local extract archive from local directory, not from= git; -q, --quiet try to be more quiet; -v, --verbose print a message for each action; -V, --version print program version and exit; @@ -124,6 +125,10 @@ tmpdir=3D exit_handler() { local rc=3D$? + if [ -n "$local" ]; then + git-reset --soft HEAD^ + fi + trap - EXIT [ -z "$tmpdir" ] || rm -rf -- "$tmpdir" exit $rc @@ -432,7 +437,6 @@ parse_rules() =20 lineno=3D0 local cmd options - echo >>"$workdir/rules" while read -r cmd options; do lineno=3D"$((lineno+1))" case "$cmd" in @@ -458,7 +462,7 @@ opt_check_dir() printf %s "$value" } =20 -TEMP=3D`getopt -n $PROG -o r:,t:,h,q,v,V -l no-compress,bzip2,gzip,hasher,= rpmbuild,export-dir:,rules:,tree-ish:,help,quiet,verbose,version -- "$@"` || +TEMP=3D`getopt -n $PROG -o r:,t:,l,h,q,v,V -l no-compress,bzip2,gzip,hashe= r,rpmbuild,export-dir:,rules:,tree-ish:,local,help,quiet,verbose,version --= "$@"` || show_usage eval set -- "$TEMP" =20 @@ -468,6 +472,7 @@ outdir=3D rules=3D".$PROG-rules" tar_compress=3D--gzip tree_id=3DHEAD +local=3D while :; do case "$1" in --) shift; break @@ -496,6 +501,8 @@ while :; do ;; -t|--tree-ish) shift; tree_id=3D"$1" ;; + -l|--local) local=3D1 + ;; -h|--help) show_help ;; -q|--quiet) quiet=3D-q @@ -528,6 +535,10 @@ else shift fi =20 +if [ -n "$local" -a "$tree_id" !=3D 'HEAD' ]; then + show_usage 'Options --local is actual only with tree_ish=3DHEAD.' +fi + # Check given tree-ish. type=3D"$(git-cat-file -t "$tree_id")" || fatal "Invalid GIT_DIR ($GIT_DIR) or tree-ish ($tree_id)" @@ -548,6 +559,10 @@ if [ -z "$outdir" ]; then mkdir "$outdir" fi =20 +if [ -n "$local" ]; then + git-commit -a -m 'temporary commit' > /dev/null || { local=3D; info 'N= othing changed. Used last commit'; } +fi + find_specfile =20 parse_rules --=20 1.3.2 --OwXh6gFRjCd3qPCM-- --p6hDAtPN9q+ZnUca Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFEZGqpbWYnhzC5v6oRApb7AJ4uSOpG4IzPV1/Z3fnmKOCN4p1bogCgjgXW hDEY4Wn4roArw8CH1dm7T8Q= =a34c -----END PGP SIGNATURE----- --p6hDAtPN9q+ZnUca--