Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:pcbsd/pcbsd
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Moore committed Sep 25, 2013
2 parents 108626c + 5e0ae79 commit cec4c86
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
6 changes: 4 additions & 2 deletions build-files/ports-overlay/sysutils/grub2/Makefile
@@ -1,5 +1,5 @@
# Created by: sem@FreeBSD.org
# $FreeBSD: sysutils/grub2/Makefile 316596 2013-04-26 10:44:28Z ak $
# $FreeBSD$

PORTNAME= grub2
PORTVERSION= 2.00
Expand All @@ -17,8 +17,9 @@ BUILD_DEPENDS= ${LOCALBASE}/bin/flex:${PORTSDIR}/textproc/flex \
help2man:${PORTSDIR}/misc/help2man

CONFLICTS= grub-0*
SSP_UNSAFE= yes
USE_XZ= yes
USE_GCC= 4.6+
USE_GCC= yes
USE_AUTOTOOLS= automake aclocal autoconf
ACLOCAL_ARGS= -Im4
GNU_CONFIGURE= yes
Expand All @@ -44,6 +45,7 @@ MAN8= grub-reboot.8 grub-set-default.8 grub-probe.8 \
grub-mkconfig.8 grub-bios-setup.8 grub-mknetdir.8 \
grub-install.8 grub-sparc64-setup.8 grub-ofpathname.8

NO_STAGE= yes
.include <bsd.port.pre.mk>

