* [gentoo-dev] RFC patch for obs-service.eclass
@ 2012-02-21 10:18 Michal Hrusecky
2012-02-21 13:34 ` Michał Górny
2012-02-24 10:27 ` Michal Hrusecky
0 siblings, 2 replies; 3+ messages in thread
From: Michal Hrusecky @ 2012-02-21 10:18 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1273 bytes --]
Hi,
any objections against following patch? I guess I'm the only one using
this eclass anyway. So what the patch does. In gentoo we have build
renamed to avoid clashes and moved to the different directory. More and
more services are using parts of the build, so instead of patching all
services, I think it would be better to do it in eclass.
--- obs-service.eclass 16 Sep 2011 15:49:19 -0000 1.1
+++ obs-service.eclass 21 Feb 2012 10:03:43 -0000
@@ -74,6 +74,18 @@
debug-print-function ${FUNCNAME} "$@"
}
+# @FUNCTION: obs-service_src_prepare
+# @DESCRIPTION:
+# Replaces all /usr/lib/build directories with /usr/share/suse-build to reflect
+# where suse-build is installed in Gentoo.
+obs-service_src_prepare() {
+ debug-print-function ${FUNCNAME} "$@"
+ debug-print "Replacing all paths to find suse-build in Gentoo"
+ find . -exec grep -l /usr/lib/build \{\} \; | while read i; do
+ sed -i 's|/usr/lib/build|/usr/share/suse-build|g' "${i}"
+ done
+}
+
# @FUNCTION: obs-service_src_install
# @DESCRIPTION:
# Does the installation of the downloaded files.
@@ -94,4 +106,4 @@
fi
}
-EXPORT_FUNCTIONS src_install src_unpack
+EXPORT_FUNCTIONS src_install src_prepare src_unpack
--
Michal Hrusecky <miska@gentoo.org>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 230 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-dev] RFC patch for obs-service.eclass
2012-02-21 10:18 [gentoo-dev] RFC patch for obs-service.eclass Michal Hrusecky
@ 2012-02-21 13:34 ` Michał Górny
2012-02-24 10:27 ` Michal Hrusecky
1 sibling, 0 replies; 3+ messages in thread
From: Michał Górny @ 2012-02-21 13:34 UTC (permalink / raw
To: gentoo-dev; +Cc: miska
[-- Attachment #1: Type: text/plain, Size: 347 bytes --]
On Tue, 21 Feb 2012 11:18:44 +0100
Michal Hrusecky <miska@gentoo.org> wrote:
> + find . -exec grep -l /usr/lib/build \{\} \; | while read i;
> do
> + sed -i 's|/usr/lib/build|/usr/share/suse-build|g'
> "${i}"
> + done
find -type f \
-exec sed -i 's|/usr/lib/build|/usr/share/suse-build|g' {} +
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-dev] RFC patch for obs-service.eclass
2012-02-21 10:18 [gentoo-dev] RFC patch for obs-service.eclass Michal Hrusecky
2012-02-21 13:34 ` Michał Górny
@ 2012-02-24 10:27 ` Michal Hrusecky
1 sibling, 0 replies; 3+ messages in thread
From: Michal Hrusecky @ 2012-02-24 10:27 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 653 bytes --]
Michal Hrusecky - 11:18 21.02.12 wrote:
> Hi,
>
> any objections against following patch? I guess I'm the only one using
> this eclass anyway. So what the patch does. In gentoo we have build
> renamed to avoid clashes and moved to the different directory. More and
> more services are using parts of the build, so instead of patching all
> services, I think it would be better to do it in eclass.
During last checks before commiting I found an error I overlooked
previously due to some changes elsewhere, so here is the latest patch I
want to commit (also incorporates the feedback I received).
--
Michal Hrusecky <miska@gentoo.org>
[-- Attachment #1.2: obs-service.eclass.patch --]
[-- Type: text/plain, Size: 1929 bytes --]
? obs-service.eclass.patch
Index: obs-service.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/obs-service.eclass,v
retrieving revision 1.1
diff -u -B -r1.1 obs-service.eclass
--- obs-service.eclass 16 Sep 2011 15:49:19 -0000 1.1
+++ obs-service.eclass 24 Feb 2012 10:19:00 -0000
@@ -65,13 +65,25 @@
SRC_URI+=" ${OBS_URI}/${i}"
done
-S="${WORKDIR}"
-
-# @FUNCTION: obs-service_src_configure
+# @FUNCTION: obs-service_src_unpack
# @DESCRIPTION:
# Does nothing. Files are not compressed.
obs-service_src_unpack() {
debug-print-function ${FUNCNAME} "$@"
+ cd "${DISTDIR}"
+ mkdir -p "${S}"
+ cp ${A} "${S}"
+}
+
+# @FUNCTION: obs-service_src_prepare
+# @DESCRIPTION:
+# Replaces all /usr/lib/build directories with /usr/share/suse-build to reflect
+# where suse-build is installed in Gentoo.
+obs-service_src_prepare() {
+ debug-print-function ${FUNCNAME} "$@"
+ debug-print "Replacing all paths to find suse-build in Gentoo"
+ find "${S}" -type f -exec \
+ sed -i 's|/usr/lib/build|/usr/share/suse-build|g' {} +
}
# @FUNCTION: obs-service_src_install
@@ -81,17 +93,17 @@
debug-print-function ${FUNCNAME} "$@"
debug-print "Installing service \"${OBS_SERVICE_NAME}\""
exeinto /usr/lib/obs/service
- doexe "${DISTDIR}"/${OBS_SERVICE_NAME}
+ doexe "${S}"/${OBS_SERVICE_NAME}
insinto /usr/lib/obs/service
- doins "${DISTDIR}"/${OBS_SERVICE_NAME}.service
+ doins "${S}"/${OBS_SERVICE_NAME}.service
if [[ -n ${ADDITIONAL_FILES} ]]; then
debug-print "Installing following additional files:"
debug-print " ${ADDITIONAL_FILES}"
exeinto /usr/lib/obs/service/${OBS_SERVICE_NAME}.files
for i in ${ADDITIONAL_FILES}; do
- doexe "${DISTDIR}"/${i}
+ doexe "${S}"/${i}
done
fi
}
-EXPORT_FUNCTIONS src_install src_unpack
+EXPORT_FUNCTIONS src_install src_prepare src_unpack
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 230 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-24 10:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-21 10:18 [gentoo-dev] RFC patch for obs-service.eclass Michal Hrusecky
2012-02-21 13:34 ` Michał Górny
2012-02-24 10:27 ` Michal Hrusecky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox