pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk Don't generate wrapper scripts if we can't find the...
details: https://anonhg.NetBSD.org/pkgsrc/rev/6c5cfcaaff43
branches: trunk
changeset: 467965:6c5cfcaaff43
user: jlam <jlam%pkgsrc.org@localhost>
date: Mon Feb 09 03:05:59 2004 +0000
description:
Don't generate wrapper scripts if we can't find the wrappee.
diffstat:
mk/buildlink2/bsd.buildlink2.mk | 51 ++++++++++++++++++++------------------
mk/buildlink3/bsd.buildlink3.mk | 53 +++++++++++++++++++++-------------------
2 files changed, 55 insertions(+), 49 deletions(-)
diffs (171 lines):
diff -r 26d83662ca4f -r 6c5cfcaaff43 mk/buildlink2/bsd.buildlink2.mk
--- a/mk/buildlink2/bsd.buildlink2.mk Mon Feb 09 01:52:14 2004 +0000
+++ b/mk/buildlink2/bsd.buildlink2.mk Mon Feb 09 03:05:59 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink2.mk,v 1.114 2004/02/09 01:30:59 jlam Exp $
+# $NetBSD: bsd.buildlink2.mk,v 1.115 2004/02/09 03:05:59 jlam Exp $
#
# An example package buildlink2.mk file:
#
@@ -636,18 +636,21 @@
-e "s|@_BLNK_WRAP_ENV@|${_BLNK_WRAP_ENV.${_wrappee_}:Q}|g" \
-e "s|@_BLNK_WRAP_SANITIZE_PATH@|${_BLNK_WRAP_SANITIZE_PATH.${_wrappee_}:Q}|g"
-buildlink-wrappers: ${BUILDLINK_${_wrappee_}}
-.if !target(${BUILDLINK_${_wrappee_}})
-${BUILDLINK_${_wrappee_}}: \
+_BLNK_WRAPPEE_COOKIE.${_wrappee_}= \
+ ${BUILDLINK_DIR}/.buildlink_wrapper_${_wrappee_}_done
+
+buildlink-wrappers: ${_BLNK_WRAPPEE_COOKIE.${_wrappee_}}
+${_BLNK_WRAPPEE_COOKIE.${_wrappee_}}: \
${_BLNK_WRAPPER_SH.${_wrappee_}} \
${_BLNK_WRAP_PRIVATE_CACHE.${_wrappee_}} \
${_BLNK_WRAP_CACHE.${_wrappee_}} \
${_BLNK_WRAP_LOGIC.${_wrappee_}} \
${_BLNK_WRAP_POST_LOGIC.${_wrappee_}}
${_PKG_SILENT}${_PKG_DEBUG}${ECHO_BUILDLINK_MSG} \
- "Creating wrapper: ${.TARGET}"
+ "Creating wrapper: ${BUILDLINK_${_wrappee_}}"
${_PKG_SILENT}${_PKG_DEBUG} \
wrappee="${_BLNK_PKG_${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}"; \
+ gen=yes; \
case $${wrappee} in \
/*) absdir=; \
;; \
@@ -669,29 +672,29 @@
done; \
IFS="$$OLDIFS"; \
if [ ! -x "$${wrappee}" ]; then \
- ${ECHO_MSG} "Unable to create \"$${wrappee}\" wrapper script: no such file"; \
- exit 1; \
+ gen=no; \
+ ${ECHO_BUILDLINK_MSG} "Warning: unable to create \"$${wrappee}\" wrapper script"; \
fi; \
;; \
esac; \
- ${MKDIR} ${.TARGET:H}; \
- ${CAT} ${_BLNK_WRAPPER_SH.${_wrappee_}} | \
- ${SED} ${_BLNK_WRAPPER_TRANSFORM_SED.${_wrappee_}} \
- -e "s|@WRAPPEE@|$${absdir}${_BLNK_PKG_${_wrappee_}:Q}|g" \
- > ${.TARGET}; \
- ${CHMOD} +x ${.TARGET}
-.endif
-
+ case $$gen in \
+ yes) \
+ ${MKDIR} ${BUILDLINK_${_wrappee_}:H}; \
+ ${CAT} ${_BLNK_WRAPPER_SH.${_wrappee_}} | \
+ ${SED} ${_BLNK_WRAPPER_TRANSFORM_SED.${_wrappee_}} \
+ -e "s|@WRAPPEE@|$${absdir}${_BLNK_PKG_${_wrappee_}:Q}|g" \
+ > ${BUILDLINK_${_wrappee_}}; \
+ ${CHMOD} +x ${BUILDLINK_${_wrappee_}}; \
+ ;; \
+ esac
. for _alias_ in ${_ALIASES.${_wrappee_}:S/^/${BUILDLINK_DIR}\/bin\//}
-. if !target(${_alias_})
-buildlink-wrappers: ${_alias_}
-${_alias_}: ${BUILDLINK_${_wrappee_}}
- ${_PKG_SILENT}${_PKG_DEBUG}${ECHO_BUILDLINK_MSG} \
- "Linking wrapper: ${.TARGET}"
- ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
- ${_PKG_SILENT}${_PKG_DEBUG}${LN} -f ${BUILDLINK_${_wrappee_}} ${.TARGET}
-. endif
-. endfor # _alias_
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ if [ ! -x ${_alias_} -a -x ${BUILDLINK_${_wrappee_}} ]; then \
+ ${ECHO_BUILDLINK_MSG} "Linking wrapper: ${_alias_}"; \
+ ${LN} -f ${BUILDLINK_${_wrappee_}} ${_alias_}; \
+ fi
+. endfor
+ ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
.endfor # _wrappee_
# Allow BUILDLINK_ENV to override shell environment settings in
diff -r 26d83662ca4f -r 6c5cfcaaff43 mk/buildlink3/bsd.buildlink3.mk
--- a/mk/buildlink3/bsd.buildlink3.mk Mon Feb 09 01:52:14 2004 +0000
+++ b/mk/buildlink3/bsd.buildlink3.mk Mon Feb 09 03:05:59 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink3.mk,v 1.80 2004/02/09 01:30:59 jlam Exp $
+# $NetBSD: bsd.buildlink3.mk,v 1.81 2004/02/09 03:05:59 jlam Exp $
#
# An example package buildlink3.mk file:
#
@@ -1176,9 +1176,11 @@
-e "s|@_BLNK_WRAP_ENV@|${_BLNK_WRAP_ENV.${_wrappee_}:Q}|g" \
-e "s|@_BLNK_WRAP_SANITIZE_PATH@|${_BLNK_WRAP_SANITIZE_PATH.${_wrappee_}:Q}|g"
-buildlink-wrappers: ${BUILDLINK_${_wrappee_}}
-.if !target(${BUILDLINK_${_wrappee_}})
-${BUILDLINK_${_wrappee_}}: \
+_BLNK_WRAPPEE_COOKIE.${_wrappee_}= \
+ ${BUILDLINK_DIR}/.buildlink_wrapper_${_wrappee_}_done
+
+buildlink-wrappers: ${_BLNK_WRAPPEE_COOKIE.${_wrappee_}}
+${_BLNK_WRAPPEE_COOKIE.${_wrappee_}}: \
${_BLNK_WRAPPER_SH.${_wrappee_}} \
${_BLNK_WRAP_BUILDCMD.${_wrappee_}} \
${_BLNK_WRAP_QUOTEARG.${_wrappee_}} \
@@ -1189,9 +1191,10 @@
${_BLNK_WRAP_LOGIC.${_wrappee_}} \
${_BLNK_WRAP_POST_LOGIC.${_wrappee_}}
${_PKG_SILENT}${_PKG_DEBUG}${ECHO_BUILDLINK_MSG} \
- "=> Creating wrapper: ${.TARGET}"
+ "=> Creating wrapper: ${BUILDLINK_${_wrappee_}}"
${_PKG_SILENT}${_PKG_DEBUG} \
wrappee="${_BLNK_PKG_${_wrappee_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}"; \
+ gen=yes; \
case $${wrappee} in \
/*) absdir=; \
;; \
@@ -1213,30 +1216,30 @@
done; \
IFS="$$OLDIFS"; \
if [ ! -x "$${wrappee}" ]; then \
- ${ECHO_MSG} "Unable to create \"$${wrappee}\" wrapper script: no such file"; \
- exit 1; \
+ gen=no; \
+ ${ECHO_BUILDLINK_MSG} "Warning: unable to create \"$${wrappee}\" wrapper script"; \
fi; \
;; \
esac; \
- ${MKDIR} ${.TARGET:H}; \
- ${CAT} ${_BLNK_WRAPPER_SH.${_wrappee_}} | \
- ${SED} ${_BLNK_WRAPPER_TRANSFORM_SED.${_wrappee_}} \
- -e "s|@WRAPPEE@|$${absdir}${_BLNK_PKG_${_wrappee_}:Q}|g" | \
- ${_BLNK_SH_CRUNCH_FILTER} \
- > ${.TARGET}; \
- ${CHMOD} +x ${.TARGET}
-.endif
-
+ case $$gen in \
+ yes) \
+ ${MKDIR} ${BUILDLINK_${_wrappee_}:H}; \
+ ${CAT} ${_BLNK_WRAPPER_SH.${_wrappee_}} | \
+ ${SED} ${_BLNK_WRAPPER_TRANSFORM_SED.${_wrappee_}} \
+ -e "s|@WRAPPEE@|$${absdir}${_BLNK_PKG_${_wrappee_}:Q}|g" | \
+ ${_BLNK_SH_CRUNCH_FILTER} \
+ > ${BUILDLINK_${_wrappee_}}; \
+ ${CHMOD} +x ${BUILDLINK_${_wrappee_}}; \
+ ;; \
+ esac
. for _alias_ in ${_ALIASES.${_wrappee_}:S/^/${BUILDLINK_DIR}\/bin\//}
-. if !target(${_alias_})
-buildlink-wrappers: ${_alias_}
-${_alias_}: ${BUILDLINK_${_wrappee_}}
- ${_PKG_SILENT}${_PKG_DEBUG}${ECHO_BUILDLINK_MSG} \
- "=> Linking wrapper: ${.TARGET}"
- ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
- ${_PKG_SILENT}${_PKG_DEBUG}${LN} -f ${BUILDLINK_${_wrappee_}} ${.TARGET}
-. endif
-. endfor # _alias_
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ if [ ! -x ${_alias_} -a -x ${BUILDLINK_${_wrappee_}} ]; then \
+ ${ECHO_BUILDLINK_MSG} "=> Linking wrapper: ${_alias_}"; \
+ ${LN} -f ${BUILDLINK_${_wrappee_}} ${_alias_}; \
+ fi
+. endfor
+ ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
.endfor # _wrappee_
# Allow BUILDLINK_ENV to override shell environment settings in
Home |
Main Index |
Thread Index |
Old Index