diff options
author | Andrej Zverev <az@FreeBSD.org> | 2005-11-26 07:19:59 +0000 |
---|---|---|
committer | Andrej Zverev <az@FreeBSD.org> | 2005-11-26 07:19:59 +0000 |
commit | 89a2bf1f8b55e58f70ca106e02bf0da8467e78fc (patch) | |
tree | b57cdf9aa937acb0e0db8b05d49c504d26024fc8 /sysutils | |
parent | 3676ab170b2a295c77834f6b2cc560f143baca11 (diff) | |
download | ports-89a2bf1f8b55e58f70ca106e02bf0da8467e78fc.tar.gz ports-89a2bf1f8b55e58f70ca106e02bf0da8467e78fc.zip |
- Fixes portmanager seg faulting if either /usr/local/etc/pkgtools.conf or
/usr/local/bin/ruby are not installed.
PR: ports/89564
Submitted by: Michael C. Shultz (maintainer)
Notes
Notes:
svn path=/head/; revision=149549
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/portmanager/Makefile | 2 | ||||
-rw-r--r-- | sysutils/portmanager/files/patch-0.3.9_2 | 81 |
2 files changed, 82 insertions, 1 deletions
diff --git a/sysutils/portmanager/Makefile b/sysutils/portmanager/Makefile index f97e4b06b3ff..0c8ce0469d85 100644 --- a/sysutils/portmanager/Makefile +++ b/sysutils/portmanager/Makefile @@ -7,7 +7,7 @@ PORTNAME= portmanager PORTVERSION= 0.3.9 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= http://portmanager.sunsite.dk/distfiles/ \ ${MASTER_SITE_SOURCEFORGE} diff --git a/sysutils/portmanager/files/patch-0.3.9_2 b/sysutils/portmanager/files/patch-0.3.9_2 new file mode 100644 index 000000000000..540f6e79f96a --- /dev/null +++ b/sysutils/portmanager/files/patch-0.3.9_2 @@ -0,0 +1,81 @@ +diff -ruN ../0.3.9_1/libMGPM/src/MGPMrCommandLine.c ./libMGPM/src/MGPMrCommandLine.c +--- ../0.3.9_1/libMGPM/src/MGPMrCommandLine.c Fri Nov 25 11:47:19 2005 ++++ ./libMGPM/src/MGPMrCommandLine.c Fri Nov 25 18:58:23 2005 +@@ -96,6 +96,7 @@ + property.pristine = 0; /* 1 = run in pristine mode */ + property.resume = 0; /* 1 = portmanager updated itself, don't rebuild databases in -u -f mode */ + property.timeout = 300; /* default timeout in seconds */ ++ property.NoPkgtools = 0; /* 1 = pkgtools.conf or ruby not installed */ + + if( argv[2] && strcmp( "package-depends", argv[2] ) == 0 ) + { +diff -ruN ../0.3.9_1/libMGPM/src/MGPMrReadConfigure.c ./libMGPM/src/MGPMrReadConfigure.c +--- ../0.3.9_1/libMGPM/src/MGPMrReadConfigure.c Fri Nov 25 11:47:19 2005 ++++ ./libMGPM/src/MGPMrReadConfigure.c Fri Nov 25 19:06:25 2005 +@@ -164,16 +164,27 @@ + strcat( command, "/pkgtools.db" ); + rReadConfigureAwkConfigure( property, configFileNameOld, command ); + } ++ else ++ { ++ property->NoPkgtools = 1; ++ } ++ } ++ else ++ { ++ property->NoPkgtools = 1; + } +- + strcpy( command, SHAREDIR ); + strcat( command, "/pkgtools.db" ); +- rReadConfigureCleanPkgToolsDb( property, command ); +- strcpy( command, "cat " ); +- strcat( command, SHAREDIR ); +- strcat( command, "/pkgtools.db >>" ); +- strcat( command, property->configDbFileName ); +- system( command ); ++ ++ if( property->NoPkgtools == 0 ) ++ { ++ rReadConfigureCleanPkgToolsDb( property, command ); ++ strcpy( command, "cat " ); ++ strcat( command, SHAREDIR ); ++ strcat( command, "/pkgtools.db >>" ); ++ strcat( command, property->configDbFileName ); ++ system( command ); ++ } + + /* + strcpy( command, "rm -f " ); +@@ -441,8 +452,16 @@ + + value = calloc( 0xfff, 1 ); + +- pkgtoolsDb = MGdbOpen( pkgtoolsFileName ); +- pkgtoolsQTY = MGdbGetRecordQty( pkgtoolsDb ); ++ if( MGrIfFileExist( pkgtoolsFileName ) ) ++ { ++ pkgtoolsDb = MGdbOpen( pkgtoolsFileName ); ++ pkgtoolsQTY = MGdbGetRecordQty( pkgtoolsDb ); ++ } ++ else ++ { ++ free( value ); ++ return( 1 ); ++ } + + while( pkgtoolsIDX < pkgtoolsQTY ) + { +diff -ruN ../0.3.9_1/libMGPM/src/libMGPM.h ./libMGPM/src/libMGPM.h +--- ../0.3.9_1/libMGPM/src/libMGPM.h Fri Nov 25 11:47:19 2005 ++++ ./libMGPM/src/libMGPM.h Fri Nov 25 18:57:49 2005 +@@ -146,7 +146,8 @@ + char* configConfFileName; + char* helpFile; + int timeOut; /* see MGPMrGetPortName.c */ +- ++ int NoPkgtools; /* 1 = pkgtools.conf or ruby not installed */ ++ + /* + * data base structures/file names/fieldnames + */ |