[PATCH] add {installname}
Adriaan de Groot <[email protected]> Sat, 4 Feb 2006 23:47:56 +0100
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
--nextPart1534941.6BFzjLQqT4
Content-Type: multipart/mixed;
boundary="Boundary-01=_c8S5DprL99Ze1GO"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--Boundary-01=_c8S5DprL99Ze1GO
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Attached two patches, one adds {installname} support to installation target=
s,=20
which allows arbitrary renaming of source files on install (it doesn't chec=
k=20
for foolish things like {installname=3D}, I'm not sure it should though). T=
he=20
second patch adds documentation for {installname}, though only to the user=
=20
manual and not the reference.
=2D-=20
These are your friends - Adem
GPG: FEA2 A3FE Adriaan de Groot
--Boundary-01=_c8S5DprL99Ze1GO
Content-Type: text/x-diff;
charset="us-ascii";
name="aap.installfile.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="aap.installfile.diff"
Index: aap/RecPython.py
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=2D-- aap/RecPython.py (revision 233)
+++ aap/RecPython.py (working copy)
@@ -1154,7 +1154,10 @@
elif item.get("keepdir"):
destloc =3D os.path.join(destloc, os.path.dirname(name))
=20
=2D destname =3D os.path.join(destloc, os.path.basename(name))
+ if item.get("installname"):
+ destname =3D os.path.join(destloc, item.get("installname"))
+ else:
+ destname =3D os.path.join(destloc, os.path.basename(name))
scheme, mach, path =3D url_split3(destname)
=20
if uninstall:
--Boundary-01=_c8S5DprL99Ze1GO
Content-Type: text/x-diff;
charset="us-ascii";
name="doc.installfile.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="doc.installfile.diff"
Index: user-install.sgml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/a-a-p/Exec/doc/user-install.sgml,v
retrieving revision 1.16
diff -u -3 -p -r1.16 user-install.sgml
=2D-- user-install.sgml 18 Jan 2004 11:49:21 -0000 1.16
+++ user-install.sgml 4 Feb 2006 22:45:08 -0000
@@ -444,10 +444,93 @@ For instance:
</programlisting>
</para>
=20
+<para>
+For additional flexibility, the source and target <emphasis>filenames</emp=
hasis>
+need not be the same, either. For this you can use the attribute
+{installname} which is similar to {installdir}. If {installname}
+is set, this is used as the filename instead of the name of the source fil=
e,
+thus:
+<programlisting>
+ INSTALL_INCLUDE +=3D api/2.2/c/myheader.h {installname=3Dheader.=
h}
+</programlisting>
+This will install the source file "myheader.h" as "header.h".
+You can combine {installname} with {keepdir} or {installdir}
+to install a source file to an arbitrarily-named destination.
+In summary:
+</para>
+
+<informaltable frame=3D"none">
+ <tgroup cols=3D"2">
+ <colspec colwidth=3D"100"/>
+ <tbody>
+ <row>
+ <entry>(none)</entry>
+ <entry>
+ Source file name is preserved.
+ Path to source file is not preserved,
+ install to target directory determined by &Aap;.
+ The source file "api/2.2/c/myheader.h" is installed as "myheader.h"
+ in the $INCLUDEDIR directory.
+ </entry>
+ </row>
+ <row>
+ <entry>{installname}</entry>
+ <entry>
+ Source file name is not preserved; source file is installed
+ under name given by {installname} attribute.
+ Path to source file is not preserved,
+ install to target directory determined by &Aap;.
+ The source file "api/2.2/c/myheader.h" with attribute {installname=
=3Dheader.h}
+ is installed as "header.h"
+ in the $INCLUDEDIR directory.
+ </entry>
+ </row>
+ <row>
+ <entry>{keepdir}</entry>
+ <entry>
+ Source file name is preserved.
+ Path to source file is preserved,
+ install to subdirectory under target directory determined by &Aap;.
+ Subdirectory is the relative path to the source file.
+ The source file "api/2.2/c/myheader.h" with attribute {keepdir}
+ is installed as "myheader.h"
+ in $INCLUDEDIR/api/2.2/c/ .
+ </entry>
+ </row>
+ <row>
+ <entry>{installdir}</entry>
+ <entry>
+ Source file name is preserved.
+ Path to source file is replaced by the value of {installdir}
+ and the file installs to a subdirectory under=20
+ the target directory determined by &Aap;.
+ Subdirectory is the value of {installdir}
+ The source file "api/2.2/c/myheader.h" with attribute {installdir=
=3Dmyinclude}
+ is installed as "myheader.h"
+ in $INCLUDEDIR/myinclude/ .
+ </entry>
+ </row>
+ <row>
+ <entry>{installdir} {installname} or {keepdir} {installname}</entry>
+ <entry>
+ The path to the source file is either kept or replaced
+ by the value of {installdir}, and the name
+ of the file is replaced by the value of {installname}.
+ The source file "api/2.2/c/myheader.h" with attributes {keepdir} {=
installname=3Dheader.h}
+ is installed as "header.h"
+ in $INCLUDEDIR/api/2.2/c/ .
+ The source file "api/2.2/c/myheader.h" with attributes {installdir=
=3Dmyinclude} {installname=3Dheader.h}
+ is installed as "header.h"
+ in $INCLUDEDIR/include/ .
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+</informaltable>
=20
=20
<para>
=2DThe above mentioned mode variable is used to set the mode bits of the fi=
le
+The mode variable mentioned above is used to set the mode bits of the file
after installing. If this is not wanted, use the {keepmode} attribute.
Example:
</para>
--Boundary-01=_c8S5DprL99Ze1GO--
--nextPart1534941.6BFzjLQqT4
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (FreeBSD)
iD8DBQBD5S8cdqzuAf6io/4RAnP4AJ9i7cQmnWb7gd8duHfXJaACxcdg8QCfSd7T
ltB96RwOCY4ulHSA9JNutkE=
=Yn5H
-----END PGP SIGNATURE-----
--nextPart1534941.6BFzjLQqT4--
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642