From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20640 invoked from network); 11 Apr 2009 21:29:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Apr 2009 21:29:10 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 92051 invoked from network); 11 Apr 2009 21:28:58 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Apr 2009 21:28:58 -0000 Received: (qmail 13268 invoked by alias); 11 Apr 2009 21:28:37 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14032 Received: (qmail 13252 invoked from network); 11 Apr 2009 21:28:36 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 11 Apr 2009 21:28:36 -0000 Received: from pepin.polanet.pl (pepin.quarto.pl [193.34.52.2]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 2689F82D4B6A for ; Sat, 11 Apr 2009 23:28:19 +0200 (CEST) Received: by pepin.polanet.pl (Postfix, from userid 1090) id A4AC0697C2; Sat, 11 Apr 2009 23:28:22 +0200 (CEST) Date: Sat, 11 Apr 2009 23:28:22 +0200 From: Tomasz Pala To: zsh-users@sunsite.dk Subject: rpmbuild and mdadm completion Message-ID: <20090411212822.GA28891@polanet.pl> References: <20080529123042.GA24187@pepin.polanet.pl> <20080623170935.GA7408@pepin.polanet.pl> <20080623185249.GA26138@pepin.polanet.pl> <20080624124700.GA15726@pepin.polanet.pl> <20090411175018.GA20676@polanet.pl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline In-Reply-To: <20090411175018.GA20676@polanet.pl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV 0.92.1/9224/Fri Apr 10 23:49:29 2009 on bifrost X-Virus-Status: Clean --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Hello again, this time two new completions: 1. rpmbuild has been detached from main rpm binary, according to man: LEGACY ISSUES Executing rpmbuild The build modes of rpm are now resident in the /usr/bin/rpmbuild executable. Although legacy compatibility provided by the popt aliases below has been ade- quate, the compatibility is not perfect; hence build mode compatibility through popt aliases is being removed from rpm. Install the rpmbuild package, and see rpmbuild(8) for documentation of all the rpm build modes previously documented here in rpm(8). so the need of separate completion code arises (in fact I missed it for many years now). 2. mdadm is not complete, but I hasn't developed it further since 1,5 month, just got no time for this - maybe someone finishes it sometime, for now it's better than nothing. -- Tomasz Pala --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: attachment; filename=_rpmbuild #compdef rpmbuild local -a cmds b_cmds t_cmds options b_options cmds=(--rebuild --recompile) b_cmds=(-ba -bb -bp -bc -bi -bl -bs) t_cmds=(-ta -tb -tp -tc -ti -tl -ts) options=(--quiet -v -vv --verbose --rcfile --pipe --dbpath -r --root --buildroot --clean --nobuild --nodeps --nodigest --nosignature --macros --rmsource --rmspec --short-circuit --sign --target -D --define -E --eval --with --without --debug --bcond --install-build-tree) b_options=(--clean --nobuild --nodeps --nodigest --nosignature --rmsource --rmspec --short-circuit --sign --target --debug --with --without) _arguments \ "($cmds $b_cmds $t_cmds)"{-ba,-ta}'[Build binary and source packages]' \ "($cmds $b_cmds $t_cmds)"{-bb,-tb}'[Build a binary package]' \ "($cmds $b_cmds $t_cmds)"{-bp,-tp}'[Execute the "%prep" stage]' \ "($cmds $b_cmds $t_cmds)"{-bc,-tc}'[Do the "%build" stage]' \ "($cmds $b_cmds $t_cmds)"{-bi,-ti}'[Do the "%install" stage]' \ "($cmds $b_cmds $t_cmds)"{-bl,-tl}'[Do a "list check"]' \ "($cmds $b_cmds $t_cmds)"{-bs,-ts}'[Build just the source package]' \ "($cmds $b_cmds $t_cmds * $b_options $options)"{-\?,--help}'[Show help message]' \ "($cmds $b_cmds $t_cmds * $b_options $options)"--querytags'[Display known query tags]' \ "($cmds $b_cmds $t_cmds * $b_options)"--showrc'[Display final rpmrc and macro configuration]' \ "($cmds $b_cmds $t_cmds * $b_options $options)"--usage'[Display brief usage message]' \ "($cmds $b_cmds $t_cmds * $b_options $options)"--version'[Print the version of rpm being used]' \ "(-v --verbose -vv)"--quiet'[Print as little as possible]' \ "(-v --verbose --quiet)"{-v,--verbose}'[Print verbose information]' \ "(-v --verbose --quiet)"-vv'[Print lots of ugly debugging information]' \ --rcfile'[RC files]:RC files:_files -S\:' \ --macros'[Macros files]:Macros files:_files -S\:' \ --pipe'[Command to pipe the output of rpm to]:command' \ --dbpath'[Set database directory]:Database directory:_files -/' \ "(-r --root)"{-r,--root}'[Root file system tree]:Chroot directory:_files -/' \ --buildroot'[Override the BuildRoot]:BuildRoot directory:_files -/' \ --clean'[Remove the build tree after the packages are made]' \ --nobuild'[Do not execute any build stages (for spec testing purposes]' \ --nodeps'[Do not verify build dependencies]' \ --nodigest"[Don't verify package digest(s)]" \ --nosignature"[Don't verify package signature(s)]" \ --rmsource'[Remove the sources after the build]' \ --rmspec'[Remove the spec file after the build]' \ --short-circuit'[Skip straight to specified stage (-bc, -bi or -bb in PLD Linux]' \ --sign'[Embed a GPG signature]' \ --target='[Set target platform]:arch-vendor-os:' \ {'*-D','*--define='}'[Define MACRO with value EXPR]:MACRO EXPR' \ {'*-E','*--eval='}'[Print macro expansion of EXPR]:EXPR' \ '*--with[Enable configure option for build]:option' \ '*--without[Disable configure option for build]:option' \ "($cmds $b_cmds $t_cmds * $b_options)"--bcond'[Find all --with/--without values]' \ --debug'[Build packages with debug information]' \ "($cmds $b_cmds $t_cmds * $b_options)"--install-build-tree'[Make all needed dirs for building binary rpms]' \ "(--clean $b_cmds $t_cmds --rebuild)"--recompile'[Recompile source package]' \ "(--clean $b_cmds $t_cmds --recompile)"--rebuild'[Rebuild source package]' \ "*:file:_files -g '(#i)*.(spec|srpm|tgz|tar|tar.gz|tar.bz2)(-.)'" && ret=0 --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: attachment; filename=_mdadm #compdef mdadm typeset -A opt_args local -a args misc modes _raids_build () { _values -S \ "MD device type" \ 'linear[linear]' \ {0,raid0,stripe}'[striping]' \ {1,raid1,mirror}'[mirroring]' \ {multipath,mp}'[multiple paths to one common physical storage device]' \ 'faulty[injects faults]' } _raids () { _values -S \ "MD device type" \ 'linear[linear]' \ {0,raid0,stripe}'[striping]' \ {1,raid1,mirror}'[mirroring]' \ {4,raid4}'[RAID 4]' \ {5,raid5}'[RAID 5]' \ {6,raid6}'[RAID 6]' \ {10,raid10}'[RAID 1+0]' \ {multipath,mp}'[multiple paths to one common physical storage device]' \ 'faulty[injects faults]' } _layouts () { case ${(v)opt_args[(I)-(l|-level)]} in 5|raid5) _values -S \ "RAID5 parity block layout" \ {left-asymmetric,la}'[left-asymmetric]' \ {left-symmetric,ls}'[left-symmetric]' \ {right-asymmetric,ra}'[right-asymmetric]' \ {right-symmetric,rs}'[right-symmetric]' ;; 10|raid10) _values -s ' ' 'RAID10 layout with number of copies of each datablock' \ 'n1[Near copies]' \ 'n2[Near copies]' \ 'n3[Near copies]' \ 'n4[Near copies]' \ 'n5[Near copies]' \ 'n6[Near copies]' \ 'n7[Near copies]' \ 'n8[Near copies]' \ 'n8[Near copies]' \ 'f1[Far copies]' \ 'f2[Far copies]' \ 'f3[Far copies]' \ 'f4[Far copies]' \ 'f5[Far copies]' \ 'f6[Far copies]' \ 'f7[Far copies]' \ 'f8[Far copies]' \ 'f9[Far copies]' ;; faulty) _values -S \ "Failure mode" \ {write-transient,wt}'[write-transient]' \ {read-transient,rt}'[read-transient]' \ {write-presistent,wp}'[write-presistent]' \ {read-presistent,rp}'[read-presistent]' \ write-all'[write-all]' \ {read-fixable,rf}'[read-fixable]' \ {clear,none}'[remove any pending or periodic failure modes]' \ flush'[clear any persistant faults]' esac } if (( $+words[(r)-(A|-assemble)] )); then args=( '(--bitmap)'--bitmap='[bitmap file to use with the array]::Bitmap file:_files' '(--uuid -u)'{--uuid=,-u}'[UUID of array to assemble]:UUID' '(--super-minor -m)'{--super-minor=,-m}'[minor number to look for in super-block]:Minor number' '(--name -N)'{--name=,-N}'[Array name to look for in super-block]:Array name' '(--config -c)'{--config=,-c}'[config file]::Config file:_files' '(--scan -s)'{--scan,-s}'[scan config file for missing information]' '(--run -R)'{--run,-R}'[Try to start the array even if not enough devices for a full array are present]' '(--force -f)'{--force,-f}'[Assemble the array even if some superblocks appear out-of-date]' '(--update,-U)'{--update=,-U}'[Update superblock]::Update the superblock:(sparc2.2 summaries uuid resync byteorder super-minor)' ) fi if (( $+words[(r)-(B|-build)] )); then args=( '(--bitmap)'--bitmap='[file to store/find bitmap information in]::Bitmap file:_files' '(--chunk -c)'{--chunk=,-c}'[chunk size of kibibytes]:Chunk size' '(--rounding)'--rounding='[rounding factor for linear array (==chunk size)]:Rounding factor' '(--level -l)'{--level=,-l}'[RAID level]::RAID level:_raids_build' '(--raid-devices -n)'{--raid-devices=,-n}'[number of active devices in array]:active devices number' '(--bitmap-chunk)'--bitmap-chunk='[bitmap chunksize in Kilobytes]:Bitmap chunk' '(--delay -d)'{--delay=,-d}'[bitmap update delay in seconds]:Bitmap update delay' ) fi if (( $+words[(r)-(C|-create)] )); then args=( '(--bitmap)'--bitmap='[create a bitmap for the array with the given filename]::Bitmap file:_files' '(--chunk -c)'{--chunk=,-c}'[chunk size of kibibytes]:Chunk size' '(--rounding)'--rounding='[rounding factor for linear array (==chunk size)]:Rounding factor' '(--level -l)'{--level=,-l}'[RAID level]::RAID level:_raids' '(--parity -p --layout)'{--parity=,-p,--layout=}'[RAID5/6/10 parity algorithm, faulty mode]::Layout:_layouts' '(--raid-devices -n)'{--raid-devices=,-n}'[number of active devices in array]:active devices number' '(--spare-devices -x)'{--spare-devices=,-x}'[number of spares (eXtras) devices in initial array]:Spare devices number' '(--size -z)'{--size=,-z}'[size (in K) of each drive in RAID1/4/5/6/10]:Size of each drive' '(--force -f)'{--force,-f}'[honour devices as listed on command line]' '(--run -R)'{--run,-R}'[insist of running the array even if not all devices are present or some look odd]' '(--readonly -o)'{--readonly,-o}'[start the array readonly]' '(--name -N)'{--name=,-N}'[textual name for array - max 32 characters]:Array name' '(--bitmap-chunk)'--bitmap-chunk='[bitmap chunksize in Kilobytes]:Bitmap chunk' '(--delay -d)'{--delay,-d}'[bitmap update delay in seconds]:Bitmap update delay' ) fi if (( $+words[(r)-([DEXQ]|-(detail|examine(|-bitmap)|query))] )); then args=( '(--zero-superblock)'--zero-superblock'[erase the MD superblock from a device]' '(--run -R)'{--run,-R}'[start a partially built array]' '(--stop -S)'{--stop,-S}'[deactivate array, releasing all resources]' '(--readonly -o)'{--readonly,-o}'[mark array as readonly]' '(--readwrite -w)'{--readwrite,-w}'[mark array as readwrite]' '(--test -t)'{--test,-t}'[exit status 0 if ok, 1 if degrade, 2 if dead, 4 if missing]' ) fi if (( $+words[(r)-(F|-follow|-monitor)] )); then args=( '(--mail -m)'{--mail=,-m}'[Address to mail alerts of failure to]:::_email_addresses' '(--program -p --alert)'{--program=,-p,--alert=}'[Program to run when an event is detected]::Program:_files' '(--delay -d)'{--delay=,-d}'[seconds of delay between polling state]:seconds' '(--config -c)'{--config=,-c}'[specify a different config file]::Config file:_files' '(--scan -s)'{--scan,-s}'[find mail-address/program in config file]' '(--daemonise -f)'{--daemonise,-f}'[Fork and continue in child, parent exits]' '(--pid-file -i)'{--pid-file=,-i}'[In daemon mode write pid to specified file instead of stdout]::PID file:_files' '(--oneshot -1)'{--oneshot,-1}'[Check for degraded arrays, then exit]' '(--test -t)'{--test,-t}'[Generate a TestMessage event against each array at startup]' ) fi if (( $+words[(r)-(G|-grow)] )); then args=( '(--size -z)'{--size=,-z}'[Change the active size of devices in an array]:active size' '(--raid-disks -n)'{--raid-disks=,-n}'[Change the number of active devices in a RAID1 array]:number of active devices' ) fi _mds () { local -a vals vals=( ${${${(M)${(f)"$(< /etc/mdadm.conf)"}##ARRAY *}//ARRAY /}%%[[:blank:]]*} ) _describe -t mds "RAID devices" vals _arguments \ "(-h --help)"{-h,--help}'[Display a mode specific help message]' } modes=(-A --assemble -B --build -C --create -F --follow --monitor -G --grow -h --help -V --version) misc=(-D --detail -E --examine -X --examine-bitmap -Q --query) _arguments \ "($misc $modes)"{-A,--assemble}'[Assemble a pre-existing array]:::_mds' \ "($misc $modes)"{-B,--build}'[Build a legacy array without superblocks]:::_mds' \ "($misc $modes)"{-C,--create}'[Create a new array]' \ "($misc $modes)"{-F,--follow,--monitor}'[Select Monitor mode]' \ "($misc $modes)"{-G,--grow}'[Change the size or shape of an active array]' \ "($modes -D --detail -E --examine -X --examine-bitmap)"{-D,--detail}'[Print detail of one or more md devices]' \ "($modes -D --detail -E --examine -X --examine-bitmap -Q --query)"{-E,--examine}'[Print content of md superblock on device(s)]' \ "($modes -Q --query)"{-Q,--query}'[Examine a device]' \ "($modes -E --examine -X --examine-bitmap)"{-X,--examine-bitmap}'[Report information about a bitmap file]' \ "(-)"{-h,--help}'[Display general help message]' \ "(-)"{-V,--version}'[Print version information for mdadm]' \ "$args[@]" --2oS5YaxWCcQjTEyO--