From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14832 invoked by uid 1002); 10 Jun 2003 17:30:39 -0000 Mailing-List: contact gentoo-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Received: (qmail 8020 invoked from network); 10 Jun 2003 17:30:39 -0000 From: Dan Armak Reply-To: danarmak@gentoo.org Organization: Gentoo Technologies, Inc. To: gentoo-dev@gentoo.org Date: Tue, 10 Jun 2003 20:30:23 +0300 User-Agent: KMail/1.5.9 Cc: Seemant Kulleen , Martin Schlemmer MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_3Wh5+M1LzX/4/Bu"; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200306102030.31763.danarmak@gentoo.org> Subject: [gentoo-dev] xpatch() - new patch wrapper, aimed to replace epatch X-Archives-Salt: 3e4ecf59-cc08-486f-9ef5-3bf0e4bcc278 X-Archives-Hash: f3175d78b7987c6581e4e34e1e0c101e --Boundary-02=_3Wh5+M1LzX/4/Bu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Description: signed data Content-Disposition: inline Hello everyone, People using nontrivial calls to epatch(), please test this. Also cc'ing=20 Azarah, the author of epatch(). Please comment. Currently there are two patch helper functions - epatch() from eutils.eclas= s=20 and autopatch in base_src_unpack (inherited by kde.eclass). Each has its ow= n=20 strengths and weaknesses. Briefly, epatch can autodetect the patchlevel (ie -p0, -p1 etc) and handles= =20 directories containing many patches well. However, it runs patch --dry-run= =20 once or more for each patch, and so takes a long time (for big patchsets) t= o=20 determine how to apply a patch. autopatch OTOH doesn't do anything special, but is called automatically fro= m=20 base_src_unpack to patch from the files listed in $PATCHES, which allows us= =20 not to define an src_unpack() in an ebuild just to patch things. This is ve= ry=20 useful in kde ebuilds where we can usually avoid defining any functions at= =20 all. I've written xpatch() to unite the strengths of these two schemes (also add= ing=20 some new stuff) and replace them both. I've committed an initial version in= to=20 eutils.eclass. It accepts as arguments any amount of patchfiles and/or=20 directories which are scanned for patchfiles (non-recursively, to match=20 epatch's behaviour). In the latter case, only patches whose filenames conta= in=20 _$ARCH_ or _all_ are applied, to match the most common epatch() usage. The benefit on the user side of all this is faster patching in ebuilds that= =20 use e/xpatch - two or three times faster, at least in terms of cpu time. I've tested it with simple ebuilds that only need one patch at -p0 or -p1, = and=20 with the xfree ebuild and its patchdir. Just replace any calls to epatch wi= th=20 xpatch. Most/all of the parameters to epatch (via E* variables) aren't need= ed=20 anymore. One further note: xpatch's test are rather fuzzy. Some (highly improbable i= mho=20 ;-) configs might in theory not work with it. However any such problems wou= ld=20 be seen by the developer before committing the ebuild. So I don't want to=20 complicate the function with various special-case checks until someone tell= s=20 me they're needed in real-world cases. Known issues (both of these can be fixed if requested): =2D only supports unified-style diffs (because it parses the patchfiles its= elf a=20 bit). =2D the first file addressed in a patch can't have a space in its name or=20 relative path (because I'm lazy). Current features (a few more planned): =2D patchdir handling like epatch's =2D automatic patchlevel detection like epatch's, but doesn't use --dry-run= so=20 takes almost no time =2D automatic patch uncompression from bzip2, gzip and zip at need. detecti= on of=20 compression is done by calling /usr/bin/file - better than epatch's file=20 extension detection =2D can be called from autopatch to be used automatically from all existing= kde=20 ebuilds that use $PATCHES =2D-=20 Dan Armak Gentoo Linux developer (KDE) Matan, Israel Public GPG key: http://cvs.gentoo.org/~danarmak/danarmak-gpg-public.key --Boundary-02=_3Wh5+M1LzX/4/Bu Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQA+5hW3UI2RQ41fiVERAhROAJ0flLwJOhxlNgVZsp9aZER86YH6rwCghyB9 brlBe6NxqCH8xDp60gT+4ug= =GEad -----END PGP SIGNATURE----- --Boundary-02=_3Wh5+M1LzX/4/Bu--