Hello all,
I updated my SunOS5/Makefile to make it a one-stop operation
to remove old package (old build, as well as pkgrm from OS),
rebuild Solaris code if needed, and install the guaranteed
new package (I had problems with "make package" installing
old binaries because they were already in a previously made
package file).
If you like the idea, it can be easily ported to other OSes
directories.
Hope this helps others in frantic rebuilds of their minimal
changes to the code during bughunt ;)
--- Makefile.orig Sun Mar 8 07:06:36 2009
+++ Makefile.jim Fri May 1 16:33:47 2009
@@ -595,7 +595,8 @@
(cd $(CPUDIR); pkgmk -a `uname -p` -o -d $(TMP))
-package install: $(CPUDIR)/ipf.pkg
+package install: cleanpkg $(CPUDIR)/ipf.pkg
+ ( cd .. && make solaris )
/bin/rm -f ipf.pkg
ln -s $(CPUDIR)/ipf.pkg ipf.pkg
@if [ `id|sed -e 's/^.[^(]*(\([^)]*\)).*/\1/'` != root ] ; then \
@@ -605,3 +606,12 @@
# Must add ipfx before ipf or driver attach fails.
-[ -d $(CPUDIR)/$(OBJ64) ] && pkgadd -d ipf.pkg ipfx
-pkgadd -d ipf.pkg ipf
+
+cleanpkg:
+ if [ -x /etc/init.d/ipfboot ]; then /etc/init.d/ipfboot stop; fi
+ ipfid=`modinfo 2>&1 | awk '/ipf / { print $1 } ' - 2>/dev/null`
+ if [ x"$(ipfid)" != x ]; then modunload -i "$(ipfid)"; fi
+ if [ -d /var/sadm/pkg/SUNWipfu ]; then yes | pkgrm SUNWipfu; fi
+ if [ -d /var/sadm/pkg/ipfx ]; then yes | pkgrm ipfx; fi
+ if [ -d /var/sadm/pkg/ipf ]; then yes | pkgrm ipf; fi
+ /bin/rm -f ipf.pkg ipf.pkg.bin \
+ $(CPUDIR)/ipf.pkgx $(CPUDIR)/ipf.pkg \
+ $(CPUDIR)/ipf.pkg.common
+
--
+============================================================+
| |
| Климов Евгений, Jim Klimov |
| технический директор CTO |
| ЗАО "ЦОС и ВТ" JSC COS&HT |
| |
| +7-903-7705859 (cellular) mailto:[email protected] |
| CC:[email protected],[email protected] |
+============================================================+
| () ascii ribbon campaign - against html mail |
| /\ - against microsoft attachments |
+============================================================+