.if ${ARCH} != "amd64"
Expand Down
1 change: 1 addition & 0 deletions src-qt4/libpcbsd/utils/pcbsd-utils.h
Expand Up @@ -130,6 +130,7 @@ class Utils
static QString getMasterMirror();
static bool setValPBIConf(QString key, QString val);
static bool setValSHFile(QString, QString, QString);
static bool setValSHFile(QString, QString, QString, QString);
static bool setValCSHFile(QString, QString, QString);
static bool setValPCBSDConf(QString key, QString val);
static bool setValPCConf(QString conf, QString key, QString val);
Expand Down
28 changes: 18 additions & 10 deletions src-qt4/libpcbsd/utils/utils.cpp
Expand Up @@ -144,9 +144,13 @@ QString Utils::getValFromSHFile(QString envFile, QString envVal)
while ( !stream.atEnd() ) {
line = stream.readLine();
if ( line.indexOf(envVal + "=") == 0 ) {
// Strip any ""
line.replace(envVal + "=", "");

// Remove the ' or " from variable
if ( line.indexOf("'") == 0 ) {
line = line.section("'", 1, 1);
line = line.section("'", 0, 0);
}
if ( line.indexOf('"') == 0 ) {
line = line.section('"', 1, 1);
line = line.section('"', 0, 0);
Expand Down Expand Up @@ -182,8 +186,12 @@ QString Utils::getValFromCSHFile(QString envFile, QString envVal)
return QString();
}


bool Utils::setValSHFile(QString envFile, QString envName, QString envVal)
{
return setValSHFile(envFile, envName, envVal, QString('"'));
}

bool Utils::setValSHFile(QString envFile, QString envName, QString envVal, QString quote)
{
QFile confFile(envFile);
if ( ! confFile.open( QIODevice::ReadOnly ) )
Expand All @@ -198,7 +206,7 @@ bool Utils::setValSHFile(QString envFile, QString envName, QString envVal)
line = stream.readLine();
if ( line.indexOf(envName + "=") == 0 ) {
if ( ! envVal.isEmpty() && ! added )
shConf << envName + "=\"" + envVal + "\" ; export " + envName;
shConf << envName + "=" + quote + envVal + quote + " ; export " + envName;
added = true;
} else {
shConf << line;
Expand All @@ -208,7 +216,7 @@ bool Utils::setValSHFile(QString envFile, QString envName, QString envVal)
confFile.close();

if (! added && ! envVal.isEmpty() )
shConf << envName + "=\"" + envVal + "\" ; export " + envName;
shConf << envName + "=" + quote + envVal + quote + " ; export " + envName;

if ( confFile.open( QIODevice::WriteOnly ) ) {
QTextStream stream( &confFile );
Expand Down Expand Up @@ -277,7 +285,7 @@ QString Utils::getProxyPass() {
QString val = getValFromSHFile("/etc/profile", "HTTP_PROXY_AUTH");
if ( val.isEmpty() )
return QString();
return val.section(":", 3, 3).section("'", 1, 1);
return val.section(":", 3, 3);
}

QString Utils::getProxyType() {
Expand Down Expand Up @@ -361,18 +369,18 @@ bool Utils::setProxyAddress(QString val) {
setValCSHFile(QString("/etc/csh.cshrc"), QString("http_proxy"), val);
setValCSHFile(QString("/etc/csh.cshrc"), QString("https_proxy"), val);
setValCSHFile(QString("/etc/csh.cshrc"), QString("no_proxy"), "127.0.0.1,localhost");
setValSHFile(QString("/etc/profile"), QString("HTTP_PROXY"), val);
setValSHFile(QString("/etc/profile"), QString("HTTPS_PROXY"), val);
setValSHFile(QString("/etc/profile"), QString("HTTP_PROXY"), val, "'");
setValSHFile(QString("/etc/profile"), QString("HTTPS_PROXY"), val, "'");
setValSHFile(QString("/etc/profile"), QString("NO_PROXY"), "127.0.0.1,localhost");
setValSHFile(QString("/etc/profile"), QString("http_proxy"), val);
setValSHFile(QString("/etc/profile"), QString("https_proxy"), val);
setValSHFile(QString("/etc/profile"), QString("http_proxy"), val, "'");
setValSHFile(QString("/etc/profile"), QString("https_proxy"), val, "'");
setValSHFile(QString("/etc/profile"), QString("no_proxy"), "127.0.0.1,localhost");
return true;
}

bool Utils::setProxyAuth(QString val) {
setValCSHFile(QString("/etc/csh.cshrc"), QString("HTTP_PROXY_AUTH"), val);
return setValSHFile(QString("/etc/profile"), QString("HTTP_PROXY_AUTH"), val);
return setValSHFile(QString("/etc/profile"), QString("HTTP_PROXY_AUTH"), val, "'");
}

bool Utils::setMasterMirror(QString val) {
Expand Down
2 changes: 1 addition & 1 deletion src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp
Expand Up @@ -1038,7 +1038,7 @@ void NetworkMan::saveProxyConfig()
else
authLine="digest:*:";
authLine += lineProxyUser->text() + ":";
authLine += "'" + lineProxyPass->text() + "'";
authLine += lineProxyPass->text();
pcbsd::Utils::setProxyAuth(authLine);
}
QMessageBox::warning( this, tr("Proxy enabled"), tr("You may need to re-login for proxy settings to take effect."));
Expand Down
1 change: 1 addition & 0 deletions src-qt4/port-files/Makefile
Expand Up @@ -35,6 +35,7 @@ USE_QT4= accessible \

WRKSRC= ${WRKDIR}/src-qt4
HAS_CONFIGURE= yes
NO_STAGE= yes

QMAKE_PRO= src-qt4.pro
QMAKE_ARGS= -recursive ${QMAKE_PRO}
Expand Down
1 change: 1 addition & 0 deletions src-sh/port-files/Makefile
Expand Up @@ -27,6 +27,7 @@ RUN_DEPENDS= pkg-static:${PORTSDIR}/ports-mgmt/pkg \
WRKSRC= ${WRKDIR}/src-sh
CONFLICTS?= pbi-manager-[0-9]*
NO_BUILD= yes
NO_STAGE= yes
USE_BZIP2= yes
USE_PYTHON= yes

Expand Down

0 comments on commit cec4c86

Please sign in to comment.