summaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2005-02-12 21:20:29 +0000
committerpav <pav@FreeBSD.org>2005-02-12 21:20:29 +0000
commitaa78cf80273d6901d916c3475b0141cd7ba8ae99 (patch)
treef116f39ad8050530ec0c942377a053970aa13510 /sysutils
parent6f99aa66001fdb551eb5dbd23e55fc79469e07b0 (diff)
downloadFreeBSD-ports-aa78cf80273d6901d916c3475b0141cd7ba8ae99.zip
FreeBSD-ports-aa78cf80273d6901d916c3475b0141cd7ba8ae99.tar.gz
- Update to 0.2.6_4:
* Finally found and fixed the bug haunting portmanager for the past few revisions. Portmanager now "flushes" after droping new records into it's data bases :) * Improvement of database code to handle wider variety of strings/character codes merged from another project that uses libMG. PR: ports/77409 Submitted by: Michael C. Shultz <reso3w83@verizon.net> (maintainer)
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/portmanager/Makefile2
-rw-r--r--sysutils/portmanager/files/patch-0.2.6_4310
2 files changed, 311 insertions, 1 deletions
diff --git a/sysutils/portmanager/Makefile b/sysutils/portmanager/Makefile
index 37ad3e0..48584dd 100644
--- a/sysutils/portmanager/Makefile
+++ b/sysutils/portmanager/Makefile
@@ -7,7 +7,7 @@
PORTNAME= portmanager
PORTVERSION= 0.2.6
-PORTREVISION= 3
+PORTREVISION= 4
#-----------------------------------------
#for local use, remove before submitting PR
CATEGORIES= sysutils
diff --git a/sysutils/portmanager/files/patch-0.2.6_4 b/sysutils/portmanager/files/patch-0.2.6_4
new file mode 100644
index 0000000..57145dc
--- /dev/null
+++ b/sysutils/portmanager/files/patch-0.2.6_4
@@ -0,0 +1,310 @@
+diff -bBdruN --exclude=.svn --exclude=.private --exclude=PRIVATE --exclude=HTML --exclude=Makefile --exclude=Makefile.in --exclude=Makefile.am --exclude=STABLE-sysutils::Makefile --exclude=aclocal.m4 --exclude=configure --exclude=configure.ac /usr/home/mike/work/portmanager/tags/0.2.6_3/libMG/src/MGdbAdd.c libMG/src/MGdbAdd.c
+--- /usr/home/mike/work/portmanager/tags/0.2.6_3/libMG/src/MGdbAdd.c Tue Feb 8 21:40:10 2005
++++ libMG/src/MGdbAdd.c Fri Feb 11 12:20:13 2005
+@@ -59,6 +59,12 @@
+ break;
+ }
+ fprintf( dbFileStream, "%s%c", paramPtr, 0 );
++
++ /*
++ * prevents random LINEFEEDS!!!
++ */
++ while( fflush( dbFileStream ) );
++
+ idx++;
+ if(idx > db->fieldQty)
+ {
+diff -bBdruN --exclude=.svn --exclude=.private --exclude=PRIVATE --exclude=HTML --exclude=Makefile --exclude=Makefile.in --exclude=Makefile.am --exclude=STABLE-sysutils::Makefile --exclude=aclocal.m4 --exclude=configure --exclude=configure.ac /usr/home/mike/work/portmanager/tags/0.2.6_3/libMG/src/MGdbRead.c libMG/src/MGdbRead.c
+--- /usr/home/mike/work/portmanager/tags/0.2.6_3/libMG/src/MGdbRead.c Tue Feb 8 21:40:10 2005
++++ libMG/src/MGdbRead.c Fri Feb 11 01:10:15 2005
+@@ -73,14 +73,14 @@
+ assert(0);
+ }
+
+- /***************************************************************/
+- /* set db->fieldQty */
+- /***************************************************************/
++ /*
++ * set db->fieldQty
++ */
+ dataBufferIdx = 0;
+- db->fieldQty = 0;
+- while( db->dataBuffer[dataBufferIdx] != LINEFEED )
++ db->fieldQty = 1;
++ while( db->dataBuffer[dataBufferIdx] != 0 || db->dataBuffer[dataBufferIdx+1] != LINEFEED )
+ {
+- if( !db->dataBuffer[dataBufferIdx] )
++ if( db->dataBuffer[dataBufferIdx] == 0 )
+ {
+ db->fieldQty++;
+ }
+@@ -95,23 +95,22 @@
+ db->parent.recordQty = 0;
+ while( dataBufferIdx < dataBufferSize )
+ {
+- while( db->dataBuffer[dataBufferIdx] != LINEFEED )
+- {
+- if( !db->dataBuffer[dataBufferIdx] )
++ if( db->dataBuffer[dataBufferIdx] == 0 )
+ {
+ db->fieldIdx++;
+- }
+- dataBufferIdx++;
+- }
++ if( db->dataBuffer[dataBufferIdx+1] == LINEFEED )
++ {
++ db->parent.recordQty++;
+ if( db->fieldIdx != db->fieldQty )
+ {
+ fprintf( stderr, "%s error: inconsitant field count at record %d. field count is %d and should be %d\n",
+ id, db->parent.recordQty, db->fieldIdx, db->fieldQty );
+ assert(0);
+ }
+- dataBufferIdx++;
+- db->parent.recordQty++;
+ db->fieldIdx = 0;
++ }
++ }
++ dataBufferIdx++;
+ }
+
+ /***************************************************************/
+diff -bBdruN --exclude=.svn --exclude=.private --exclude=PRIVATE --exclude=HTML --exclude=Makefile --exclude=Makefile.in --exclude=Makefile.am --exclude=STABLE-sysutils::Makefile --exclude=aclocal.m4 --exclude=configure --exclude=configure.ac /usr/home/mike/work/portmanager/tags/0.2.6_3/libMG/src/MGdbSeek.c libMG/src/MGdbSeek.c
+--- /usr/home/mike/work/portmanager/tags/0.2.6_3/libMG/src/MGdbSeek.c Tue Feb 8 21:40:10 2005
++++ libMG/src/MGdbSeek.c Fri Feb 11 02:37:16 2005
+@@ -59,15 +59,23 @@
+ assert(0);
+ }
+
++ if( !db->record[0][0] )
++ {
++ fprintf( stderr, "%s error: record 0 field 0 contains nothing!\n",
++ id );
++ fprintf( stderr, "fieldName = %s\ndb->parent.recordQty = %d\ndb->fieldQty = %d\n",
++ fieldName, db->parent.recordQty, db->fieldQty );
++ assert(0);
++ }
++
+ db->fieldIdx = 0;
+ while( strcmp( fieldName, db->record[0][db->fieldIdx] ) )
+ {
+ db->fieldIdx++;
+- if(db->fieldIdx == db->fieldQty)
++ if( db->fieldIdx >= db->fieldQty )
+ {
+ fprintf( stderr, "%s error: field \"%s\" not found in %s\n",
+ id, fieldName, db->parent.path );
+- fflush(stderr);
+ assert(0);
+ }
+ }
+diff -bBdruN --exclude=.svn --exclude=.private --exclude=PRIVATE --exclude=HTML --exclude=Makefile --exclude=Makefile.in --exclude=Makefile.am --exclude=STABLE-sysutils::Makefile --exclude=aclocal.m4 --exclude=configure --exclude=configure.ac /usr/home/mike/work/portmanager/tags/0.2.6_3/libPMGR/src/PMGRrAddDependencies.c ./libPMGR/src/PMGRrAddDependencies.c
+--- /usr/home/mike/work/portmanager/tags/0.2.6_3/libPMGR/src/PMGRrAddDependencies.c Tue Feb 8 21:40:10 2005
++++ ./libPMGR/src/PMGRrAddDependencies.c Fri Feb 11 12:19:17 2005
+@@ -112,6 +112,17 @@
+
+ portDependencyDir--;
+ portDependencyDir[0] = '/';
++/*
++ *
++ * Just a note: Turns out that I had to run while( fflush( dbFileStream ) ) in MGdbAdd to prevent
++ * random LINEFEEDS from being placed into the data base, that may pop up again somewhere so I'll
++ * leave this comment here in the hope it saves some aggravation in the future
++ *
++ */
++/*
++printf( "%s %s DEBUG:\nportName-=>%s\nportDependency-=>%s\nportDependencyDir-=>%s\n%s\n",
++id, VERSION, portName, portDependency, portDependencyDir, "marker" );
++*/
+ MGdbAdd( property->dependencyPortsDb, portName, portDependency, portDependencyDir, NULL );
+ }
+
+diff -bBdruN --exclude=.svn --exclude=.private --exclude=PRIVATE --exclude=HTML --exclude=Makefile --exclude=Makefile.in --exclude=Makefile.am --exclude=STABLE-sysutils::Makefile --exclude=aclocal.m4 --exclude=configure --exclude=configure.ac /usr/home/mike/work/portmanager/tags/0.2.6_3/libPMGR/src/PMGRrDbCreate.c ./libPMGR/src/PMGRrDbCreate.c
+--- /usr/home/mike/work/portmanager/tags/0.2.6_3/libPMGR/src/PMGRrDbCreate.c Tue Feb 8 21:40:10 2005
++++ ./libPMGR/src/PMGRrDbCreate.c Fri Feb 11 03:34:14 2005
+@@ -41,15 +41,6 @@
+ property->objIdx = 0;
+
+ /***************************************************************/
+- /* convert pm-020.conf to config.db */
+- /***************************************************************/
+- PMGRrReadConfigure( property );
+-
+- /*zzzzzzzzzzzzzz*/
+- property->objIdx++;
+- property->configDb = MGdbOpen( property->configDbFileName );
+- /*zzzzzzzzzzzzzz*/
+- /***************************************************************/
+ /* add any ignored ports in config.db to ignore.db */
+ /***************************************************************/
+ IDX_configDb = 1;
+diff -bBdruN --exclude=.svn --exclude=.private --exclude=PRIVATE --exclude=HTML --exclude=Makefile --exclude=Makefile.in --exclude=Makefile.am --exclude=STABLE-sysutils::Makefile --exclude=aclocal.m4 --exclude=configure --exclude=configure.ac /usr/home/mike/work/portmanager/tags/0.2.6_3/libPMGR/src/PMGRrDbDestroy.c ./libPMGR/src/PMGRrDbDestroy.c
+--- /usr/home/mike/work/portmanager/tags/0.2.6_3/libPMGR/src/PMGRrDbDestroy.c Tue Feb 8 21:40:10 2005
++++ ./libPMGR/src/PMGRrDbDestroy.c Fri Feb 11 03:36:08 2005
+@@ -27,9 +27,6 @@
+ char id[] = "PMGRrDbDestroy";
+
+ property->objIdx--;
+- MGdbDestroy( property->configDb );
+-
+- property->objIdx--;
+ MGdbDestroy( property->installedPortsDb );
+
+ property->objIdx--;
+diff -bBdruN --exclude=.svn --exclude=.private --exclude=PRIVATE --exclude=HTML --exclude=Makefile --exclude=Makefile.in --exclude=Makefile.am --exclude=STABLE-sysutils::Makefile --exclude=aclocal.m4 --exclude=configure --exclude=configure.ac /usr/home/mike/work/portmanager/tags/0.2.6_3/libPMGR/src/PMGRrShowLeavesDelete.c ./libPMGR/src/PMGRrShowLeavesDelete.c
+--- /usr/home/mike/work/portmanager/tags/0.2.6_3/libPMGR/src/PMGRrShowLeavesDelete.c Tue Feb 8 21:40:10 2005
++++ ./libPMGR/src/PMGRrShowLeavesDelete.c Fri Feb 11 04:09:26 2005
+@@ -22,6 +22,11 @@
+ /************************************************************************/
+ #include <libPMGR.h>
+ #include <sgtty.h>
++
++int nuke( char* leafPortDir, char* leafPortName );
++int rebuildDb( structProperty* property, int* idx );
++int removePort( char* leafPortName );
++
+ int PMGRrShowLeavesDelete( structProperty* property )
+ {
+ char id[] = "PMGRrShowLeavesDelete";
+@@ -147,7 +152,7 @@
+ {
+ /* nuke() */
+ fprintf( stdout, "<n> Nuking %s\n\n", leafPortName );
+- removePort( leafPortDir, leafPortName );
++ removePort( leafPortName );
+ nuke( leafPortDir, leafPortName );
+ rebuildDb( property, &idx );
+ break;
+@@ -156,7 +161,7 @@
+ {
+ /* nuke() */
+ fprintf( stdout, "<N> Nuking %s\n\n", leafPortName );
+- removePort( leafPortDir, leafPortName );
++ removePort( leafPortName );
+ nuke( leafPortDir, leafPortName );
+ rebuildDb( property, &idx );
+ break;
+@@ -165,7 +170,7 @@
+ {
+ /* delete() */
+ fprintf( stdout, "<x> Removing %s\n\n", leafPortName );
+- removePort( leafPortDir, leafPortName );
++ removePort( leafPortName );
+ rebuildDb( property, &idx );
+ break;
+ }
+@@ -173,7 +178,7 @@
+ {
+ /* delete() */
+ fprintf( stdout, "<X> Removing %s\n\n", leafPortName );
+- removePort( leafPortDir, leafPortName );
++ removePort( leafPortName );
+ rebuildDb( property, &idx );
+ break;
+ }
+@@ -199,7 +204,7 @@
+ }
+
+ /***********************************************************************/
+-int removePort( char* leafPortDir, char* leafPortName )
++int removePort( char* leafPortName )
+ {
+ char* command = NULL;
+ int stringSize = 0;
+@@ -240,6 +245,7 @@
+ return( 0 );
+ }
+
++/***********************************************************************/
+ int rebuildDb( structProperty* property, int* idx )
+ {
+ int errorCode = 0;
+diff -bBdruN --exclude=.svn --exclude=.private --exclude=PRIVATE --exclude=HTML --exclude=Makefile --exclude=Makefile.in --exclude=Makefile.am --exclude=STABLE-sysutils::Makefile --exclude=aclocal.m4 --exclude=configure --exclude=configure.ac /usr/home/mike/work/portmanager/tags/0.2.6_3/libPMGR/src/PMGRrUpgrade.c ./libPMGR/src/PMGRrUpgrade.c
+--- /usr/home/mike/work/portmanager/tags/0.2.6_3/libPMGR/src/PMGRrUpgrade.c Wed Feb 9 07:27:45 2005
++++ ./libPMGR/src/PMGRrUpgrade.c Fri Feb 11 03:44:54 2005
+@@ -56,11 +56,6 @@
+
+ /*zzzzzzzzzzzzzzzzz*/
+ property->objIdx++;
+- property->configDb = MGdbOpen( property->configDbFileName );
+- /*zzzzzzzzzzzzzzzzz*/
+-
+- /*zzzzzzzzzzzzzzzzz*/
+- property->objIdx++;
+ property->installedPortsDb = MGdbOpen( property->installedPortsDbFileName );
+ /*zzzzzzzzzzzzzzzzz*/
+
+@@ -324,12 +319,16 @@
+ property->fieldInstalledPortName,
+ dependencyPortName,
+ property->fieldInstalledPortDir );
++ /*
++ * if !origDir then likely the dependency port has
++ * been updated????? Going to just skip this one...
++ */
+ if( !origDir )
+ {
+ fprintf( stderr,
+ "%s is not located in property->installedPortsDb!\n",
+ dependencyPortName );
+- assert(0);
++ continue;
+ }
+ fprintf( stdout, "\tin %s/+CONTENTS ORIG dir = %s \n\n",
+ dependencyPortName, origDir );
+diff -bBdruN --exclude=.svn --exclude=.private --exclude=PRIVATE --exclude=HTML --exclude=Makefile --exclude=Makefile.in --exclude=Makefile.am --exclude=STABLE-sysutils::Makefile --exclude=aclocal.m4 --exclude=configure --exclude=configure.ac /usr/home/mike/work/portmanager/tags/0.2.6_3/portmanager/portmanager.1 ./portmanager/portmanager.1
+--- /usr/home/mike/work/portmanager/tags/0.2.6_3/portmanager/portmanager.1 Tue Feb 8 21:40:08 2005
++++ ./portmanager/portmanager.1 Wed Feb 9 21:00:11 2005
+@@ -61,6 +61,29 @@
+ .It
+ \fB\&-v\fR portmanager version
+ .El
++.sp
++ \fBWeb site\fR
++.sp
++http://portmanager.sunsite.dk/
++.sp
++ \fBMail lists\fR
++.sp
++portmanager-questions@sunsite.dk
++.sp
++To subscribe send an empty message to:
++ portmanager-questions-subscribe@sunsite.dk
++.sp
++ archive: http://www.mail-archive.com/portmanager-questions%40sunsite.dk/
++.sp
++.sp
++If you would like to joint portmanager's developement team let us know at:
++portmanager-devel@sunsite.dk
++.sp
++To subscribe send an empty message to:
++ portmanager-devel-subscribe@sunsite.dk
++.sp
++ archive: http://www.mail-archive.com/portmanager-devel%40sunsite.dk/
++.sp
+ .\"=======================================================================
+ .\".Sh IMPLEMENTATION NOTES
+ .\"=======================================================================
+diff -bBdruN --exclude=.svn --exclude=.private --exclude=PRIVATE --exclude=HTML --exclude=Makefile --exclude=Makefile.in --exclude=Makefile.am --exclude=STABLE-sysutils::Makefile --exclude=aclocal.m4 --exclude=configure --exclude=configure.ac /usr/home/mike/work/portmanager/tags/0.2.6_3/portmanager/portmanager.c ./portmanager/portmanager.c
+--- /usr/home/mike/work/portmanager/tags/0.2.6_3/portmanager/portmanager.c Tue Feb 8 21:40:08 2005
++++ ./portmanager/portmanager.c Fri Feb 11 04:06:15 2005
+@@ -34,7 +34,6 @@
+ void rHelp( char* id );
+ int main( int argc, char** argv )
+ {
+- FILE* handle = NULL;
+ char h[] = "-h";
+ char help[] = "--help";
+ char id[] = "portmanager";
+@@ -113,6 +112,11 @@
+ property.field3strikesPortDir,
+ property.fieldStrikes,
+ NULL );
++ /*
++ * convert pm-020.conf to config.db
++ */
++ PMGRrReadConfigure( &property );
++ property.configDb = MGdbOpen( property.configDbFileName );
+
+ idx = 1;
+ while( idx < argc )
OpenPOWER on IntegriCloud