From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 18 Dec 2006 15:44:49 +0200 From: Michael Shigorin To: sisyphus@lists.altlinux.org Message-ID: <20061218134449.GA8115@osdn.org.ua> Mail-Followup-To: sisyphus@lists.altlinux.org, Vitaly Lipatov References: <20061216191823.GU13823@osdn.org.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="b5gNqxB1S1yM7hjW" Content-Disposition: inline In-Reply-To: <20061216191823.GU13823@osdn.org.ua> User-Agent: Mutt/1.4.2.1i Cc: Vitaly Lipatov Subject: Re: [sisyphus] macro abuse cleanup script X-BeenThere: sisyphus@lists.altlinux.org X-Mailman-Version: 2.1.9rc1 Precedence: list Reply-To: shigorin@gmail.com, ALT Linux Sisyphus discussion list List-Id: ALT Linux Sisyphus discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2006 13:45:08 -0000 Archived-At: List-Archive: List-Post: --b5gNqxB1S1yM7hjW Content-Type: multipart/mixed; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 16, 2006 at 09:18:23PM +0200, I wrote: > =F0=D2=C9=CC=C1=C7=C1=C0 =D3=CB=D2=C9=D0=D4=C9=CB =C4=CC=D1 =DA=C1=DE=C9= =D3=D4=CB=C9 =D3=D0=C5=CB=CF=D7 (=C4=C1, =C4=C1, =D1 =C5=C7=CF =D4=CF=CC=D8= =CB=CF > =D3=C5=CA=DE=C1=D3 =CE=C1=D0=C9=D3=C1=CC =CE=C1 =CF=D3=CE=CF=D7=C5 /var/l= ib/rpm/macros, =C1 =D4=C1=CB =D7=D3=A3 =CC=C1=D0=C1=CD=C9). =F0=CF=CD=C5=CE=D1=CC =D0=CF=D2=D1=C4=CF=CB =D0=D2=CF=C8=CF=C4=C1 %__mkdir = =C9 %__mkdir_p (=CE=C5 =DA=C1=CD=C5=D4=C9=CC) =C9 =D0=CF =D0=D2=C5=C4=CC=CF=D6=C5=CE=C9=C0 wrar@ %__subst =D4=C5=D0=C5=D2= =D8 =CD=C5=CE=D1=C5=D4 =CE=C1 sed -i, =CB=CF=D4=CF=D2=D9=CA =C9=CD=C5=C5=D4 =C2=CF=CC=C5=C5 =DB=C9=D2=CF=CB=CF=C5= =C8=CF=D6=C4=C5=CE=C9=C5 =D0=CF =C4=C9=D3=D4=D2=C9=C2=D5=D4=C9=D7=C1=CD. --=20 ---- WBR, Michael Shigorin ------ Linux.Kiev http://www.linux.kiev.ua/ --G4iJoqBmSsgzjUCe Content-Type: application/x-sh Content-Disposition: attachment; filename="un__.sh" Content-Transfer-Encoding: quoted-printable #!/bin/sh=0A# a script to clean up RPM %__macro abuse =0A# (those are actua= lly rpm's _internal_ macros, =0A# not intended for direct usage in specs an= d=0A# in fact cluttering them up without any bonus)=0A# 2006 by Michael Shi= gorin =0A# use freely=0A=0Afatal()=0A{=0A echo "$0: $*" = >&2=0A exit 1=0A}=0A=0A[ -s "$1" ] || fatal "gimme a spec!"=0A=0Agrep -q '^= [^#]*%__' "$1" || exit 2=0A=0ATMPSPEC=3D`mktemp $1.XXXXXX` || fatal "unable= to create temporary file"=0A=0Ased \=0A -e 's@%__awk@gawk@g' \=0A -e 's@%_= _bzip2@bzip2@g' \=0A -e 's@%__cat@cat@g' \=0A -e 's@%__chgrp@chgrp@g' \=0A = -e 's@%__chmod@chmod@g' \=0A -e 's@%__chown@chown@g' \=0A -e 's@%__cp@cp@g'= \=0A -e 's@%__cpio@cpio@g' \=0A -e 's@%__file@file@g' \=0A -e 's@%__gpg@gp= g@g' \=0A -e 's@%__grep@grep@g' \=0A -e 's@%__gzip@gzip@g' \=0A -e 's@%__id= @id@g' \=0A -e 's@%__install@install@g' \=0A -e 's@%__install_info@install-= info@g' \=0A -e 's@%__ln_s@ln -s@g' \=0A -e 's@%__make@make@g' \=0A -e 's@%= __mkdir_p@mkdir -p@g' \=0A -e 's@%__mkdir@mkdir@g' \=0A -e 's@%__mv@mv@g' \= =0A -e 's@%__patch@patch@g' \=0A -e 's@%__perl@perl@g' \=0A -e 's@%__pgp@pg= p@g' \=0A -e 's@%__python@python@g' \=0A -e 's@%__rm@rm@g' \=0A -e 's@%__rs= h@rsh@g' \=0A -e 's@%__sed@sed@g' \=0A -e 's@%__ssh@ssh@g' \=0A -e 's@%__su= bst@sed -i@g' \=0A -e 's@%__tar@tar@g' \=0A -e 's@%__unzip@unzip@g' \=0A -e= 's@%__ar@ar@g' \=0A -e 's@%__as@as@g' \=0A -e 's@%__cc@gcc@g' \=0A -e 's@%= __cpp@gcc -E@g' \=0A -e 's@%__cxx@g++@g' \=0A -e 's@%__ld@ld@g' \=0A -e 's@= %__nm@nm@g' \=0A -e 's@%__objcopy@objcopy@g' \=0A -e 's@%__objdump@objdump@= g' \=0A -e 's@%__ranlib@ranlib@g' \=0A -e 's@%__strip@strip@g' \=0A -e 's@%= __libtoolize@libtoolize@g' \=0A -e 's@%__aclocal@aclocal@g' \=0A -e 's@%__a= utoheader@autoheader@g' \=0A -e 's@%__automake@automake@g' \=0A -e 's@%__au= toconf@autoconf@g' \=0A < "$1" > "$TMPSPEC" \=0A&& add_changelog -e '- spec= macro abuse cleanup' "$TMPSPEC"=0Aecho "please inspect $TMPSPEC for cleane= d up version" =0A=0A# changelog=0A# 2006-12-16: initial release=0A# 2006-12= -18: minor fixes:=0A# + %__mkdir was replaced before %__mkdir_p= =0A# + %__subst is now replaced with sed -i (tnx wrar@)=0A --G4iJoqBmSsgzjUCe-- --b5gNqxB1S1yM7hjW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFFhptRbsPDprYMm3IRAjzSAJ9SnOf8iCbvQUm8cxnhE8DzJtWjgQCgvSw9 hyCLDj60G6SvQdGOsqnmKhE= =hGAB -----END PGP SIGNATURE----- --b5gNqxB1S1yM7hjW--