summaryrefslogtreecommitdiff
blob: 0b2124dee19ee7aa6cbed233d4dd98d5fdd9b1aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Dan Armak <danarmak@gentoo.org>
# $Header: /var/cvsroot/gentoo-x86/eclass/kde-patch.eclass,v 1.2 2002/07/12 15:24:36 danarmak Exp $
# This applies homemade patches from the tarball to the date specified.
ECLASS=kde-patch
INHERITED="$INHERITED $ECLASS"

debug-print "Entering eclass $ECLASS"

# ${PV} comes in the form of x.y.z.YYYYMMDD where x.y.z is the original (unpatched) version
# and YYYYMMDD is the patch's datestamp. The patch lives on a gentoo mirror and is called
# ${PN}-x.y.z-YYYYMMDD.diff. We figure out automagically the two parts of the current $PV.

# I'm not that good at regexps etc., so I emulate std coding practices

OLDIFS="$IFS" # backup so that we don't distort future loops
IFS="."	# separator string that determines the breakup of a string by bash's "for x in; do; done"

for DATE in $PV
do
    # if not last component of separated $PV
    if [ ! "${ORIGPV}.${DATE}" == "${PV}" ]; then
	[ -n "$ORIGPV" ] && ORIGPV="${ORIGPV}.${DATE}" || ORIGPV="$DATE" # don't add a leading dot
    fi
done

IFS="$OLDIFS" #restore

# now $ORIGPV and $DATE should have the right values
debug-print "$ECLASS: ORIGPV=$ORIGPV, DATE=$DATE"

PATCH="${PN}-${ORIGPV}-${DATE}.diff"
SRC_URI="$SRC_URI mirror://gentoo/${PATCH}"

# for the new base_src_unpack functionality
PATCHES="$PATCHES ${DISTDIR}/${PATCH}"

# Set the right Pv for correct handling of the main sources. This is why this eclass
# should be sourced before all others.
PV="$ORIGPV"
[ "$PR" != "r0" ] && PVR="$PN-$PV-$PR" || PVR="$PV"
P="$PN-$PV"