From owner-freebsd-ports@FreeBSD.ORG Sun Nov 6 23:42:25 2005 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EFBD816A420 for ; Sun, 6 Nov 2005 23:42:24 +0000 (GMT) (envelope-from ringworm01@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id 898D143D48 for ; Sun, 6 Nov 2005 23:42:23 +0000 (GMT) (envelope-from ringworm01@gmail.com) Received: by wproxy.gmail.com with SMTP id i32so226714wra for ; Sun, 06 Nov 2005 15:42:22 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:message-id; b=ZbkS2zhgB4m5XOonldfrYZ8qQZEq7cpEq4erxLiPORC8ub6bz4gJw1kxPsia4ueOSOJ91TQuZszRa6qmYND+71hP1Xx1uxXbLmJILU7kcN+Z7pppP5MvGfTPZn5f/MhfIdgoZMtNKLTAxi9o1lJVcpDrLt/0urVxrukhRdW/SSU= Received: by 10.54.143.14 with SMTP id q14mr3706959wrd; Sun, 06 Nov 2005 15:42:22 -0800 (PST) Received: from ?192.168.1.10? ( [71.102.14.129]) by mx.gmail.com with ESMTP id 27sm4929250wrl.2005.11.06.15.42.14; Sun, 06 Nov 2005 15:42:21 -0800 (PST) From: "Michael C. Shultz" To: "Ian D. Leroux" Date: Sun, 6 Nov 2005 15:33:37 -0800 User-Agent: KMail/1.8.3 References: <20051106221047.GC36095@schtroumpf.homeunix.net> <200511061456.44530.ringworm01@gmail.com> <20051106233118.GD36095@schtroumpf.homeunix.net> In-Reply-To: <20051106233118.GD36095@schtroumpf.homeunix.net> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_RLpbDUMyaBZeBzg" Message-Id: <200511061533.37959.ringworm01@gmail.com> Cc: freebsd-ports@freebsd.org Subject: Re: java/jdk14, BUILD_DEPENDS, and portmanager -u X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2005 23:42:25 -0000 --Boundary-00=_RLpbDUMyaBZeBzg Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sunday 06 November 2005 15:31, Ian D. Leroux wrote: > On Sun, Nov 06, 2005 at 02:56:42PM -0800, Michael C. Shultz wrote: > > On Sunday 06 November 2005 14:10, Ian D. Leroux wrote: > > Please try > > > > cd /usr/ports/java/jdk14 && make -V RUN_DEPENDS -V LIB_DEPENDS -V DEPENDS > > This outputs: > > javavm:/usr/ports/java/javavmwrapper > /usr/X11R6/lib/X11/fonts/URW/fonts.dir:/usr/ports/x11-fonts/urwfonts > > both of these are up-to-date according to pkg_version. > > I'll append the Port Status report of a portmanager -u run, in case I'm > misinterpreting it. > > > For the bad news though, if linux-sun-jdk is a BUILD_DEPENDS then > > portmanager is going to expect it to be installed before building > > java/jdk14. If there is another way to build that port the proper place > > to fix this problem is in that port's Makefile. Maybe by making the > > BUILD_DEPEND contitional on the existanace of its own existing JDK? > > Agreed. I'll file a PR sometime in the next few days. > > Thanks for the quick response, > > Ian Leroux Ian, there are two patches waiting for someone to commit for portmanager, I'd like to see what you get after they are applied. I am going to attach them as files. All you should have to do is make a /usr/ports/sysutils/portmanager/files directory and drop them in there. Then manually deinstall, make, make install portmanager to apply them. When portmanager is updated in the ports tree they'll simply be overwritten so you won't have to do anything special later on. Let me know if anything changes. It will be tomorrow before I can do a proper test of java/jdk14. When I understand that port better maybe another solution will come to mind. -Mike > > ------------------------------------------------------------------------ > Port Status Report > ------------------------------------------------------------------------ > 00001 have:gmake-3.80_2 status: CURRENT: /devel/gmake > 00002 have:gettext-0.14.5 status: CURRENT: /devel/gettext > 00003 have:libtool-1.5.20 status: CURRENT: /devel/libtool15 > 00004 have:libiconv-1.9.2_1 status: CURRENT: /converters/libiconv > 00005 have:cdrtools-2.01_1 status: CURRENT: /sysutils/cdrtools > 00006 have:perl-5.8.7 status: CURRENT: /lang/perl5.8 > 00007 have:portupgrade-20041226_8 status: CURRENT: /sysutils/portupgrade > 00008 have:ruby-1.8.2_5 status: CURRENT: /lang/ruby18 > 00009 have:ruby18-bdb1-0.2.2 status: CURRENT: /databases/ruby-bdb1 > 00010 have:xorg-fonts-encodings-6.8.2 status: CURRENT: > /x11-fonts/xorg-fonts-encodings 00011 have:xorg-clients-6.8.2 > status: CURRENT: /x11/xorg-clients 00012 have:imake-6.8.2 > status: CURRENT: /devel/imake-6 00013 have:xterm-206 > status: CURRENT: /x11/xterm > 00014 have:png-1.2.8_2 status: CURRENT: /graphics/png > 00015 have:libXft-2.1.7 status: CURRENT: /x11-fonts/libXft > 00016 have:xorg-libraries-6.8.2 status: CURRENT: /x11/xorg-libraries > 00017 have:fontconfig-2.3.2,1 status: CURRENT: /x11-fonts/fontconfig > 00018 have:freetype2-2.1.10_1 status: CURRENT: /print/freetype2 > 00019 have:pkgconfig-0.19 status: CURRENT: /devel/pkgconfig > 00020 have:expat-1.95.8_3 status: CURRENT: /textproc/expat2 > 00021 have:javavmwrapper-2.0_6 status: CURRENT: /java/javavmwrapper > 00022 have:popt-1.7 status: CURRENT: /devel/popt > 00023 have:libltdl-1.5.20 status: CURRENT: /devel/libltdl15 > 00024 have:mime-support-3.35.1 status: CURRENT: /misc/mime-support > 00025 have:xorg-manpages-6.8.2 status: CURRENT: /x11/xorg-manpages > 00026 have:jpeg-6b_3 status: CURRENT: /graphics/jpeg > 00027 have:amspsfnt-1.0_3 status: CURRENT: /print/amspsfnt > 00028 have:p5-type1inst-0.6.1_2 status: CURRENT: > /x11-fonts/p5-type1inst 00029 have:abook-0.5.4 status: > CURRENT: /mail/abook > 00030 have:unzip-5.52_2 status: CURRENT: /archivers/unzip > 00031 have:libgmp-4.1.4_1 status: CURRENT: /math/libgmp4 > 00032 have:zip-2.3_2 status: CURRENT: /archivers/zip > 00033 have:nspr-4.6_1 status: CURRENT: /devel/nspr > 00034 have:open-motif-2.2.3_2 status: CURRENT: > /x11-toolkits/open-motif 00035 have:urwfonts-1.0 status: > CURRENT: /x11-fonts/urwfonts 00036 have:jdk-1.4.2p7_2 status: > OLD DEPENDENCY: linux-sun-jdk-1.4.2.10 00037 have:m4-1.4.3 > status: CURRENT: /devel/m4 > 00037 ----:linux-sun-jdk-1.4.2.10 status: MISSING: /java/linux-sun-jdk14 > 00038 have:linux_base-8-8.0_8 status: CURRENT: > /emulators/linux_base-8 00039 have:linux-XFree86-libs-4.3.99.902_3 status: > CURRENT: /x11/linux-XFree86-libs 00040 have:rpm-3.0.6_10 > status: CURRENT: /archivers/rpm 00041 have:linux-fontconfig-2.2.3 > status: CURRENT: /x11-fonts/linux-fontconfig 00042 have:automake-1.4.6_2 > status: CURRENT: /devel/automake14 00043 have:autoconf-2.13.000227_5 > status: CURRENT: /devel/autoconf213 00044 have:libtool-1.3.5_2 > status: CURRENT: /devel/libtool13 00045 have:linux-expat-1.95.5_3 > status: CURRENT: /textproc/linux-expat 00046 have:tiff-3.7.4 > status: CURRENT: /graphics/tiff 00047 have:gsfonts-8.11_2 > status: CURRENT: /print/gsfonts 00048 have:ghostscript-gnu-7.07_13 > status: CURRENT: /print/ghostscript-gnu 00049 have:lcms-1.14,1 > status: CURRENT: /graphics/lcms 00050 have:libfpx-1.2.0.12 > status: CURRENT: /graphics/libfpx 00051 have:jbigkit-1.6 > status: CURRENT: /graphics/jbigkit 00052 have:jasper-1.701.0 > status: CURRENT: /graphics/jasper 00053 have:curl-7.15.0 > status: CURRENT: /ftp/curl > 00054 have:libxml2-2.6.22 status: CURRENT: /textproc/libxml2 > 00055 have:python-2.4.2 status: CURRENT: /lang/python > 00056 have:mpeg2codec-1.2_1 status: CURRENT: > /multimedia/mpeg2codec 00057 have:ImageMagick-6.2.2.1 status: > CURRENT: /graphics/ImageMagick 00058 have:portmanager-0.3.2 status: > CURRENT: /sysutils/portmanager 00059 have:p5-CDDB_get-2.23,1 status: > CURRENT: /audio/p5-CDDB_get 00060 have:cdparanoia-3.9.8_7 status: > CURRENT: /audio/cdparanoia 00061 have:libao-0.8.5 status: > CURRENT: /audio/libao 00062 have:xorg-fonts-75dpi-6.8.2 status: CURRENT: > /x11-fonts/xorg-fonts-75dpi 00063 have:libogg-1.1.2_1,3 status: > CURRENT: /audio/libogg 00064 have:flac-1.1.2 status: > CURRENT: /audio/flac > 00065 have:nasm-0.98.39,1 status: CURRENT: /devel/nasm > 00066 have:pcre-6.4 status: CURRENT: /devel/pcre > 00067 have:speex-1.0.5,1 status: CURRENT: /audio/speex > 00068 have:libvorbis-1.1.1,3 status: CURRENT: /audio/libvorbis > 00069 have:vorbis-tools-1.1.1,3 status: CURRENT: /audio/vorbis-tools > 00070 have:vorbisgain-0.37 status: CURRENT: /audio/vorbisgain > 00071 have:crip-3.6 status: CURRENT: /audio/crip > 00072 have:mpc-0.11.2 status: CURRENT: /audio/mpc > 00073 have:linux-glib2-2.2.1_3 status: CURRENT: /devel/linux-glib2 > 00074 have:nss-3.10 status: CURRENT: /security/nss > 00075 have:glib-2.8.3 status: CURRENT: /devel/glib20 > 00076 have:shared-mime-info-0.16_2 status: CURRENT: > /misc/shared-mime-info 00077 have:intltool-0.34.1 status: > CURRENT: /textproc/intltool 00078 have:p5-XML-Parser-2.34_1 status: > CURRENT: /textproc/p5-XML-Parser 00079 have:atk-1.10.3 > status: CURRENT: /accessibility/atk 00080 have:liveMedia-2005.11.03,1 > status: CURRENT: /net/liveMedia 00081 have:libsndfile-1.0.12 > status: CURRENT: /audio/libsndfile 00082 have:cairo-1.0.2 > status: CURRENT: /graphics/cairo 00083 have:xpdf-3.01_1 > status: CURRENT: /graphics/xpdf 00084 have:autoconf-2.59_2 > status: CURRENT: /devel/autoconf259 00085 have:t1lib-5.1.0,1 > status: CURRENT: /devel/t1lib 00086 have:help2man-1.36.2 status: > CURRENT: /misc/help2man 00087 have:p5-gettext-1.03 status: > CURRENT: /devel/p5-Locale-gettext 00088 have:xorg-fonts-cyrillic-6.8.2 > status: CURRENT: /x11-fonts/xorg-fonts-cyrillic 00089 > have:bitstream-vera-1.10_2 status: CURRENT: /x11-fonts/bitstream-vera > 00090 have:xorg-fonts-truetype-6.8.2 status: CURRENT: > /x11-fonts/xorg-fonts-truetype 00091 have:gtk-2.8.6 status: > CURRENT: /x11-toolkits/gtk20 00092 have:hicolor-icon-theme-0.5 status: > CURRENT: /misc/hicolor-icon-theme 00093 have:pango-1.10.1 > status: CURRENT: /x11-toolkits/pango 00094 have:ledger-2.3 > status: CURRENT: /finance/ledger 00095 have:libwww-5.4.0_1 > status: CURRENT: /www/libwww > 00096 have:linux-atk-1.2.0_3 status: CURRENT: > /accessibility/linux-atk 00097 have:glib-1.2.10_11 status: > CURRENT: /devel/glib12 00098 have:gtk-1.2.10_13 status: > CURRENT: /x11-toolkits/gtk12 00099 have:libid3tag-0.15.1b status: > CURRENT: /audio/libid3tag 00100 have:gv-3.6.1 status: > CURRENT: /print/gv > 00101 have:Xaw3d-1.5E_1 status: CURRENT: /x11-toolkits/Xaw3d > 00102 have:keylaunch-1.3.0_1 status: CURRENT: /x11/keylaunch > 00103 have:ncmpc-0.11.1_2 status: CURRENT: /audio/ncmpc > 00104 have:evilwm-0.99.17 status: CURRENT: /x11-wm/evilwm > 00105 have:sudo-1.6.8.9 status: CURRENT: /security/sudo > 00106 have:libIDL-0.8.6_1 status: CURRENT: /devel/libIDL > 00107 have:bison-1.75_2,1 status: CURRENT: /devel/bison > 00108 have:desktop-file-utils-0.10_3 status: CURRENT: > /devel/desktop-file-utils 00109 have:msmtp-1.4.4 status: > CURRENT: /mail/msmtp > 00110 have:msmtpqueue-0.4 status: CURRENT: /mail/msmtpqueue > 00111 have:libmad-0.15.1b_1 status: CURRENT: /audio/libmad > 00112 have:madplay-0.15.0b_3 status: CURRENT: /audio/madplay > 00113 have:mad-0.15.0b status: CURRENT: /audio/mad > 00114 have:linux-jpeg-6b.15_4 status: CURRENT: /graphics/linux-jpeg > 00115 have:gd-2.0.33_3,1 status: CURRENT: /graphics/gd > 00116 have:sdl-1.2.9,2 status: CURRENT: /devel/sdl12 > 00117 have:aalib-1.4.r5_1 status: CURRENT: /graphics/aalib > 00118 have:svgalib-1.4.3_5 status: CURRENT: /graphics/svgalib > 00119 have:offlineimap-4.0.8 status: CURRENT: /mail/offlineimap > 00120 have:mpeg4ip-libmp4v2-1.3 status: CURRENT: > /multimedia/mpeg4ip-libmp4v2 00121 have:faad2-2.0_5,1 status: > CURRENT: /audio/faad > 00122 have:automake-1.5_2,1 status: CURRENT: /devel/automake15 > 00123 have:autoconf-2.53_3 status: CURRENT: /devel/autoconf253 > 00124 have:libmikmod-3.1.11 status: CURRENT: /audio/libmikmod > 00125 have:musicpd-0.11.5_1 status: CURRENT: /audio/musicpd > 00126 have:libaudiofile-0.2.6 status: CURRENT: /audio/libaudiofile > 00127 have:aspell-0.60.4 status: CURRENT: /textproc/aspell > 00128 have:libungif-4.1.4 status: CURRENT: /graphics/libungif > 00129 have:mutt-devel-1.5.11 status: CURRENT: /mail/mutt-devel > 00130 have:automake-1.9.6 status: CURRENT: /devel/automake19 > 00131 have:p5-Gtk-0.7009_1 status: CURRENT: /x11-toolkits/p5-Gtk > 00132 have:p5-XML-Writer-0.600 status: CURRENT: > /textproc/p5-XML-Writer 00133 have:xorg-documents-6.8.2 status: > CURRENT: /x11/xorg-documents 00134 have:linc-1.0.3_4 status: > CURRENT: /net/linc > 00135 have:roottail-1.2_1 status: CURRENT: /sysutils/roottail > 00136 have:bsdiff-4.2 status: CURRENT: /misc/bsdiff > 00137 have:cmpsfont-1.0_4 status: CURRENT: /print/cmpsfont > 00138 have:tex-texmflocal-1.9 status: CURRENT: /print/tex-texmflocal > 00139 have:gdk-pixbuf-0.22.0_3 status: CURRENT: /graphics/gdk-pixbuf > 00140 have:w3m-m17n-img-0.5.1_3 status: CURRENT: /www/w3m-m17n-img > 00141 have:boehm-gc+threaded+redirect-6.6_1 status: CURRENT: > /devel/boehm-gc 00142 have:linux-png-1.2.7_6 status: CURRENT: > /graphics/linux-png 00143 have:bison-devel-1.875d status: CURRENT: > /devel/bison-devel 00144 have:gprename-1.24 status: CURRENT: > /x11-fm/gprename 00145 have:xorg-fonts-100dpi-6.8.2 status: CURRENT: > /x11-fonts/xorg-fonts-100dpi 00146 have:portsnap-0.9.5 status: > CURRENT: /sysutils/portsnap 00147 have:freebsd-sha256-20050310 status: > CURRENT: /sysutils/freebsd-sha256 00148 have:x264-0.0.20051029 > status: CURRENT: /multimedia/x264 00149 have:gpac-libgpac-0.4.0 > status: CURRENT: /multimedia/gpac-libgpac 00150 have:xorg-server-6.8.2_6 > status: CURRENT: /x11-servers/xorg-server 00151 > have:xorg-fonts-miscbitmaps-6.8.2 status: CURRENT: > /x11-fonts/xorg-fonts-miscbitmaps 00152 have:xorg-fonts-type1-6.8.2 > status: CURRENT: /x11-fonts/xorg-fonts-type1 00153 > have:xorg-fontserver-6.8.2 status: CURRENT: > /x11-servers/xorg-fontserver 00154 have:xorg-nestserver-6.8.2 status: > CURRENT: /x11-servers/xorg-nestserver 00155 have:xorg-vfbserver-6.8.2 > status: CURRENT: /x11-servers/xorg-vfbserver 00156 have:dri-6.2.1,2 > status: CURRENT: /graphics/dri 00157 have:xorg-6.8.2 > status: CURRENT: /x11/xorg > 00158 have:xorg-printserver-6.8.2_2 status: CURRENT: > /x11-servers/xorg-printserver 00159 have:patch-2.5.4 status: > CURRENT: /devel/patch 00160 have:texi2html-1.76_1,1 status: CURRENT: > /textproc/texi2html 00161 have:teTeX-texmf-3.0_3 status: CURRENT: > /print/teTeX-texmf 00162 have:ORBit2-2.12.4_1 status: CURRENT: > /devel/ORBit2 00163 have:gnuplot-4.0.0_4 status: CURRENT: > /math/gnuplot 00164 have:pdflib-6.0.2 status: CURRENT: > /print/pdflib 00165 have:gcc-3.2.3_3 status: CURRENT: > /lang/gcc32 > 00166 have:libdv-0.104 status: CURRENT: /multimedia/libdv > 00167 have:teTeX-base-3.0_4 status: CURRENT: /print/teTeX-base > 00168 have:dvipsk-tetex-5.95a_1 status: CURRENT: /print/dvipsk-tetex > 00169 have:xdvik-tetex-22.84.10 status: CURRENT: /print/xdvik > 00170 have:teTeX-3.0 status: CURRENT: /print/teTeX > 00171 have:mplayer-0.99.7_5 status: CURRENT: /multimedia/mplayer > 00172 have:linux-realplayer-10.0.6 status: CURRENT: > /multimedia/linux-realplayer 00173 have:libdts-0.0.2 status: > CURRENT: /multimedia/libdts 00174 have:xanim-2.92.0 status: > CURRENT: /multimedia/xanim 00175 have:win32-codecs-3.1.0.p5_1,1 status: > CURRENT: /multimedia/win32-codecs 00176 have:libtheora-1.0.a4 > status: CURRENT: /multimedia/libtheora 00177 have:xvid-1.0.3,1 > status: CURRENT: /multimedia/xvid 00178 have:lzo-1.08_1,1 > status: CURRENT: /archivers/lzo 00179 have:xmms-1.2.10_4 > status: CURRENT: /multimedia/xmms 00180 have:rpm2cpio-1.2_2 > status: CURRENT: /archivers/rpm2cpio 00181 have:linux-gtk2-2.2.1_5 > status: CURRENT: /x11-toolkits/linux-gtk2 00182 have:linux-tiff-3.6.1_3 > status: CURRENT: /graphics/linux-tiff 00183 have:linux-pango-1.2.1_3 > status: CURRENT: /x11-toolkits/linux-pango 00184 > have:mplayerplug-in-3.11_2 status: CURRENT: /www/mplayer-plugin 00185 > have:firefox-1.0.7_4,1 status: CURRENT: /www/firefox 00186 > have:gnomehier-2.0_7 status: CURRENT: /misc/gnomehier 00187 > have:gtkspell2-2.0.11_1 status: CURRENT: /textproc/gtkspell2 00188 > have:rsync-2.6.6 status: CURRENT: /net/rsync > 00189 have:logjam-4.5.1_1 status: CURRENT: /deskutils/logjam > 00190 have:libart_lgpl2-2.3.17 status: CURRENT: > /graphics/libart_lgpl2 00191 have:gconf2-2.12.1 status: > CURRENT: /devel/gconf2 00192 have:coreutils-5.2.1 status: > CURRENT: /sysutils/coreutils 00193 have:libbonobo-2.10.1_2 status: > CURRENT: /devel/libbonobo 00194 have:fam-2.6.9_6 status: > CURRENT: /devel/fam > 00195 have:gnomevfs2-2.12.1.1_2 status: CURRENT: /devel/gnomevfs2 > 00196 have:gnomemimedata-2.4.2 status: CURRENT: /misc/gnomemimedata > 00197 have:gcc-ooo-3.4.1_2 status: CURRENT: /lang/gcc-ooo > 00198 have:p5-PathTools-3.12 status: CURRENT: /devel/p5-PathTools > 00199 have:p5-Scalar-List-Utils-1.17,1 status: CURRENT: > /lang/p5-Scalar-List-Utils 00200 have:id3lib-3.8.3_1 status: > CURRENT: /audio/id3lib 00201 have:latex-ucs-20041017 status: > CURRENT: /print/latex-ucs 00202 have:xmlcatmgr-2.2 status: > CURRENT: /textproc/xmlcatmgr 00203 have:libglade2-2.5.1_3 status: > CURRENT: /devel/libglade2 00204 have:tagtool-0.12.2_2 status: > CURRENT: /audio/tagtool 00205 have:p5-Compress-Zlib-1.41 status: > CURRENT: /archivers/p5-Compress-Zlib 00206 have:p5-Test-Simple-0.62 > status: CURRENT: /devel/p5-Test-Simple 00207 have:p5-Test-Harness-2.56 > status: CURRENT: /devel/p5-Test-Harness 00207 have:openoffice.org-2.0.0 > status: OLD avalable: openoffice.org-2.0.0_1 00208 > have:p5-Archive-Zip-1.16 status: CURRENT: /archivers/p5-Archive-Zip > 00208 ----:apache-ant-1.6.5_1 status: MISSING: /devel/apache-ant > 00209 have:p5-File-Temp-0.16_2 status: CURRENT: /devel/p5-File-Temp > 00210 have:ipcheck-0.230,1 status: CURRENT: /dns/ipcheck 00211 > have:portaudit-0.5.10 status: CURRENT: /security/portaudit 00212 > have:postfix-2.2.5_1,1 status: CURRENT: /mail/postfix 00213 > have:cabextract-1.1 status: CURRENT: /archivers/cabextract 00214 > have:smartmontools-5.33_2 status: CURRENT: /sysutils/smartmontools > 00215 have:xmbmon-205_1 status: CURRENT: /sysutils/xmbmon > 00216 have:latex-mk-1.4 status: CURRENT: /misc/latex-mk 00217 > have:nedit-5.5 status: CURRENT: /editors/nedit > ======================================================================== > skipping jdk-1.4.2p7_2 /java/jdk14 untill dependency /java/linux-sun-jdk14 > is updated skipping linux-sun-jdk-1.4.2.10 /java/linux-sun-jdk14 marked > IGNORE reason: port marked IGNORE skipping openoffice.org-2.0.0 > /editors/openoffice.org-2.0 untill dependency /java/jdk14 is updated > skipping apache-ant-1.6.5_1 /devel/apache-ant untill dependency /java/jdk14 > is updated > ------------------------------------------------------------------------ > portmanager 0.3.2 INFO: finished with some ports not updated if --log was > used see /var/log/portmanager.log > ------------------------------------------------------------------------ --Boundary-00=_RLpbDUMyaBZeBzg Content-Type: text/x-diff; charset="iso-8859-1"; name="patch-0.3.2_1" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-0.3.2_1" diff -ruN ../0.3.2/libMG/src/MGrFileSize.c ./libMG/src/MGrFileSize.c --- ../0.3.2/libMG/src/MGrFileSize.c Fri Nov 4 06:39:26 2005 +++ ./libMG/src/MGrFileSize.c Sun Nov 6 05:43:09 2005 @@ -37,8 +37,11 @@ errorCode = stat( fileName, &status); if( errorCode == -1 ) { +/* fprintf( stderr, "%s error: stat of %s returned an error\n", id, fileName ); perror( "system message" ); +*/ + return( 0 ); } fileSize = status.st_size; diff -ruN ../0.3.2/libMG/src/MGrFileTime.c ./libMG/src/MGrFileTime.c --- ../0.3.2/libMG/src/MGrFileTime.c Fri Nov 4 06:39:26 2005 +++ ./libMG/src/MGrFileTime.c Sun Nov 6 05:45:02 2005 @@ -24,7 +24,7 @@ unsigned long int MGrFileTime( char* fileName ) { - char id[] = "MGrFileSize"; + char id[] = "MGrFileTime"; unsigned long int fileTime = 0; signed int errorCode = 0; struct stat status; @@ -32,8 +32,10 @@ errorCode = stat( fileName, &status); if( errorCode == -1 ) { +/* fprintf( stderr, "%s error: stat of %s returned an error\n", id, fileName ); perror( "system message" ); +*/ return( 0 ); } fileTime = status.st_mtime; diff -ruN ../0.3.2/libMGPM/src/MGPMrCommandLine.c ./libMGPM/src/MGPMrCommandLine.c --- ../0.3.2/libMGPM/src/MGPMrCommandLine.c Fri Nov 4 08:53:17 2005 +++ ./libMGPM/src/MGPMrCommandLine.c Sat Nov 5 20:12:57 2005 @@ -54,14 +54,15 @@ /* * set default values here */ - property.autoConflicts = 0; /* 1 = yes to all */ - property.autoMoved = 0; /* if 1 then remove moved ports is Y */ - property.backUp = 0; /* 0 = no packages 1 = build backup packages */ - property.forced = 0; - property.interactive = 0; - property.log = 0; - property.pmMode = 0; /* 0 = multiple port updates/1 = single */ - property.resume = 0; /* 1 = portmanager updated itself, don't rebuild databases in -u -f mode */ + property.autoConflicts = 0; /* 1 = yes to all */ + property.autoMoved = 0; /* if 1 then remove moved ports is Y */ + property.backUp = 0; /* 0 = no packages 1 = build backup packages */ + property.forced = 0; + property.interactive = 0; + property.log = 0; + property.optionsChanged = 0; /* set by MGPMrUpdate for example to indicate a ports's options just changed */ + property.pmMode = 0; /* 0 = multiple port updates/1 = single */ + property.resume = 0; /* 1 = portmanager updated itself, don't rebuild databases in -u -f mode */ /* * Make /usr/ports/packages of it is missing @@ -327,6 +328,8 @@ if( dirStream == 0 ) /* bad dir */ { fprintf( stderr, "%s %s error: %s is not a valid port directory\n", id, PACKAGE_VERSION, path ); + fprintf( stdout, "%s %s info:either you have used an invalid command line switch as the first option or you are trying to update a non existent port path, see man portmanager(1) \n", + id, PACKAGE_VERSION ); free( path ); return( 1 ); } @@ -345,6 +348,8 @@ if( ( errorCode = MGPMrController( property, path ) ) ) { fprintf( stdout, "%s %s error: %s returned errorCode %d\n", id, PACKAGE_VERSION, "MGPMrControler", errorCode ); + fprintf( stdout, "%s %s info:either you have used an invalid command line switch as the first option or you are trying to update a non existent port path, see man portmanager(1) \n", + id, PACKAGE_VERSION ); free( path ); return( 1 ); } diff -ruN ../0.3.2/libMGPM/src/MGPMrSinglePortCreateStatusDb.c ./libMGPM/src/MGPMrSinglePortCreateStatusDb.c --- ../0.3.2/libMGPM/src/MGPMrSinglePortCreateStatusDb.c Fri Nov 4 21:46:56 2005 +++ ./libMGPM/src/MGPMrSinglePortCreateStatusDb.c Sat Nov 5 21:12:54 2005 @@ -37,7 +37,8 @@ int MGPMrSinglePortCreateStatusDb( structProperty* property, char* portDir ) { - FILE* dependencyDbStream = NULL; + FILE* dependencyDbStream = NULL; + char exact[] = "exact"; char id[] = "MGPMrSinglePortCreateStatusDb"; char* availablePortDir = NULL; char* availablePortName = NULL; @@ -69,34 +70,37 @@ while( fflush( stdout ) ); strcpy( availablePortDir, portDir ); - property->availablePortsDb = MGdbCreate( - property->availablePortsDbFileName, - property->fieldAvailablePortsDbPortName, - property->fieldAvailablePortsDbPortDir, - property->fieldAvailablePortsDbFlag, - NULL); - - dependencyDbStream = fopen( property->availableDependenciesDbFileName, "w" ); - if( dependencyDbStream == 0 ) + if( property->optionsChanged == 0 ) /* set by MGPMrUpdate for example to indicate a ports's options just changed */ { - fprintf( stdout, "%s %s error: could not open %s\n", id, PACKAGE_VERSION, property->availableDependenciesDbFileName ); - perror( "system message" ); - return( 1 ); - } + property->availablePortsDb = MGdbCreate( + property->availablePortsDbFileName, + property->fieldAvailablePortsDbPortName, + property->fieldAvailablePortsDbPortDir, + property->fieldAvailablePortsDbFlag, + NULL); - /* - * creates dependencyDb with header record, same as MGdbCreate. In this case records will be added by - * fprint'ing to dependencyDbStream instead of using MGdbAdd because speed is important here so we don't - * want a dependencyDb object yet. - */ - fprintf( dependencyDbStream, "%s%c%s%c%s%c%s%c%s%c%c", "fieldAvailableDependenciesDbPortDir", 0, "fieldAvailableDependenciesDbPortName", 0, - "fieldAvailableDependenciesDbDependencyDir", 0, "fieldAvailableDependenciesDbDependencyName", 0, - "fieldAvailableDependenciesDbDependType", 0, LINEFEED ); - while( fflush( stdout ) ); - fclose( dependencyDbStream ); + dependencyDbStream = fopen( property->availableDependenciesDbFileName, "w" ); + if( dependencyDbStream == 0 ) + { + fprintf( stdout, "%s %s error: could not open %s\n", id, PACKAGE_VERSION, property->availableDependenciesDbFileName ); + perror( "system message" ); + return( 1 ); + } - property->availableDependenciesDb = MGdbOpen( property->availableDependenciesDbFileName ); - property->configDb = MGdbOpen( property->configDbFileName ); + /* + * creates dependencyDb with header record, same as MGdbCreate. In this case records will be added by + * fprint'ing to dependencyDbStream instead of using MGdbAdd because speed is important here so we don't + * want a dependencyDb object yet. + */ + fprintf( dependencyDbStream, "%s%c%s%c%s%c%s%c%s%c%c", "fieldAvailableDependenciesDbPortDir", 0, "fieldAvailableDependenciesDbPortName", 0, + "fieldAvailableDependenciesDbDependencyDir", 0, "fieldAvailableDependenciesDbDependencyName", 0, + "fieldAvailableDependenciesDbDependType", 0, LINEFEED ); + while( fflush( stdout ) ); + fclose( dependencyDbStream ); + + property->availableDependenciesDb = MGdbOpen( property->availableDependenciesDbFileName ); + property->configDb = MGdbOpen( property->configDbFileName ); + } if( ( errorCode = rGetPortName( property, availablePortDir, availablePortName ) ) ) { @@ -104,7 +108,20 @@ return( 1 ); } - MGdbAdd( property->availablePortsDb, availablePortName, availablePortDir, "0", NULL); + MGdbGoTop( property->availablePortsDb ); + if( MGdbSeek( property->availablePortsDb, + property->fieldAvailablePortsDbPortDir, + availablePortDir, + property->fieldAvailablePortsDbPortDir, + exact ) ) + { + } + else + { + MGdbAdd( property->availablePortsDb, availablePortName, availablePortDir, "0", NULL); + + } + if( ( errorCode = rFillDependencies( property, availablePortName, availablePortDir, counterPtr ) ) ) { fprintf( stdout, "%s %s error: %s returned errorCode %d\n", id, PACKAGE_VERSION, "rFillDependencies", errorCode ); @@ -129,9 +146,12 @@ } idx++; } - MGdbDestroy( property->availablePortsDb ); - MGdbDestroy( property->availableDependenciesDb ); - MGdbDestroy( property->configDb ); + if( property->optionsChanged == 0 ) /* set by MGPMrUpdate for example to indicate a ports's options just changed */ + { + MGdbDestroy( property->availablePortsDb ); + MGdbDestroy( property->availableDependenciesDb ); + MGdbDestroy( property->configDb ); + } free( availablePortDir ); free( availablePortName ); return( 0 ); @@ -364,21 +384,38 @@ /* * add dependency to availableDependenciesDb may contain dupes */ - fprintf( dependencyDbStream, "%s%c%s%c%s%c%s%c%s%c%c", availablePortDir, 0, availablePortName, 0, dependencyPortDir, - 0, dependencyPortName, 0, dependType, 0, LINEFEED ); - MGdbGoTop( property->configDb ); - optionsPtr = MGdbSeek( property->configDb, property->fieldConfigDbKey, dependencyPortDir, property->fieldConfigDbValue, exact ); -/* - if( optionsPtr ) + if( property->optionsChanged ) { - fprintf( stdout, "\t%s %s %s\n", dependencyPortName, dependencyPortDir, optionsPtr ); + MGdbAdd( property->availableDependenciesDb, + availablePortDir, + availablePortName, + dependencyPortDir, + dependencyPortName, + dependType, + NULL ); + + MGdbGoTop( property->configDb ); + optionsPtr = MGdbSeek( property->configDb, + property->fieldConfigDbKey, + dependencyPortDir, + property->fieldConfigDbValue, + exact ); + if( optionsPtr ) + { + fprintf( stdout, "\t%s %s %s\n", dependencyPortName, dependencyPortDir, optionsPtr ); + } + else + { + fprintf( stdout, "\t%s %s\n", dependencyPortName, dependencyPortDir ); + } + while( fflush( stdout ) ); + } else { - fprintf( stdout, "\t%s %s\n", dependencyPortName, dependencyPortDir ); + fprintf( dependencyDbStream, "%s%c%s%c%s%c%s%c%s%c%c", availablePortDir, 0, availablePortName, 0, dependencyPortDir, + 0, dependencyPortName, 0, dependType, 0, LINEFEED ); } - while( fflush( stdout ) ); -*/ /* * if dependency not in availablePortsDb add it */ diff -ruN ../0.3.2/libMGPM/src/MGPMrSinglePortStatus.c ./libMGPM/src/MGPMrSinglePortStatus.c --- ../0.3.2/libMGPM/src/MGPMrSinglePortStatus.c Fri Nov 4 13:02:23 2005 +++ ./libMGPM/src/MGPMrSinglePortStatus.c Sat Nov 5 09:07:12 2005 @@ -203,6 +203,7 @@ */ else { + counterPtr[0]++; strcpy( installedPortsDbPortDir, availablePortsDbPortDirPtr ); MGdbGoTop( property->installedPortsDb ); diff -ruN ../0.3.2/libMGPM/src/MGPMrUpdate.c ./libMGPM/src/MGPMrUpdate.c --- ../0.3.2/libMGPM/src/MGPMrUpdate.c Fri Nov 4 08:47:41 2005 +++ ./libMGPM/src/MGPMrUpdate.c Sun Nov 6 05:17:31 2005 @@ -31,33 +31,54 @@ #define OK 0 #include +typedef struct +{ + char* afterOptionsFileSize; + char* afterOptionsFileTime; + char* beforeOptionsFileSize; + char* beforeOptionsFileTime; + char* buffer; + char* command; + char* commandRestart; + char* newPortDir; + char* newPortName; + char* optionsCheck; + char* optionsDir; + char* workDir; +} structLocalProperty; + int rCleanDir( char* portDir, char* workDir ); -int rCleanUp( structProperty* property, char* buffer, char* command, char* newPortDir, char* newPortName, char* workDir ); +int rCleanUp( structProperty* property, structLocalProperty* localProperty ); int rPortBrokeCheck( structProperty* property, char* options, char* oldPortDir, char* oldPortName, char* brokeCheckType ); int MGPMrUpdate( structProperty* property, char* oldPortDir, char* oldPortName ) { + FILE* fileStream = NULL; FILE* pHandle = NULL; + char BROKEN[] = "BROKEN"; + char FORBIDDEN[] = "FORBIDDEN"; + char IGNORE[] = "IGNORE"; + char backUp[] = "--back-up"; + char bu[] = "-bu"; char exact[] = "exact"; char id[] = "MGPMrUpdate"; + char ip[] = "-ip"; + char l[] = "-l"; + char log[] = "--log"; char strike[] = "0"; + char y[] = "-y"; + char yes[] = "--yes"; char* availableDependenciesDbDependencyDirPtr = NULL; char* availableDependenciesDbDependencyNamePtr = NULL; char* availablePortsFlagPtr = NULL; - char* buffer = NULL; char* bufferBase = NULL; - char* command = NULL; - char* commandRestart = NULL; char* dependencyDbDependencyPortDirPtr = NULL; char* dependencyDbDependencyPortNamePtr = NULL; char* installedPortsDbPortNamePtr = NULL; char* ipPtr = NULL; - char* newPortDir = NULL; - char* newPortName = NULL; char* oldPortDirPtr = NULL; char* options = NULL; char* stinker = NULL; char* strikePtr = NULL; - char* workDir = NULL; int availableDependenciesDbIDX = 0; int availableDependenciesDbQTY = 0; int availablePortsDbIDX = 0; @@ -69,49 +90,98 @@ int installedPortsDbIDX = 0; int installedPortsDbQTY = 0; int kkey = 1; - - buffer = (char*)calloc( bufferSize, 1 ); - command = (char*)calloc( bufferSize, 1 ); - commandRestart = (char*)calloc( bufferSize, 1 ); - newPortDir = (char*)calloc( 255, 1 ); - newPortName = (char*)calloc( 255, 1 ); - workDir = (char*)calloc( bufferSize, 1 ); - - property->commandLineDb = MGdbOpen( property->commandLineDbFileName ); - property->configDb = MGdbOpen( property->configDbFileName ); - property->ignoreDb = MGdbOpen( property->ignoreDbFileName ); - property->installedPortsDb = MGdbOpen( property->installedPortsDbFileName ); - property->strikesDb = MGdbOpen( property->strikesDbFileName ); - - if( property->pmMode || property->forced ) - { - property->availablePortsDb = MGdbOpen( property->availablePortsDbFileName ); - property->availableDependenciesDb = MGdbOpen( property->availableDependenciesDbFileName ); - } - else + + structLocalProperty localProperty; + + property->optionsChanged = 0; + + localProperty.afterOptionsFileSize = (char*)calloc( 511, 1 ); + localProperty.afterOptionsFileTime = (char*)calloc( 511, 1 ); + localProperty.beforeOptionsFileSize = (char*)calloc( 511, 1 ); + localProperty.beforeOptionsFileTime = (char*)calloc( 511, 1 ); + localProperty.buffer = (char*)calloc( bufferSize, 1 ); + localProperty.command = (char*)calloc( bufferSize, 1 ); + localProperty.commandRestart = (char*)calloc( bufferSize, 1 ); + localProperty.newPortDir = (char*)calloc( 511, 1 ); + localProperty.newPortName = (char*)calloc( 511, 1 ); + localProperty.optionsCheck = (char*)calloc( 511, 1 ); + localProperty.optionsDir = (char*)calloc( 511, 1 ); + localProperty.workDir = (char*)calloc( 511, 1 ); + + property->availableDependenciesDb = MGdbOpen( property->availableDependenciesDbFileName ); + property->availablePortsDb = MGdbOpen( property->availablePortsDbFileName ); + property->commandLineDb = MGdbOpen( property->commandLineDbFileName ); + property->configDb = MGdbOpen( property->configDbFileName ); + property->dependencyPortsDb = MGdbOpen( property->dependencyPortsDbFileName ); + property->ignoreDb = MGdbOpen( property->ignoreDbFileName ); + property->installedPortsDb = MGdbOpen( property->installedPortsDbFileName ); + property->strikesDb = MGdbOpen( property->strikesDbFileName ); + + /* + * store work directoy base + */ + strcpy( localProperty.workDir, "cd " ); + strcat( localProperty.workDir, PORTSDIR ); + strcat( localProperty.workDir, oldPortDir ); + strcat( localProperty.workDir, "; make -V WRKDIRPREFIX" ); + localProperty.buffer[0] = 0; + pHandle = popen( localProperty.workDir, "r" ); + fread( localProperty.buffer, 255, 1, pHandle ); + pclose( pHandle ); + idx = 0; + while( idx < 255 ) { - property->dependencyPortsDb = MGdbOpen( property->dependencyPortsDbFileName ); + if( localProperty.buffer[idx] == LINEFEED || localProperty.buffer[idx] == TAB || localProperty.buffer[idx] == SPACE ) + { + localProperty.buffer[idx] = 0; + break; + } + idx++; } + strcpy( localProperty.workDir, localProperty.buffer ); - strcpy( workDir, "cd " ); - strcat( workDir, PORTSDIR ); - strcat( workDir, oldPortDir ); - strcat( workDir, "; make -V WRKDIRPREFIX" ); - buffer[0] = 0; - pHandle = popen( workDir, "r" ); - fread( buffer, 255, 1, pHandle ); + /* + * store localProperty.optionsDir + */ + strcpy( localProperty.optionsDir, "cd " ); + strcat( localProperty.optionsDir, PORTSDIR ); + strcat( localProperty.optionsDir, oldPortDir ); + strcat( localProperty.optionsDir, "; make -V OPTIONSFILE" ); + localProperty.buffer[0] = 0; + pHandle = popen( localProperty.optionsDir, "r" ); + fread( localProperty.buffer, 255, 1, pHandle ); pclose( pHandle ); idx = 0; while( idx < 255 ) { - if( buffer[idx] == LINEFEED || buffer[idx] == TAB || buffer[idx] == SPACE ) + if( localProperty.buffer[idx] == LINEFEED || localProperty.buffer[idx] == TAB || localProperty.buffer[idx] == SPACE ) { - buffer[idx] = 0; + localProperty.buffer[idx] = 0; break; } idx++; } - strcpy( workDir, buffer ); + strcpy( localProperty.optionsDir, localProperty.buffer ); + + /* + * BEFORE check for /var/db/ports/{oldPortDir} less sub dir + * if it exists get size/time of options file for later comparison + * + * + */ + + fileStream = fopen( localProperty.optionsDir, "r" ); + if( fileStream == NULL ) /* no file */ + { + localProperty.beforeOptionsFileTime[0] = 0; + localProperty.beforeOptionsFileSize[0] = 0; + } + else + { + fclose( fileStream ); + } + strcpy( localProperty.beforeOptionsFileTime, MGrIntToString( (int)MGrFileTime( localProperty.optionsDir ) ) ); + strcpy( localProperty.beforeOptionsFileSize, MGrIntToString( MGrFileSize( localProperty.optionsDir ) ) ); if( property->interactive ) { @@ -152,7 +222,7 @@ fprintf( stdout, "\nAdding %s %s to ignore list\n", oldPortName, oldPortDir ); MGdbAdd( property->ignoreDb, oldPortDir, "inteactivly skipped", NULL ); kkey = getc(stdin); - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return(0); } case KEY_n: @@ -160,7 +230,7 @@ fprintf( stdout, "\nAdding %s %s to ignore list\n", oldPortName, oldPortDir ); MGdbAdd( property->ignoreDb, oldPortDir, "inteactivly skipped", NULL ); kkey = getc(stdin); - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return(0); } default: @@ -185,15 +255,15 @@ MGdbAdd( property->ignoreDb, oldPortDir, "looping, 3rd attempt at make", NULL ); if( property->log ) { - strcpy( command, "echo \"make Strike 3 " ); - strcat( command, oldPortName ); - strcat( command, " " ); - strcat( command, oldPortDir ); - strcat( command, " marking port as ignore/looping " ); - strcat( command, " \">> /var/log/portmanager.log" ); - system( command ); + strcpy( localProperty.command, "echo \"make Strike 3 " ); + strcat( localProperty.command, oldPortName ); + strcat( localProperty.command, " " ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, " marking port as ignore/looping " ); + strcat( localProperty.command, " \">> /var/log/portmanager.log" ); + system( localProperty.command ); } - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return( 0 ); } if( strike[0] == '1' ) @@ -207,17 +277,18 @@ { fprintf( stdout, "%s %s error: %s returned errorCode %d\n", id, PACKAGE_VERSION, "MGdbDelete", errorCode ); while( fflush( stdout ) ); + rCleanUp( property, &localProperty ); return( 1 ); } MGdbAdd( property->strikesDb, oldPortDir, "2", NULL ); if( property->log ) { - strcpy( command, "echo \"make Strike 2 " ); - strcat( command, oldPortName ); - strcat( command, " " ); - strcat( command, oldPortDir ); - strcat( command, " \">> /var/log/portmanager.log" ); - system( command ); + strcpy( localProperty.command, "echo \"make Strike 2 " ); + strcat( localProperty.command, oldPortName ); + strcat( localProperty.command, " " ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, " \">> /var/log/portmanager.log" ); + system( localProperty.command ); } /* dualOriginCheck( property, oldPortName ); @@ -237,36 +308,36 @@ /************************************************************************/ if( options ) { - strcpy( command, "cd " ); - strcat( command, PORTSDIR ); - strcat( command, oldPortDir ); - strcat( command, "; make check-conflicts " ); - strcat( command, options ); + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, PORTSDIR ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, "; make check-conflicts " ); + strcat( localProperty.command, options ); } else { - strcpy( command, "cd " ); - strcat( command, PORTSDIR ); - strcat( command, oldPortDir ); - strcat( command, "; make check-conflicts " ); + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, PORTSDIR ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, "; make check-conflicts " ); } fprintf( stdout, "%s\n", SINGLE_LINES ); fprintf( stdout, "checking for conflicts before building %s\n", oldPortName ); - fprintf( stdout, "%s %s command: #1 of 8 %s\n", id, PACKAGE_VERSION, command ); + fprintf( stdout, "%s %s command: #1 of 8 %s\n", id, PACKAGE_VERSION, localProperty.command ); fprintf( stdout, "%s\n", SINGLE_LINES ); while( fflush( stdout ) ); - if( ( errorCode = system(command) ) ) + if( ( errorCode = system(localProperty.command) ) ) { /* * We have a conflicting port installed, pkg_delete -f'ing the stinker * */ - buffer[0] = 0; - pHandle = popen( command, "r" ); - fread( buffer, bufferSize, 1, pHandle ); + localProperty.buffer[0] = 0; + pHandle = popen( localProperty.command, "r" ); + fread( localProperty.buffer, bufferSize, 1, pHandle ); if( feof( pHandle ) && !ferror( pHandle ) ) { - bufferBase = strstr( buffer, "conflicts with installed package" ); + bufferBase = strstr( localProperty.buffer, "conflicts with installed package" ); if( bufferBase ) { /* @@ -278,7 +349,7 @@ * linux_base-rh-9 * */ - bufferBase = buffer + bufferBase = localProperty.buffer + strlen(oldPortName) + strlen( "===> conflicts with installed package" ); @@ -339,7 +410,7 @@ while( fflush( stdout ) ); MGdbAdd( property->ignoreDb, oldPortDir, "conflicts with another port", NULL ); kkey = getc(stdin); - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return(0); } case KEY_n: @@ -348,7 +419,7 @@ while( fflush( stdout ) ); MGdbAdd( property->ignoreDb, oldPortDir, "conflicts with another port", NULL ); kkey = getc(stdin); - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return(0); } default: @@ -359,19 +430,19 @@ } } } - strcpy( command, "pkg_delete -f " ); - strcat( command, installedPortsDbPortNamePtr ); - fprintf( stdout, "executing: %s\n", command ); + strcpy( localProperty.command, "pkg_delete -f " ); + strcat( localProperty.command, installedPortsDbPortNamePtr ); + fprintf( stdout, "executing: %s\n", localProperty.command ); while( fflush( stdout ) ); - errorCode = system( command ); + errorCode = system( localProperty.command ); if( property->log ) { - strcpy( command, "echo \"removed conflicting port " ); - strcat( command, oldPortName ); - strcat( command, " " ); - strcat( command, oldPortDir ); - strcat( command, " \">> /var/log/portmanager.log" ); - system( command ); + strcpy( localProperty.command, "echo \"removed conflicting port " ); + strcat( localProperty.command, oldPortName ); + strcat( localProperty.command, " " ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, " \">> /var/log/portmanager.log" ); + system( localProperty.command ); } } installedPortsDbIDX++; @@ -412,32 +483,32 @@ while( fflush( stderr ) ); if( property->log ) { - strcpy( command, "echo \" " ); - strcat( command, oldPortName ); - strcat( command, " " ); - strcat( command, oldPortDir ); - strcat( command, " conflicts with another installed port so marked ignore\" >> /var/log/portmanager.log" ); - system( command ); + strcpy( localProperty.command, "echo \" " ); + strcat( localProperty.command, oldPortName ); + strcat( localProperty.command, " " ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, " conflicts with another installed port so marked ignore\" >> /var/log/portmanager.log" ); + system( localProperty.command ); } MGdbAdd( property->ignoreDb, oldPortDir, "conflicts with another installed port", NULL ); - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return( 0 ); } /************************************************************************/ /* Command "1.1" " make -V FORBIDDEN " */ /************************************************************************/ - if( ( errorCode = rPortBrokeCheck( property, options, oldPortDir, oldPortName, "FORBIDDEN" ) ) ) + if( ( errorCode = rPortBrokeCheck( property, options, oldPortDir, oldPortName, FORBIDDEN ) ) ) { switch( errorCode ) { case CRASH: { - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return( CRASH ); } case SKIP: { - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return( OK ); } } @@ -446,18 +517,18 @@ /************************************************************************/ /* Command "1.2" " make -V BROKEN " */ /************************************************************************/ - if( ( errorCode = rPortBrokeCheck( property, options, oldPortDir, oldPortName, "BROKEN" ) ) ) + if( ( errorCode = rPortBrokeCheck( property, options, oldPortDir, oldPortName, BROKEN ) ) ) { switch( errorCode ) { case CRASH: { - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return( CRASH ); } case SKIP: { - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return( OK ); } } @@ -466,18 +537,18 @@ /************************************************************************/ /* Command "1.3" " make -V IGNORE " */ /************************************************************************/ - if( ( errorCode = rPortBrokeCheck( property, options, oldPortDir, oldPortName, "IGNORE" ) ) ) + if( ( errorCode = rPortBrokeCheck( property, options, oldPortDir, oldPortName, IGNORE ) ) ) { switch( errorCode ) { case CRASH: { - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return( CRASH ); } case SKIP: { - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return( OK ); } } @@ -514,7 +585,7 @@ while( oldPortDirPtr && availableDependenciesDbIDX < availableDependenciesDbQTY && strcmp( oldPortDir, oldPortDirPtr ) == 0 ) { - rCleanDir( availableDependenciesDbDependencyDirPtr, workDir ); + rCleanDir( availableDependenciesDbDependencyDirPtr, localProperty.workDir ); oldPortDirPtr = MGdbGet( property->availableDependenciesDb, availableDependenciesDbIDX, @@ -527,7 +598,7 @@ property->fieldAvailableDependenciesDbDependencyName ); availableDependenciesDbIDX++; } - rCleanDir( oldPortDir, workDir ); + rCleanDir( oldPortDir, localProperty.workDir ); } else { @@ -553,7 +624,7 @@ while( oldPortDirPtr && dependencyPortsDbIDX < dependencyPortsDbQTY && strcmp( oldPortDir, oldPortDirPtr ) == 0 ) { - rCleanDir( dependencyDbDependencyPortDirPtr, workDir ); + rCleanDir( dependencyDbDependencyPortDirPtr, localProperty.workDir ); oldPortDirPtr = MGdbSeek( property->dependencyPortsDb, property->fieldDependencyDbPortDir, @@ -571,80 +642,215 @@ dependencyPortsDbIDX++; } - rCleanDir( oldPortDir, workDir ); + rCleanDir( oldPortDir, localProperty.workDir ); } /************************************************************************/ /* Command "3.1" " make fetch" */ /************************************************************************/ - strcpy( command, "cd " ); - strcat( command, PORTSDIR ); - strcat( command, oldPortDir ); - strcat( command, "; make fetch " ); + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, PORTSDIR ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, "; make fetch " ); if( options ) { - strcat( command, options ); + strcat( localProperty.command, options ); } fprintf( stdout, "%s\n", SINGLE_LINES ); fprintf( stdout, "fetch %s \n", oldPortName ); - fprintf( stdout, "%s %s command: #3.1 of 8 %s\n", id, PACKAGE_VERSION, command ); + fprintf( stdout, "%s %s command: #3.1 of 8 %s\n", id, PACKAGE_VERSION, localProperty.command ); fprintf( stdout, "%s\n", SINGLE_LINES ); while( fflush( stdout ) ); - if( ( errorCode = system(command) ) ) + if( ( errorCode = system(localProperty.command) ) ) { if( property->log ) { - strcpy( command, "echo \" " ); - strcat( command, oldPortName ); - strcat( command, " " ); - strcat( command, oldPortDir ); - strcat( command, " failed to fetch\" >> /var/log/portmanager.log" ); - system( command ); + strcpy( localProperty.command, "echo \" " ); + strcat( localProperty.command, oldPortName ); + strcat( localProperty.command, " " ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, " failed to fetch\" >> /var/log/portmanager.log" ); + system( localProperty.command ); } fprintf( stdout, "%s %s error: make fetch returned an error, adding %s to ignore.db\n", id, PACKAGE_VERSION, oldPortDir ); while( fflush( stdout ) ); MGdbAdd( property->ignoreDb, oldPortDir, "failed during make fetch", NULL ); - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return(0); } + + /************************************************************************/ - /* Command "3.2" " make " */ + /* Command "3.2" " make -V OPTIONS" */ + /************************************************************************/ + + /* + * If no /var/db/ports/{package name}/options file exists + * yet make -V OPTIONS shows OPTIONS as being defined + * make is going to bluescreen, we need to handle that here + */ + + strcpy( localProperty.optionsCheck, "cd " ); + strcat( localProperty.optionsCheck, PORTSDIR ); + strcat( localProperty.optionsCheck, oldPortDir ); + strcat( localProperty.optionsCheck, "; make -V OPTIONS" ); + + fprintf( stdout, "%s\n", SINGLE_LINES ); + fprintf( stdout, "%s %s command: #3.2 of 8 %s\n", id, PACKAGE_VERSION, localProperty.optionsCheck ); + fprintf( stdout, "%s\n", SINGLE_LINES ); + while( fflush( stdout ) ); + + pHandle = popen( localProperty.optionsCheck, "r" ); + localProperty.buffer[0] = 0; + fread( localProperty.buffer, bufferSize, 1, pHandle ); + pclose( pHandle ); + /************************************************************************/ + /* Command "3.3" " make conf" */ + /************************************************************************/ + if( strlen( localProperty.buffer ) > 4 ) + { + /* + * If here we know OPTIONS is defined, now need to know if + * /var/db/ports/{package name}/options exists + */ + fileStream = fopen( localProperty.optionsDir, "r" ); + if( fileStream == NULL ) /* no file */ + { + if( options ) + { + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, PORTSDIR ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, "; make config " ); + strcat( localProperty.command, options ); + } + else + { + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, PORTSDIR ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, "; make config " ); + } + fprintf( stdout, "%s\n", SINGLE_LINES ); + fprintf( stdout, "update %s \n", oldPortName ); + fprintf( stdout, "%s %s command: #3.3 of 8 %s\n", id, PACKAGE_VERSION, localProperty.command ); + fprintf( stdout, "%s\n", SINGLE_LINES ); + while( fflush( stdout ) ); + system(localProperty.command); + } + else + { + fclose( fileStream ); + } + strcpy( localProperty.afterOptionsFileTime, MGrIntToString( (int)MGrFileTime( localProperty.optionsDir ) ) ); + strcpy( localProperty.afterOptionsFileSize, MGrIntToString( MGrFileSize( localProperty.optionsDir ) ) ); + + /* + * test to see if any options changed + */ + if( strlen( localProperty.beforeOptionsFileTime ) != strlen( localProperty.afterOptionsFileTime ) || + strlen( localProperty.beforeOptionsFileSize ) != strlen( localProperty.afterOptionsFileSize ) || + strcmp( localProperty.beforeOptionsFileTime, localProperty.afterOptionsFileTime ) || + strcmp( localProperty.beforeOptionsFileSize, localProperty.afterOptionsFileSize ) ) + { +fprintf( stdout, "%s debug 01: beforeOptionsFileTime-=>%s afterOptionsFileTime-=>%s beforeOptionsFileSize-=>%s afterOptionsFileSize-=>%s\n", + id, + localProperty.beforeOptionsFileTime, + localProperty.afterOptionsFileTime, + localProperty.beforeOptionsFileSize, + localProperty.afterOptionsFileSize ); +while( fflush( stdout ) ); + + /* + * options changed so need to purge oldPortDir's records + * from availablePortsDb and availableDependenciesDb + */ + property->optionsChanged = 1; + MGdbGoTop( property->availablePortsDb ); + while( MGdbSeek( property->availablePortsDb, + property->fieldAvailablePortsDbPortDir, + oldPortDir, + property->fieldAvailablePortsDbPortDir, + exact ) ) + { + fprintf( stdout, "%s info: purging availablePortsDb of old %s record\n", + id, + MGdbGet( property->availablePortsDb, + MGdbGetRecno( property->availablePortsDb ) - 1, + property->fieldAvailablePortsDbPortName ) ); + while( fflush( stdout ) ); + MGdbDelete( property->availablePortsDb, MGdbGetRecno( property->availablePortsDb ) - 1 ); + MGdbGoTop( property->availablePortsDb ); + } + + MGdbGoTop( property->availableDependenciesDb ); + while( MGdbSeek( property->availableDependenciesDb, + property->fieldAvailableDependenciesDbPortDir, + oldPortDir, + property->fieldAvailableDependenciesDbPortDir, + exact ) ) + { + fprintf( stdout, "%s info: purging availableDependenciesDb of old %s dependency records %s\n", + id, + MGdbGet( property->availableDependenciesDb, + MGdbGetRecno( property->availableDependenciesDb ) - 1, + property->fieldAvailableDependenciesDbPortName ), + MGdbGet( property->availableDependenciesDb, + MGdbGetRecno( property->availableDependenciesDb ) - 1, + property->fieldAvailableDependenciesDbDependencyName ) ); + while( fflush( stdout ) ); + MGdbDelete( property->availableDependenciesDb, MGdbGetRecno( property->availableDependenciesDb ) - 1 ); + MGdbGoTop( property->availableDependenciesDb ); + } + /* + * add oldPortDir's new records back into availablePortsDb + * and availableDependenciesDb + */ + fprintf( stdout, "%s info: adding new/modified %s records\n", id, oldPortDir ); + MGPMrSinglePortCreateStatusDb( property, oldPortDir ); + rCleanUp( property, &localProperty ); + return( 0 ); + } + } + + /************************************************************************/ + /* Command "3.4" " make" */ /************************************************************************/ if( options ) { - strcpy( command, "cd " ); - strcat( command, PORTSDIR ); - strcat( command, oldPortDir ); - strcat( command, "; make " ); - strcat( command, options ); + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, PORTSDIR ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, "; make " ); + strcat( localProperty.command, options ); } else { - strcpy( command, "cd " ); - strcat( command, PORTSDIR ); - strcat( command, oldPortDir ); - strcat( command, "; make " ); + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, PORTSDIR ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, "; make " ); } fprintf( stdout, "%s\n", SINGLE_LINES ); fprintf( stdout, "update %s \n", oldPortName ); - fprintf( stdout, "%s %s command: #3.2 of 8 %s\n", id, PACKAGE_VERSION, command ); + fprintf( stdout, "%s %s command: #3.4 of 8 %s\n", id, PACKAGE_VERSION, localProperty.command ); fprintf( stdout, "%s\n", SINGLE_LINES ); while( fflush( stdout ) ); - if( ( errorCode = system(command) ) ) + if( ( errorCode = system(localProperty.command) ) ) { if( property->log ) { - strcpy( command, "echo \" " ); - strcat( command, oldPortName ); - strcat( command, " " ); - strcat( command, oldPortDir ); - strcat( command, " failed during make\" >> /var/log/portmanager.log" ); - system( command ); + strcpy( localProperty.command, "echo \" " ); + strcat( localProperty.command, oldPortName ); + strcat( localProperty.command, " " ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, " failed during make\" >> /var/log/portmanager.log" ); + system( localProperty.command ); } fprintf( stdout, "%s %s error: make returned an error, adding %s to ignore.db\n", id, PACKAGE_VERSION, oldPortDir ); while( fflush( stdout ) ); MGdbAdd( property->ignoreDb, oldPortDir, "failed during make", NULL ); - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return(0); } /************************************************************************/ @@ -660,17 +866,17 @@ } else { - strcpy( command, "cd " ); - strcat( command, TEMPDIR ); - strcat( command, "; pkg_create -b " ); - strcat( command, oldPortName ); + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, TEMPDIR ); + strcat( localProperty.command, "; pkg_create -b " ); + strcat( localProperty.command, oldPortName ); fprintf( stdout, "%s\n", SINGLE_LINES ); fprintf( stdout, "backing up installed %s before removing it \n", oldPortName ); - fprintf( stdout, "%s %s command: #4 of 8 %s\n", id, PACKAGE_VERSION, command ); + fprintf( stdout, "%s %s command: #4 of 8 %s\n", id, PACKAGE_VERSION, localProperty.command ); fprintf( stdout, "%s\n", SINGLE_LINES ); while( fflush( stdout ) ); - system(command); + system(localProperty.command); } /************************************************************************/ /* Command "5" " make deinstall " */ @@ -681,30 +887,30 @@ if( ( strcmp( oldPortDir, "/sysutils/portmanager" ) == 0 || strcmp( oldPortDir, "/local/sysutils/portmanager" ) == 0 ) && property->pmMode == SINGLE ) { - strcpy( command, "cd " ); - strcat( command, PORTSDIR ); - strcat( command, "/sysutils/portmanager; " ); - strcat( command, "make -V PKG_DBDIR" ); - pHandle = popen( command, "r" ); - buffer[0] = 0; - fread( buffer, 255, 1, pHandle ); + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, PORTSDIR ); + strcat( localProperty.command, "/sysutils/portmanager; " ); + strcat( localProperty.command, "make -V PKG_DBDIR" ); + pHandle = popen( localProperty.command, "r" ); + localProperty.buffer[0] = 0; + fread( localProperty.buffer, 255, 1, pHandle ); pclose( pHandle ); idx = 0; while( idx < 255 ) { - if( buffer[idx] == LINEFEED || buffer[idx] == TAB || buffer[idx] == SPACE ) + if( localProperty.buffer[idx] == LINEFEED || localProperty.buffer[idx] == TAB || localProperty.buffer[idx] == SPACE ) { - buffer[idx] = 0; + localProperty.buffer[idx] = 0; break; } idx++; } - strcpy( command, "rm -r " ); - strcat( command, buffer ); - strcat( command, "/portmanager*" ); - fprintf( stdout, "executing: %s\n", command ); + strcpy( localProperty.command, "rm -r " ); + strcat( localProperty.command, localProperty.buffer ); + strcat( localProperty.command, "/portmanager*" ); + fprintf( stdout, "executing: %s\n", localProperty.command ); while( fflush( stdout ) ); - system( command ); + system( localProperty.command ); } else { @@ -717,13 +923,13 @@ /* * have to do this here before db's are wacked */ - strcpy( commandRestart, "portmanager -u" ); + strcpy( localProperty.commandRestart, "portmanager -u" ); MGdbGoTop( property->commandLineDb ); - while( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, "-ip", property->fieldCommandLineDbValue, exact ) ) ) + while( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, ip, property->fieldCommandLineDbValue, exact ) ) ) { - strcat( commandRestart, " " ); - strcat( commandRestart, " -ip " ); - strcat( commandRestart, ipPtr ); + strcat( localProperty.commandRestart, " " ); + strcat( localProperty.commandRestart, " -ip " ); + strcat( localProperty.commandRestart, ipPtr ); } } if( strcmp( oldPortName, "not installed" ) == 0 ) @@ -736,27 +942,27 @@ } else { - strcpy( command, "pkg_delete -f "); - strcat( command, oldPortName); + strcpy( localProperty.command, "pkg_delete -f "); + strcat( localProperty.command, oldPortName); fprintf( stdout, "%s\n", SINGLE_LINES ); fprintf( stdout, "removing old %s \n", oldPortName ); - fprintf( stdout, "%s %s command: #5 of 8 %s\n", id, PACKAGE_VERSION, command ); + fprintf( stdout, "%s %s command: #5 of 8 %s\n", id, PACKAGE_VERSION, localProperty.command ); fprintf( stdout, "%s\n", SINGLE_LINES ); while( fflush( stdout ) ); - if( ( system(command) ) ) + if( ( system(localProperty.command) ) ) { - command[0] = 0; - strcpy( command, "cd " ); - strcat( command, PORTSDIR ); - strcat( command, oldPortDir ); - strcat( command, "; make deinstall " ); + localProperty.command[0] = 0; + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, PORTSDIR ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, "; make deinstall " ); fprintf( stdout, "%s\n", SINGLE_LINES ); fprintf( stdout, "trying one more way to remove %s...\n", oldPortName ); - fprintf( stdout, "%s %s command: #5 of 8 %s\n", id, PACKAGE_VERSION, command ); + fprintf( stdout, "%s %s command: #5 of 8 %s\n", id, PACKAGE_VERSION, localProperty.command ); fprintf( stdout, "%s\n", SINGLE_LINES ); while( fflush( stdout ) ); - system(command); + system(localProperty.command); } } } @@ -765,73 +971,73 @@ /************************************************************************/ if( options ) { - strcpy( command, "cd " ); - strcat( command, PORTSDIR ); - strcat( command, oldPortDir ); - strcat( command, "; make reinstall " ); - strcat( command, options ); + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, PORTSDIR ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, "; make reinstall " ); + strcat( localProperty.command, options ); } else { - strcpy( command, "cd " ); - strcat( command, PORTSDIR ); - strcat( command, oldPortDir ); - strcat( command, "; make reinstall " ); + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, PORTSDIR ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, "; make reinstall " ); } fprintf( stdout, "%s\n", SINGLE_LINES ); fprintf( stdout, "installing updated %s \n", oldPortDir ); - fprintf( stdout, "%s %s command: #6 of 8 %s\n", id, PACKAGE_VERSION, command ); + fprintf( stdout, "%s %s command: #6 of 8 %s\n", id, PACKAGE_VERSION, localProperty.command ); fprintf( stdout, "%s\n", SINGLE_LINES ); while( fflush( stdout ) ); - if( ( errorCode = system( command ) ) ) + if( ( errorCode = system( localProperty.command ) ) ) { if( property->log ) { - strcpy( command, "echo \" " ); - strcat( command, oldPortName ); - strcat( command, " " ); - strcat( command, oldPortDir ); - strcat( command, " restoring original port from backup\" >> /var/log/portmanager.log" ); - system( command ); + strcpy( localProperty.command, "echo \" " ); + strcat( localProperty.command, oldPortName ); + strcat( localProperty.command, " " ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, " restoring original port from backup\" >> /var/log/portmanager.log" ); + system( localProperty.command ); } - strcpy(command, "pkg_add "); - strcat(command, TEMPDIR); - strcat(command, "/"); - strcat(command, oldPortName); - strcat(command, ".tgz"); + strcpy(localProperty.command, "pkg_add "); + strcat(localProperty.command, TEMPDIR); + strcat(localProperty.command, "/"); + strcat(localProperty.command, oldPortName); + strcat(localProperty.command, ".tgz"); fprintf( stdout, "%s\n", SINGLE_LINES ); fprintf( stderr, "restoring original port from backup \n" ); - fprintf( stderr, "%s %s command: #6!! ***Emergancy restore*** %s\n", id, PACKAGE_VERSION, command ); + fprintf( stderr, "%s %s command: #6!! ***Emergancy restore*** %s\n", id, PACKAGE_VERSION, localProperty.command ); fprintf( stdout, "%s\n", SINGLE_LINES ); while( fflush( stdout ) ); - if( ( errorCode = system( command ) ) ) + if( ( errorCode = system( localProperty.command ) ) ) { if( property->log ) { - strcpy( command, "echo \" " ); - strcat( command, oldPortName ); - strcat( command, " " ); - strcat( command, oldPortDir ); - strcat( command, " failed to restore from backup\" >> /var/log/portmanager.log" ); - system( command ); + strcpy( localProperty.command, "echo \" " ); + strcat( localProperty.command, oldPortName ); + strcat( localProperty.command, " " ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, " failed to restore from backup\" >> /var/log/portmanager.log" ); + system( localProperty.command ); } fprintf( stdout, "%s %s error: FAILED TO RESTORE BACKUP COPY, really sorry ! \n", id, PACKAGE_VERSION ); fprintf( stdout, "%s %s info: adding %s to ignore.db\n", id, PACKAGE_VERSION, oldPortDir ); while( fflush( stdout ) ); MGdbAdd( property->ignoreDb, oldPortDir, "failed during (6) emergancy restore", NULL ); - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return(0); } if( property->log ) { - strcpy( command, "echo \" " ); - strcat( command, oldPortName ); - strcat( command, " " ); - strcat( command, oldPortDir ); - strcat( command, " restored from backup and marked ignore\" >> /var/log/portmanager.log" ); - system( command ); + strcpy( localProperty.command, "echo \" " ); + strcat( localProperty.command, oldPortName ); + strcat( localProperty.command, " " ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, " restored from backup and marked ignore\" >> /var/log/portmanager.log" ); + system( localProperty.command ); } fprintf( stdout, "%s\n", SINGLE_LINES ); fprintf( stdout, "%s %s error: RESTORED BACKUP COPY\n", id, PACKAGE_VERSION ); @@ -839,24 +1045,24 @@ MGdbAdd( property->ignoreDb, oldPortDir, "performed (6) emergancy restore", NULL ); fprintf( stdout, "%s\n", SINGLE_LINES ); while( fflush( stdout ) ); - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return(0); } else { if( strcmp( oldPortName, "not installed" ) ) { - strcpy( command, "cd " ); - strcat( command, TEMPDIR); - strcat( command, "; rm -f "); - strcat( command, oldPortName); - strcat( command, ".tgz" ); + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, TEMPDIR); + strcat( localProperty.command, "; rm -f "); + strcat( localProperty.command, oldPortName); + strcat( localProperty.command, ".tgz" ); fprintf( stdout, "%s\n", SINGLE_LINES ); fprintf( stderr, "deleting backup copy, installation of updated %s successful\n", oldPortDir ); - fprintf( stdout, "%s %s command: #6 of 8 %s\n", id, PACKAGE_VERSION, command ); + fprintf( stdout, "%s %s command: #6 of 8 %s\n", id, PACKAGE_VERSION, localProperty.command ); fprintf( stdout, "%s\n", SINGLE_LINES ); while( fflush( stdout ) ); - system( command ); + system( localProperty.command ); } } /************************************************************************/ @@ -866,25 +1072,25 @@ { if( options ) { - strcpy( command, "cd " ); - strcat( command, PORTSDIR ); - strcat( command, oldPortDir ); - strcat( command, "; make package " ); - strcat( command, options ); + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, PORTSDIR ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, "; make package " ); + strcat( localProperty.command, options ); } else { - strcpy( command, "cd " ); - strcat( command, PORTSDIR ); - strcat( command, oldPortDir ); - strcat( command, "; make package " ); + strcpy( localProperty.command, "cd " ); + strcat( localProperty.command, PORTSDIR ); + strcat( localProperty.command, oldPortDir ); + strcat( localProperty.command, "; make package " ); } fprintf( stdout, "%s\n", SINGLE_LINES ); fprintf( stderr, "making package of updated %s \n", oldPortDir ); - fprintf( stdout, "%s %s command: #7 of 8 %s\n", id, PACKAGE_VERSION, command ); + fprintf( stdout, "%s %s command: #7 of 8 %s\n", id, PACKAGE_VERSION, localProperty.command ); fprintf( stdout, "%s\n", SINGLE_LINES ); while( fflush( stdout ) ); - system(command); + system(localProperty.command); } else { @@ -908,7 +1114,7 @@ if( ( strcmp( oldPortDir, "/sysutils/portmanager" ) == 0 || strcmp( oldPortDir, "/local/sysutils/portmanager" ) == 0 ) && property->pmMode == MULTI ) { - rCleanDir( oldPortDir, workDir ); + rCleanDir( oldPortDir, localProperty.workDir ); } else { @@ -934,7 +1140,7 @@ while( oldPortDirPtr && availableDependenciesDbIDX < availableDependenciesDbQTY && strcmp( oldPortDir, oldPortDirPtr ) == 0 ) { - rCleanDir( availableDependenciesDbDependencyDirPtr, workDir ); + rCleanDir( availableDependenciesDbDependencyDirPtr, localProperty.workDir ); oldPortDirPtr = MGdbGet( property->availableDependenciesDb, availableDependenciesDbIDX, @@ -947,7 +1153,7 @@ property->fieldAvailableDependenciesDbDependencyName ); availableDependenciesDbIDX++; } - rCleanDir( oldPortDir, workDir ); + rCleanDir( oldPortDir, localProperty.workDir ); } else { @@ -973,7 +1179,7 @@ while( oldPortDirPtr && dependencyPortsDbIDX < dependencyPortsDbQTY && strcmp( oldPortDir, oldPortDirPtr ) == 0 ) { - rCleanDir( dependencyDbDependencyPortDirPtr, workDir ); + rCleanDir( dependencyDbDependencyPortDirPtr, localProperty.workDir ); oldPortDirPtr = MGdbSeek( property->dependencyPortsDb, property->fieldDependencyDbPortDir, @@ -991,7 +1197,7 @@ dependencyPortsDbIDX++; } - rCleanDir( oldPortDir, workDir ); + rCleanDir( oldPortDir, localProperty.workDir ); } } @@ -1005,47 +1211,47 @@ * reconstruct the command line */ MGdbGoTop( property->commandLineDb ); - if( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, "-l", property->fieldCommandLineDbValue, exact ) ) ) + if( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, l, property->fieldCommandLineDbValue, exact ) ) ) { - strcat( commandRestart, " " ); - strcat( commandRestart, "-l" ); + strcat( localProperty.commandRestart, " " ); + strcat( localProperty.commandRestart, "-l" ); } MGdbGoTop( property->commandLineDb ); - if( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, "--log", property->fieldCommandLineDbValue, exact ) ) ) + if( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, log, property->fieldCommandLineDbValue, exact ) ) ) { - strcat( commandRestart, " " ); - strcat( commandRestart, "-l" ); + strcat( localProperty.commandRestart, " " ); + strcat( localProperty.commandRestart, "-l" ); } MGdbGoTop( property->commandLineDb ); - if( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, "-bu", property->fieldCommandLineDbValue, exact ) ) ) + if( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, bu, property->fieldCommandLineDbValue, exact ) ) ) { - strcat( commandRestart, " " ); - strcat( commandRestart, "-bu" ); + strcat( localProperty.commandRestart, " " ); + strcat( localProperty.commandRestart, "-bu" ); } MGdbGoTop( property->commandLineDb ); - if( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, "--back-up", property->fieldCommandLineDbValue, exact ) ) ) + if( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, backUp, property->fieldCommandLineDbValue, exact ) ) ) { - strcat( commandRestart, " " ); - strcat( commandRestart, "-bu" ); + strcat( localProperty.commandRestart, " " ); + strcat( localProperty.commandRestart, "-bu" ); } MGdbGoTop( property->commandLineDb ); - if( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, "-y", property->fieldCommandLineDbValue, exact ) ) ) + if( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, y, property->fieldCommandLineDbValue, exact ) ) ) { - strcat( commandRestart, " " ); - strcat( commandRestart, "-y" ); + strcat( localProperty.commandRestart, " " ); + strcat( localProperty.commandRestart, "-y" ); } MGdbGoTop( property->commandLineDb ); - if( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, "--yes", property->fieldCommandLineDbValue, exact ) ) ) + if( ( ipPtr = MGdbSeek( property->commandLineDb, property->fieldCommandLineDbKey, yes, property->fieldCommandLineDbValue, exact ) ) ) { - strcat( commandRestart, " " ); - strcat( commandRestart, "--yes" ); + strcat( localProperty.commandRestart, " " ); + strcat( localProperty.commandRestart, "--yes" ); } - strcat( commandRestart, " --resume" ); + strcat( localProperty.commandRestart, " --resume" ); fprintf(stdout, "%s\n", SINGLE_LINES); - fprintf(stdout, "portmanager just updated itself, executing:\n\t%s\n", commandRestart ); + fprintf(stdout, "portmanager just updated itself, executing:\n\t%s\n", localProperty.commandRestart ); fprintf(stdout, "%s\n", SINGLE_LINES); while( fflush( stdout ) ); - system( commandRestart ); + system( localProperty.commandRestart ); exit( 0 ); } @@ -1061,44 +1267,47 @@ if( availablePortsFlagPtr && strncmp( availablePortsFlagPtr, "2", 1 ) ) { availablePortsDbIDX = MGdbGetRecno( property->availablePortsDb ) - 1; - strcpy( newPortName, MGdbGet( property->availablePortsDb, availablePortsDbIDX, property->fieldAvailablePortsDbPortName ) ); - strcpy( newPortDir, MGdbGet( property->availablePortsDb, availablePortsDbIDX, property->fieldAvailablePortsDbPortDir ) ); + strcpy( localProperty.newPortName, MGdbGet( property->availablePortsDb, availablePortsDbIDX, property->fieldAvailablePortsDbPortName ) ); + strcpy( localProperty.newPortDir, MGdbGet( property->availablePortsDb, availablePortsDbIDX, property->fieldAvailablePortsDbPortDir ) ); if( ( errorCode = MGdbDelete( property->availablePortsDb, availablePortsDbIDX ) ) ) { fprintf( stdout, "%s %s error: %s returned errorCode %d\n", id, PACKAGE_VERSION, "MGdbDelete", errorCode ); + rCleanUp( property, &localProperty ); return( 1 ); } - MGdbAdd( property->availablePortsDb, newPortName, newPortDir, "2", NULL ); + MGdbAdd( property->availablePortsDb, localProperty.newPortName, localProperty.newPortDir, "2", NULL ); } } - free( commandRestart ); - rCleanUp( property, buffer, command, newPortDir, newPortName, workDir ); + rCleanUp( property, &localProperty ); return( 0 ); } /****************************************/ /****************************************/ /****************************************/ -int rCleanUp( structProperty* property, char* buffer, char* command, char* newPortDir, char* newPortName, char* workDir ) +int rCleanUp( structProperty* property, structLocalProperty* localProperty ) { + MGdbDestroy( property->availableDependenciesDb ); + MGdbDestroy( property->availablePortsDb ); MGdbDestroy( property->commandLineDb ); MGdbDestroy( property->configDb ); + MGdbDestroy( property->dependencyPortsDb ); MGdbDestroy( property->ignoreDb ); MGdbDestroy( property->installedPortsDb ); MGdbDestroy( property->strikesDb ); - free( buffer ); - free( command ); - free( newPortDir ); - free( newPortName ); - free( workDir ); - if( property->pmMode || property->forced ) - { - MGdbDestroy( property->availablePortsDb ); - MGdbDestroy( property->availableDependenciesDb ); - } - else - { - MGdbDestroy( property->dependencyPortsDb ); - } + + free( localProperty->afterOptionsFileSize ); + free( localProperty->afterOptionsFileTime ); + free( localProperty->beforeOptionsFileSize ); + free( localProperty->beforeOptionsFileTime ); + free( localProperty->buffer ); + free( localProperty->command ); + free( localProperty->commandRestart ); + free( localProperty->newPortDir ); + free( localProperty->newPortName ); + free( localProperty->optionsCheck ); + free( localProperty->optionsDir ); + free( localProperty->workDir ); + return(0); } /****************************************/ diff -ruN ../0.3.2/libMGPM/src/libMGPM.h ./libMGPM/src/libMGPM.h --- ../0.3.2/libMGPM/src/libMGPM.h Fri Nov 4 08:42:49 2005 +++ ./libMGPM/src/libMGPM.h Sun Nov 6 04:06:31 2005 @@ -91,16 +91,17 @@ /* * default flags */ + int autoConflicts; /* if 1 then conflicts Y/N default is Y */ + int autoMoved; /* if 1 then remove moved ports is Y */ + int backUp; /* if 1 then make packages for updatyed ports */ int forced; /* 1 = forced updates 0 = normal */ int interactive; /* 0 = non, 1 = interactive */ + int log; /* if 1 then enable logging */ int objIdx; + int optionsChanged; /* set by MGPMrUpdate for example to indicate a ports's options just changed */ int pmMode; /* singlePort Upgrade = 1 multiple upgrade = 0 */ int resume; /* 0=normal 1=don't create databases*/ int verbose; - int log; /* if 1 then enable logging */ - int backUp; /* if 1 then make packages for updatyed ports */ - int autoConflicts; /* if 1 then conflicts Y/N default is Y */ - int autoMoved; /* if 1 then remove moved ports is Y */ /* * misc @@ -176,7 +177,6 @@ classDb* strikesDb; classDir* dir; classPort* portTree; - } structProperty; diff -ruN ../0.3.2/portmanager/portmanager.1 ./portmanager/portmanager.1 --- ../0.3.2/portmanager/portmanager.1 Fri Nov 4 06:39:26 2005 +++ ./portmanager/portmanager.1 Sat Nov 5 07:30:34 2005 @@ -80,7 +80,7 @@ .sp .It \fB\&-ui\fR or \fB\&--upgrade-interactive\fR - upgrade interactively + upgrade in interactive mode asks (y/n/a) before updating each port .sp .It \fB\&-v\fR or \fB\&--version\fR @@ -104,7 +104,7 @@ portmanager x11/gnome2 --log -to add/update/repair a single port with logging by forcing all +to add/update/repair a single port with logging and forcing all of it's dependencies to be rebuilt portmanager x11/gnome2 --log --fix Binary files ../0.3.2/portmanager-0.3.2.tar.gz and ./portmanager-0.3.2.tar.gz differ Binary files ../0.3.2/portmanager-0.3.3.tar.gz and ./portmanager-0.3.3.tar.gz differ diff -ruN ../0.3.2/programmer-notes.txt ./programmer-notes.txt --- ../0.3.2/programmer-notes.txt Fri Nov 4 08:47:05 2005 +++ ./programmer-notes.txt Sat Nov 5 09:19:08 2005 @@ -2,17 +2,13 @@ Must do before releasing - (yes/no/auto yes to all) [y/n/a] [y] - a) moved ports - b) ui - c) conflicts - auto stop/start of programs? dual origin move database files to /var/db/portmanager test in 6.0 - update web site + use signal to shutdown with c valgrind clean +c/w (yes/no/auto yes to all) [y/n/a] [y] c/w --resume option for forced modes c/w -sl c/w -slid @@ -29,6 +25,7 @@ c/w test moved ports c/w three strikes c/w update man pages +c/w update web site portmanager.c - passes argv, arc to MGPMrCommandLine.c --Boundary-00=_RLpbDUMyaBZeBzg Content-Type: text/x-diff; charset="iso-8859-1"; name="patch-0.3.2_2" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-0.3.2_2" diff -ruN ../0.3.2_1/libMGPM/src/MGPMrSinglePortStatus.c ./libMGPM/src/MGPMrSinglePortStatus.c --- ../0.3.2_1/libMGPM/src/MGPMrSinglePortStatus.c Sun Nov 6 06:38:18 2005 +++ ./libMGPM/src/MGPMrSinglePortStatus.c Sun Nov 6 09:35:25 2005 @@ -55,7 +55,8 @@ int counter = 0; int installedPortsDbIDX = 0; int* counterPtr = NULL; - + int old = 0; + counterPtr = &counter; oldDependencyName = (char*)calloc( bufferSize, 1 ); @@ -101,6 +102,7 @@ */ while( availablePortsDbIDX < availablePortsDbQTY ) { + old = 0; availablePortsDbPortDirPtr = MGdbGet( property->availablePortsDb, availablePortsDbIDX, property->fieldAvailablePortsDbPortDir ); @@ -128,7 +130,10 @@ /* * if "is availablePortsDb fieldAvailablePortsDbPortName in installedPortsDb" = yes * a) test it's dependents: - * 1. If all RUN dependencies are in installedPortsDb then port is current + * 1. If all RUN dependencies are in installedPortsDb then port may be current + * a. Is all port's dependencies in dependencyPortsDb current? + * 1. yes port is current + * 2. No - port built with old dependencies * 2. If NOT all RUN dependencies are in installedPortsDb then port is built with old/missing dependencies */ if( installedPortsDbPortNamePtr ) @@ -187,11 +192,55 @@ } else { - fprintf( stdout, "%05d have:%-25s status: CURRENT: %-25s\n", - counter, - installedPortsDbPortName, - installedPortsDbPortDir ); - while( fflush( stdout ) ); + MGdbGoTop( property->dependencyPortsDb ); + while( MGdbSeek( property->dependencyPortsDb, + property->fieldDependencyDbPortDir, + installedPortsDbPortDir, + property->fieldDependencyDbPortDir, + exact ) ) + { + MGdbGoTop( property->installedPortsDb ); + + if( MGdbSeek( property->installedPortsDb, + property->fieldInstalledPortsDbPortName, + MGdbGet( property->dependencyPortsDb, + MGdbGetRecno( property->dependencyPortsDb ) - 1, + property->fieldDependencyDbDependencyPortName ), + property->fieldInstalledPortsDbPortName, + exact ) == NULL ) + { + fprintf( stdout, "%05d have:%-25s status: OLD DEPENDENCY: %-25s\n", + counter, + installedPortsDbPortName, + MGdbGet( property->dependencyPortsDb, + MGdbGetRecno( property->dependencyPortsDb ) - 1, + property->fieldDependencyDbDependencyPortName ) ); + while( fflush( stdout ) ); + + MGdbAdd( property->oldPortsDb, + installedPortsDbPortDir, + installedPortsDbPortName, + "OLD DEPENDENCY", + MGdbGet( property->dependencyPortsDb, + MGdbGetRecno( property->dependencyPortsDb ) - 1, + property->fieldDependencyDbDependencyPortName ), + MGdbGet( property->dependencyPortsDb, + MGdbGetRecno( property->dependencyPortsDb ) - 1, + property->fieldDependencyDbDependencyPortDir ), + NULL ); + old = 1; + break; + } + + } + if( old == 0 ) + { + fprintf( stdout, "%05d have:%-25s status: CURRENT: %-25s\n", + counter, + installedPortsDbPortName, + installedPortsDbPortDir ); + while( fflush( stdout ) ); + } } } } --Boundary-00=_RLpbDUMyaBZeBzg--