[pacman-dev] [PATCH 2/2] Add documentation for the prepare() function

Enjolras 0enjolras0 at laposte.net
Sat Jul 28 05:20:11 EDT 2012


I'm a very poor english speaker, don't know if this is ok
---
 doc/PKGBUILD.5.txt |  9 +++++++++
 doc/makepkg.8.txt  | 14 +++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt
index 404a55c..46c6cd9 100644
--- a/doc/PKGBUILD.5.txt
+++ b/doc/PKGBUILD.5.txt
@@ -296,6 +296,15 @@ If you create any variables of your own in the build function, it is
 recommended to use the bash `local` keyword to scope the variable to inside
 the build function.
 
+prepare() Function
+------------------
+An optional prepare() function can be specified in addition to the build()
+function. This function is useful for operations which should only be run 
+once on the sources. This function is run after the source extraction and 
+before the build() function, but is not run if the sources are not extracted.
+The function is run in `bash -e` mode, meaning any command that exits with a
+non zero status will cause the function to exit.
+
 check() Function
 ----------------
 An optional check() function can be specified in which a packages test-suite
diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt
index 27875a3..1b2421d 100644
--- a/doc/makepkg.8.txt
+++ b/doc/makepkg.8.txt
@@ -60,10 +60,10 @@ Options
 
 *-e, \--noextract*::
 	Do not extract source files; use whatever source already exists in the
-	src/ directory. This is handy if you want to go into src/ and manually
-	patch or tweak code, then make a package out of the result. Keep in mind
-	that creating a patch may be a better solution to allow others to use
-	your PKGBUILD.
+	src/ directory. Do not run the prepare() function. This is handy if you 
+	want to go into src/ and manually patch or tweak code, then make a 
+	package out of the result. Keep in mind that creating a patch may be 
+	a better solution to allow others to use your PKGBUILD.
 
 *-f, \--force*::
 	makepkg will not build a package if a built package already exists in
@@ -116,9 +116,9 @@ Options
 	Disable color in output messages.
 
 *-o, \--nobuild*::
-	Download and extract files only, but do not build them. Useful with the
-	'\--noextract' option if you wish to tweak the files in src/ before
-	building.
+	Download and extract files, run the prepare() function, but do not build 
+	them. Useful with the '\--noextract' option if you wish to tweak the files 
+	in src/ before building.
 
 *-p* <buildscript>::
 	Read the package script `buildscript` instead of the `PKGBUILD` default;
-- 
1.7.11.3



More information about the pacman-dev mailing list