On Fri, May 04, 2012 at 05:52:47PM +0200, Agustin Martin wrote:
> seems that install/gettext is run twice, one by emacs flavour and other by
> gettext-el. Links are already created in first run, so second run complains
> and fails. Indeed I think that my problem appeared when upgrading gettext-el
> together with emacs-snapshot.
> 
> I'd consider either using 'ln -sf' to create those symlinks (my preferred
> choice) 

Forget about this choice, this will cause byte-compiling twice for no good
reason if both emacs flavour and gettext-el are installed in the same run.

> or check for its presence before creating them.

Or check if files are already byte-compiled by checking that last .el in
$files is byte-compiled. See attached untested patch.

Regards,

-- 
Agustin
diff --git a/debian/install b/debian/install
index 001fd79..3336b6a 100644
--- a/debian/install
+++ b/debian/install
@@ -10,16 +10,20 @@ files="po-mode.el po-compat.el"
 flags="-batch -no-site-file -l path.el -f batch-byte-compile"
 
 if [ ${FLAVOR} != emacs ]; then
-  echo install/${PACKAGE}: Byte-compiling for ${FLAVOR}
+  if [ -e "${ELCDIR}/po-compat.elc" ]; then
+    echo "install/${PACKAGE}: Already byte-compiled for ${FLAVOR}. Skipping ..."
+  else
+    echo install/${PACKAGE}: Byte-compiling for ${FLAVOR}
 
-  install -m 755 -d ${ELCDIR}
-  cd ${ELCDIR}
-  for f in ${files}; do
-    ln -s ../../../emacs/site-lisp/${PACKAGE}/${f} .
-  done
-  cat << EOF > path.el
+    install -m 755 -d ${ELCDIR}
+    cd ${ELCDIR}
+    for f in ${files}; do
+      ln -s ../../../emacs/site-lisp/${PACKAGE}/${f} .
+    done
+    cat << EOF > path.el
 (setq load-path (cons "." load-path) byte-compile-warnings nil)
 EOF
-  ${FLAVOR} ${flags} ${files}
-  rm -f path.el
+    ${FLAVOR} ${flags} ${files}
+    rm -f path.el
+  fi
 fi

Reply via email to