svn commit: r496568 - in head/sysutils/unetbootin: . files
Alexey Dokuchaev
danfe at FreeBSD.org
Fri Mar 22 13:37:06 UTC 2019
Author: danfe
Date: Fri Mar 22 13:37:04 2019
New Revision: 496568
URL: https://svnweb.freebsd.org/changeset/ports/496568
Log:
- Resurrect and apply unofficial patch from Gentoo to build against
Qt version 5 (this breaks unetbootin::lstFtpDirFiles() due to
https://bugreports.qt.io/browse/QTBUG-26294)
- Comment out all sources that require FTP LIST command
- Don't wait until file is fully downloaded before dumping it on disk
- Fix some QNetworkReply/QFile resource freeing bugs
- Delete unetbootin::dlprogressupdate64() because it's never used
- Fix some slot warnings while here
Patches by: Valeriy Malov <jazzvoid at gmail.com>
Obtained from: https://bugs.gentoo.org/show_bug.cgi?id=644360
Added:
head/sysutils/unetbootin/
- copied from r495966, head/sysutils/unetbootin/
head/sysutils/unetbootin/files/patch-unetbootin.pro (contents, props changed)
Modified:
head/sysutils/unetbootin/Makefile
head/sysutils/unetbootin/files/patch-main.cpp
head/sysutils/unetbootin/files/patch-unetbootin.cpp
head/sysutils/unetbootin/files/patch-unetbootin.h
Modified: head/sysutils/unetbootin/Makefile
==============================================================================
--- head/sysutils/unetbootin/Makefile Sat Mar 16 21:52:35 2019 (r495966)
+++ head/sysutils/unetbootin/Makefile Fri Mar 22 13:37:04 2019 (r496568)
@@ -12,16 +12,13 @@ COMMENT= Bootable Live USB creator for various Linux d
LICENSE= GPLv2+
-DEPRECATED= Qt4 has been EOL since december 2015
-EXPIRATION_DATE= 2019-03-15
-
RUN_DEPENDS= 7z:archivers/p7zip \
syslinux:sysutils/syslinux \
mke2fs:sysutils/e2fsprogs
-USES= qt:4
-USE_QT= linguisttools_build moc_build qmake_build uic_build \
- corelib gui network
+USES= qt:5
+USE_QT= buildtools_build linguisttools_build qmake_build \
+ core gui network widgets
QMAKE_ARGS= DEFINES+=LOCALBASE=\\\\\\\"${LOCALBASE}\\\\\\\"
NO_WRKSUBDIR= yes
Modified: head/sysutils/unetbootin/files/patch-main.cpp
==============================================================================
--- head/sysutils/unetbootin/files/patch-main.cpp Sat Mar 16 21:52:35 2019 (r495966)
+++ head/sysutils/unetbootin/files/patch-main.cpp Fri Mar 22 13:37:04 2019 (r496568)
@@ -1,6 +1,15 @@
---- main.cpp.orig 2017-04-21 04:57:18 UTC
+--- main.cpp.orig 2016-05-16 08:57:42 UTC
+++ main.cpp
-@@ -292,9 +292,9 @@ int main(int argc, char **argv)
+@@ -9,6 +9,8 @@ This program is distributed in the hope that it will b
+
+ #include "unetbootin.h"
+
++#include <QMessageBox>
++
+ #ifdef Q_OS_WIN32
+
+ void configsysUndo(QString uninstPathL)
+@@ -292,9 +294,9 @@ int main(int argc, char **argv)
}
argsconc += "\"rootcheck=no\"";
argsconcSingleQuote += "'rootcheck=no'";
@@ -12,7 +21,7 @@
gksuarg1 += QString("%1 %2").arg(app.applicationFilePath()).arg(argsconc);
gksuarg1 += QString("'");
QStringList gksuargs;
-@@ -370,7 +370,7 @@ int main(int argc, char **argv)
+@@ -370,7 +372,7 @@ int main(int argc, char **argv)
#ifdef Q_OS_WIN32
QSettings chkinst("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\UNetbootin", QSettings::NativeFormat);
#endif
@@ -21,6 +30,35 @@
QSettings chkinst(QSettings::SystemScope, "UNetbootin");
#endif
#ifndef Q_OS_MAC
+@@ -380,18 +382,16 @@ int main(int argc, char **argv)
+ uninstmsgb.setIcon(QMessageBox::Information);
+ uninstmsgb.setWindowTitle(uninstaller::tr("%1 Uninstaller").arg(UNETBOOTINB));
+ uninstmsgb.setText(uninstaller::tr("%1 is currently installed. Remove the existing version?").arg(UNETBOOTINB));
+- uninstmsgb.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
+- switch (uninstmsgb.exec())
+- {
+- case QMessageBox::Ok:
+- {
+- ubnUninst();
+- }
+- case QMessageBox::Cancel:
+- break;
+- default:
+- break;
+- }
++ uninstmsgb.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
++ switch (uninstmsgb.exec())
++ {
++ case QMessageBox::Ok:
++ ubnUninst();
++ break;
++ case QMessageBox::Cancel:
++ default:
++ break;
++ }
+ return 0;
+ }
+ #endif
@@ -405,7 +405,7 @@ int main(int argc, char **argv)
icon.addFile(":/unetbootin_24.png", QSize(24,24));
icon.addFile(":/unetbootin_32.png", QSize(32,32));
Modified: head/sysutils/unetbootin/files/patch-unetbootin.cpp
==============================================================================
--- head/sysutils/unetbootin/files/patch-unetbootin.cpp Sat Mar 16 21:52:35 2019 (r495966)
+++ head/sysutils/unetbootin/files/patch-unetbootin.cpp Fri Mar 22 13:37:04 2019 (r496568)
@@ -1,6 +1,64 @@
---- unetbootin.cpp.orig 2017-07-14 08:54:12 UTC
+--- unetbootin.cpp.orig 2018-04-28 01:24:54 UTC
+++ unetbootin.cpp
-@@ -301,8 +301,13 @@ bool unetbootin::ubninitialize(QList<QPair<QString, QS
+@@ -9,6 +9,11 @@ This program is distributed in the hope that it will b
+
+ #include "unetbootin.h"
+
++#include <QMessageBox>
++#include <QFileDialog>
++#include <QProgressDialog>
++#include <QDebug>
++
+ static const QList<QRegExp> ignoredtypesbothRL = QList<QRegExp>()
+ << QRegExp("isolinux.bin$", Qt::CaseInsensitive)
+ << QRegExp("isolinux.cfg$", Qt::CaseInsensitive)
+@@ -101,8 +106,8 @@ void callexternappT::run()
+ void callexternappWriteToStdinT::run()
+ {
+ QProcess lnexternapp;
+- lnexternapp.start("\"" + execFile + "\" " + execParm);
+- lnexternapp.write(writeToStdin.toAscii().data());
++ lnexternapp.start("\"" + execFile + "\" " + execParm);
++ lnexternapp.write(writeToStdin.toLatin1().data());
+ lnexternapp.closeWriteChannel();
+ lnexternapp.waitForFinished(-1);
+ retnValu = QString(lnexternapp.readAll());
+@@ -133,16 +138,6 @@ void copyfileT::run()
+ emit finished();
+ }
+
+-ubngetrequestheader::ubngetrequestheader(QString urhost, QString urpath)
+-{
+- this->setRequest("GET", urpath);
+- this->setValue("HOST", urhost);
+- this->setValue("User-Agent", "UNetbootin/1.1.1");
+-// this->setValue("User-Agent", "Wget/1.10.2");
+- this->setValue("Accept", "*/*");
+- this->setValue("Connection", "Keep-Alive");
+-}
+-
+ randtmpfile::randtmpfile(QString rfpath, QString rfextn)
+ {
+ QString basefn = getrandfilename(rfpath, rfextn);
+@@ -159,7 +154,7 @@ QString randtmpfile::getrandfilename(QString rfpath, Q
+ }
+ return basefn;
+ }
+-
++/*
+ void nDirListStor::sAppendSelfUrlInfoList(QUrlInfo curDirUrl)
+ {
+ if (curDirUrl.isValid() && curDirUrl.isReadable() && curDirUrl.isFile() && curDirUrl.size() > nMinFileSizeBytes && curDirUrl.size() < nMaxFileSizeBytes)
+@@ -171,7 +166,7 @@ void nDirListStor::sAppendSelfUrlInfoList(QUrlInfo cur
+ nDirFileListSL.append(curDirUrl.name());
+ }
+ }
+-
++*/
+ unetbootin::unetbootin(QWidget *parent)
+ : QWidget(parent)
+ {
+@@ -301,8 +296,13 @@ bool unetbootin::ubninitialize(QList<QPair<QString, QS
#endif
sevzcommand = locatecommand("7z", tr("either"), "p7zip-full");
#endif // Q_OS_LINUX
@@ -15,8 +73,34 @@
if (ubntmpf.isEmpty() || ubntmpf == "/")
{
ubntmpf = "/tmp/";
-@@ -649,6 +654,57 @@ QStringList unetbootin::listsanedrives()
+@@ -471,19 +471,23 @@ bool unetbootin::ubninitialize(QList<QPair<QString, QS
+ {
+ if (psecond.contains("listdistros", Qt::CaseInsensitive))
+ {
++ QTextStream out(stdout);
+ for (int i = 1; i < this->distroselect->count(); ++i)
+ {
+- printf("%s\n", this->distroselect->itemText(i).toAscii().constData());
++ out << this->distroselect->itemText(i) << endl;
}
++ out.flush();
+ QApplication::exit();
+ exit(0);
+ }
+ else if (psecond.contains("listversions", Qt::CaseInsensitive))
+ {
++ QTextStream out(stdout);
+ for (int i = 0; i < this->dverselect->count(); ++i)
+ {
+- printf("%s\n", this->dverselect->itemText(i).toAscii().constData());
++ out << this->dverselect->itemText(i) << endl;
+ }
++ out.flush();
+ QApplication::exit();
+ exit(0);
+ }
+@@ -649,6 +653,57 @@ QStringList unetbootin::listsanedrives()
+ }
*/
#endif
+#ifdef Q_OS_FREEBSD
@@ -73,7 +157,7 @@
#ifdef Q_OS_MAC
QString systemprofilertext = callexternapp("system_profiler", "SPStorageDataType");
QRegExp filesystemregex("File System: (.+)\\n");
-@@ -669,6 +725,7 @@ for (int i = 0; i < filesystemlist.size(); ++i)
+@@ -669,6 +724,7 @@ for (int i = 0; i < filesystemlist.size(); ++i)
}
#endif
}
@@ -81,9 +165,33 @@
return fulldrivelist;
}
-@@ -1100,7 +1157,12 @@ bool unetbootin::checkifoutofspace(QString destindir)
+@@ -700,17 +756,17 @@ QStringList unetbootin::listalldrives()
+ return fulldrivelist;
+ }
+
+-void unetbootin::on_typeselect_currentIndexChanged(int typeselectIndex)
++void unetbootin::on_typeselect_currentIndexChanged(int)
+ {
+ refreshdriveslist();
+ }
+
+-void unetbootin::on_dverselect_currentIndexChanged()
++void unetbootin::on_dverselect_currentIndexChanged(int)
+ {
+ radioDistro->setChecked(true);
+ }
+
+-void unetbootin::on_diskimagetypeselect_currentIndexChanged()
++void unetbootin::on_diskimagetypeselect_currentIndexChanged(int)
+ {
+ radioFloppy->setChecked(true);
+ }
+@@ -1098,9 +1154,14 @@ bool unetbootin::checkifoutofspace(QString destindir)
+ bool outofspace = false;
+ #ifdef Q_OS_UNIX
struct statfs diskstatS;
- if (!statfs(QString(destindir+"/.").toAscii(), &diskstatS))
+- if (!statfs(QString(destindir+"/.").toAscii(), &diskstatS))
++ if (!statfs(QString(destindir+"/.").toLatin1(), &diskstatS))
{
- if (diskstatS.f_bavail * diskstatS.f_bfree < 1024)
+ /*
@@ -95,7 +203,306 @@
outofspace = true;
}
#endif
-@@ -3412,21 +3474,36 @@ void unetbootin::instIndvfl(QString srcfName, QString
+@@ -2620,31 +2681,27 @@ void unetbootin::downloadfile(QString fileurl, QString
+ {
+ rmFile(targetfile);
+ }
+- QUrl dlurl(fileurl);
+- bool isftp = false;
+- if (dlurl.scheme() == "ftp")
+- {
+- isftp = true;
+- }
+- QHttp dlhttp;
+- QFtp dlftp;
++ QNetworkAccessManager manager;
++ QNetworkRequest dlurl(fileurl);
++ QNetworkReply * networkReply = manager.get(dlurl);
++
+ QEventLoop dlewait;
+ pdesc5->setText("");
+ pdesc4->setText(tr("Downloading files, please wait..."));
+ pdesc3->setText(tr("<b>Source:</b> <a href=\"%1\">%1</a>").arg(fileurl));
+ pdesc2->setText(tr("<b>Destination:</b> %1").arg(targetfile));
+ pdesc1->setText(tr("<b>Downloaded:</b> 0 bytes"));
+- QString realupath = QString(fileurl).remove(0, fileurl.indexOf(QString("://%1").arg(dlurl.host())) + QString("://%1").arg(dlurl.host()).length());
+- if (isftp)
+- {
+- connect(&dlftp, SIGNAL(done(bool)), &dlewait, SLOT(quit()));
+- connect(&dlftp, SIGNAL(dataTransferProgress(qint64, qint64)), this, SLOT(dlprogressupdate64(qint64, qint64)));
+- }
+- else
+- {
+- connect(&dlhttp, SIGNAL(done(bool)), &dlewait, SLOT(quit()));
+- connect(&dlhttp, SIGNAL(dataReadProgress(int, int)), this, SLOT(dlprogressupdate(int, int)));
+- }
++
++ QUrl redirectUrl;
++ bool downloadFailed = false;
++ QNetworkReply::NetworkError errorCode;
++
++ connect(networkReply, &QNetworkReply::finished, &dlewait, &QEventLoop::quit);
++ connect(networkReply, &QNetworkReply::downloadProgress, this, &unetbootin::dlprogressupdate64);
++ connect(networkReply, &QNetworkReply::redirected, [&](const QUrl &url){ redirectUrl = url; });
++ connect(networkReply, static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error),
++ [&](QNetworkReply::NetworkError code){ downloadFailed = true; errorCode = code; });
++
+ QFile dloutfile;
+ if (installType == tr("USB Drive"))
+ {
+@@ -2655,82 +2712,38 @@ void unetbootin::downloadfile(QString fileurl, QString
+ dloutfile.setFileName(targetfile);
+ }
+ dloutfile.open(QIODevice::WriteOnly);
+- if (isftp)
+- {
+- dlftp.connectToHost(dlurl.host());
+- dlftp.login();
+- dlftp.get(realupath, &dloutfile);
+- }
+- else
+- {
+- dlhttp.setHost(dlurl.host());
+- ubngetrequestheader dlrequest(dlurl.host(), realupath);
+- dlhttp.request(dlrequest, 0, &dloutfile);
+- }
++
++ connect(networkReply, &QNetworkReply::downloadProgress, [&](qint64, qint64){
++ dloutfile.write(networkReply->readAll());
++ });
++
+ dlewait.exec();
+- if (!isftp)
++
++ if (!redirectUrl.isEmpty())
+ {
+- QHttpResponseHeader dlresponse(dlhttp.lastResponse());
+- int dlrstatus = dlresponse.statusCode();
+- if (dlrstatus >= 300 && dlrstatus < 400 && dlresponse.hasKey("Location"))
+- {
+- dloutfile.close();
+- rmFile(dloutfile);
+- downloadfile(dlresponse.value("Location"), targetfile, minsize);
+- return;
+- }
++ networkReply->deleteLater();
++ downloadfile(redirectUrl.toString(), targetfile, minsize);
++ return;
+ }
+- if (isftp)
++
++ if (downloadFailed)
+ {
+- dlftp.close();
++ qDebug() << "Failed to download URL: " << fileurl;
++ qDebug() << "Error code: " << errorCode;
++ qDebug() << "Error string: " << networkReply->errorString();
++ networkReply->deleteLater();
++ showDownloadFailedScreen(fileurl);
++ return;
+ }
+- else
+- {
+- dlhttp.close();
+- }
++
++ dloutfile.write(networkReply->readAll());
++ networkReply->deleteLater();
+ dloutfile.close();
+ if (installType == tr("USB Drive"))
+ {
+ dloutfile.rename(targetfile);
+ }
+- if (QFile(targetfile).size() <= 4096)
+- {
+- QString redirectTargetURL;
+- QFile seeRedirect(targetfile);
+- seeRedirect.open(QIODevice::ReadOnly | QIODevice::Text);
+- QTextStream seeRedirectTextStream(&seeRedirect);
+- while (!seeRedirectTextStream.atEnd())
+- {
+- QString curline = seeRedirectTextStream.readLine();
+- if (curline.contains("content=\"0;url="))
+- {
+- int urlstartidx = curline.indexOf("content=\"0;url=") + QString("content=\"0;url=").size();
+- redirectTargetURL = curline.mid(urlstartidx);
+- if (redirectTargetURL.contains("\""))
+- {
+- redirectTargetURL = redirectTargetURL.left(redirectTargetURL.indexOf("\""));
+- }
+- break;
+- }
+- if (curline.contains("content='0;url="))
+- {
+- int urlstartidx = curline.indexOf("content='0;url=") + QString("content='0;url=").size();
+- redirectTargetURL = curline.mid(urlstartidx);
+- if (redirectTargetURL.contains("'"))
+- {
+- redirectTargetURL = redirectTargetURL.left(redirectTargetURL.indexOf("'"));
+- }
+- break;
+- }
+- }
+- seeRedirect.close();
+- if (!redirectTargetURL.isEmpty())
+- {
+- rmFile(targetfile);
+- downloadfile(redirectTargetURL, targetfile, minsize);
+- return;
+- }
+- }
++
+ if (QFile(targetfile).size() < minsize)
+ {
+ // download failed
+@@ -2745,7 +2758,8 @@ void unetbootin::downloadfile(QString fileurl, QString
+ if (testingDownload)
+ {
+ // Note that this only tests that the first download succeeds
+- printf("exitstatus:downloadcomplete\n");
++ QTextStream out(stdout);
++ out << "exitstatus:downloadcomplete" << endl << flush;
+ QApplication::exit();
+ exit(0);
+ }
+@@ -2761,40 +2775,26 @@ void unetbootin::showDownloadFailedScreen(const QStrin
+ this->downloadFailed = true;
+ if (exitOnCompletion)
+ {
+- printf("exitstatus:downloadfailed\n");
++ QTextStream out(stdout);
++ out << "exitstatus:downloadfailed" << endl << flush;
+ QApplication::exit();
+ exit(0);
+ }
+ }
+
+-void unetbootin::dlprogressupdate(int dlbytes, int maxbytes)
+-{
+- QTime time = QTime::currentTime();
+- static int oldsec = 0;
+- // refresh the progress bar every second
+- if(oldsec != time.second())
+- {
+- oldsec = time.second();
+- tprogress->setValue(dlbytes);
+- tprogress->setMaximum(maxbytes);
+- // display the downloaded size with suffix
+- pdesc1->setText(tr("<b>Downloaded:</b> %1 of %2").arg(displayfisize(dlbytes)).arg(displayfisize(maxbytes)));
+- }
+-}
+-
+ void unetbootin::dlprogressupdate64(qint64 dlbytes, qint64 maxbytes)
+ {
+- QTime time = QTime::currentTime();
+- static int oldsec = 0;
+- // refresh the progress bar every second
+- if(oldsec != time.second())
+- {
+- oldsec = time.second();
+- tprogress->setValue(dlbytes);
+- tprogress->setMaximum(maxbytes);
+- // display the downloaded size with suffix
+- pdesc1->setText(tr("<b>Downloaded:</b> %1 of %2").arg(displayfisize(dlbytes)).arg(displayfisize(maxbytes)));
+- }
++ QTime time = QTime::currentTime();
++ static int oldsec = 0;
++ // refresh the progress bar every second
++ if(oldsec != time.second())
++ {
++ oldsec = time.second();
++ tprogress->setValue(dlbytes);
++ tprogress->setMaximum(maxbytes);
++ // display the downloaded size with suffix
++ pdesc1->setText(tr("<b>Downloaded:</b> %1 of %2").arg(displayfisize(dlbytes)).arg(displayfisize(maxbytes)));
++ }
+ }
+
+ void unetbootin::cpprogressupdate64(qint64 dlbytes, qint64 maxbytes)
+@@ -2812,31 +2812,35 @@ void unetbootin::cpprogressupdate64(qint64 dlbytes, qi
+ }
+ }
+
+-QString unetbootin::downloadpagecontents(QString pageurl)
++QString unetbootin::downloadpagecontents(QUrl pageurl)
+ {
+- QUrl pgurl(pageurl);
+- QHttp pghttp;
++ QNetworkAccessManager manager;
++ QNetworkRequest dlurl(pageurl);
++ QNetworkReply * networkReply = manager.get(dlurl);
+ QEventLoop pgwait;
+- connect(&pghttp, SIGNAL(done(bool)), &pgwait, SLOT(quit()));
+- pghttp.setHost(pgurl.host());
+- QString realpgupath = QString(pageurl).remove(0, pageurl.indexOf(QString("://%1").arg(pgurl.host())) + QString("://%1").arg(pgurl.host()).length());
+- ubngetrequestheader pgrequest(pgurl.host(), realpgupath);
+- pghttp.request(pgrequest);
++ QUrl redirectUrl;
++ connect(networkReply, &QNetworkReply::finished, &pgwait, &QEventLoop::quit);
++ connect(networkReply, &QNetworkReply::redirected, [&redirectUrl](const QUrl &url){ redirectUrl = url; });
++
+ pgwait.exec();
+- QHttpResponseHeader pgresponse(pghttp.lastResponse());
+- int pgrstatus = pgresponse.statusCode();
+- if (pgrstatus >= 300 && pgrstatus < 400 && pgresponse.hasKey("Location"))
++
++ if (!redirectUrl.isEmpty())
+ {
+- return downloadpagecontents(pgresponse.value("Location"));
++ networkReply->deleteLater();
++ return downloadpagecontents(redirectUrl);
+ }
+- else
+- {
+- return QString(pghttp.readAll());
+- }
++
++ QString result = networkReply->readAll();
++ networkReply->close();
++ networkReply->deleteLater();
++ return result;
+ }
+
+ QStringList unetbootin::lstFtpDirFiles(QString ldfDirStringUrl, int ldfMinSize, int ldfMaxSize)
+ {
++ qDebug() << "lstFtpDirFiles called for " << ldfDirStringUrl;
++ return {};
++/*
+ QUrl ldfDirUrl(ldfDirStringUrl);
+ QFtp ldfFtp;
+ QEventLoop ldfWait;
+@@ -2851,14 +2855,14 @@ QStringList unetbootin::lstFtpDirFiles(QString ldfDirS
+ ldfFtp.list(ldfDirUrl.path());
+ ldfWait.exec();
+ ldfFtp.close();
+- return nDirListStorL.nDirFileListSL;
++ return nDirListStorL.nDirFileListSL;*/
+ }
+
+ QStringList unetbootin::lstHttpDirFiles(QString ldfDirStringUrl)
+ {
+ QStringList relativefilelinksL;
+ QStringList relativelinksLPreFilter =
+- downloadpagecontents(ldfDirStringUrl)
++ downloadpagecontents(QUrl(ldfDirStringUrl))
+ .replace(">", ">\n")
+ .replace("<", "\n<")
+ .split("\n");
+@@ -3218,11 +3222,11 @@ int unetbootin::letterToNumber(QChar lettertoconvert)
+ {
+ if (lettertoconvert.isLower())
+ {
+- return static_cast<int>(lettertoconvert.toAscii() - 'a');
++ return static_cast<int>(lettertoconvert.toLatin1() - 'a');
+ }
+ if (lettertoconvert.isUpper())
+ {
+- return static_cast<int>(lettertoconvert.toAscii() - 'A');
++ return static_cast<int>(lettertoconvert.toLatin1() - 'A');
+ }
+ else
+ {
+@@ -3412,21 +3416,36 @@ void unetbootin::instIndvfl(QString srcfName, QString
srcF.setFileName(QFile::exists("/usr/share/syslinux/memdisk") ? "/usr/share/syslinux/memdisk" : "/usr/lib/syslinux/memdisk");
else if (srcfName == "menu.c32")
{
@@ -132,7 +539,7 @@
}
else if (srcfName == "mbr.bin")
{
-@@ -3516,11 +3593,19 @@ void unetbootin::runinst()
+@@ -3516,11 +3535,19 @@ void unetbootin::runinst()
}
if (installType == tr("USB Drive"))
{
@@ -152,7 +559,7 @@
}
#ifdef Q_OS_LINUX
if (targetDev.contains(QRegExp("p\\d$")))
-@@ -3528,7 +3613,7 @@ void unetbootin::runinst()
+@@ -3528,7 +3555,7 @@ void unetbootin::runinst()
else
rawtargetDev = QString(targetDev).remove(QRegExp("\\d$"));
#endif
@@ -161,7 +568,7 @@
rawtargetDev = QString(targetDev).remove(QRegExp("s\\d$"));
#endif
#endif
-@@ -3724,7 +3809,7 @@ void unetbootin::writegrub2cfg()
+@@ -3724,7 +3751,7 @@ void unetbootin::writegrub2cfg()
QString menulstxt = QString(
"%9\n\n"
#ifndef NODEFAULTBOOT
@@ -170,7 +577,7 @@
"\tset root=%8\n"
"\t%1 %2 %3 %4\n"
"\t%5 %6 %7\n"
-@@ -3845,7 +3930,7 @@ void unetbootin::runinsthdd()
+@@ -3845,7 +3872,7 @@ void unetbootin::runinsthdd()
"timeout 10\n"
#endif
#ifndef NODEFAULTBOOT
@@ -179,7 +586,7 @@
#ifdef Q_OS_WIN32
"find --set-root %3\n"
#endif
-@@ -4281,21 +4366,47 @@ void unetbootin::runinstusb()
+@@ -4281,21 +4308,47 @@ void unetbootin::runinstusb()
instIndvfl("libutil.c32", QString("%1libutil.c32").arg(targetPath));
instIndvfl("libcom32.c32", QString("%1libcom32.c32").arg(targetPath));
}
@@ -238,7 +645,7 @@
if (this->persistenceSpaceMB > 0)
{
pdesc1->setText(tr("Setting up persistence"));
-@@ -4334,6 +4445,20 @@ void unetbootin::fininstall()
+@@ -4334,6 +4387,20 @@ void unetbootin::fininstall()
rmFile(mke2fscommand);
#endif
}
@@ -259,7 +666,7 @@
pdesc1->setText("");
progresslayer->setEnabled(false);
progresslayer->hide();
-@@ -4343,7 +4468,7 @@ void unetbootin::fininstall()
+@@ -4343,7 +4410,7 @@ void unetbootin::fininstall()
sdesc4->setText(QString("<b>%1 %2</b>").arg(sdesc4->text()).arg(trcurrent));
if (installType == tr("Hard Disk"))
{
@@ -268,3 +675,13 @@
}
if (installType == tr("USB Drive"))
{
+@@ -4357,7 +4424,8 @@ void unetbootin::fininstall()
+ finishLogging();
+ if (exitOnCompletion)
+ {
+- printf("exitstatus:success\n");
++ QTextStream out(stdout);
++ out << "exitstatus:success" << endl << flush;
+ QApplication::exit();
+ exit(0);
+ }
Modified: head/sysutils/unetbootin/files/patch-unetbootin.h
==============================================================================
--- head/sysutils/unetbootin/files/patch-unetbootin.h Sat Mar 16 21:52:35 2019 (r495966)
+++ head/sysutils/unetbootin/files/patch-unetbootin.h Fri Mar 22 13:37:04 2019 (r496568)
@@ -1,4 +1,4 @@
---- unetbootin.h.orig 2017-07-14 05:31:37 UTC
+--- unetbootin.h.orig 2018-04-28 01:24:54 UTC
+++ unetbootin.h
@@ -35,6 +35,10 @@ This program is distributed in the hope that it will b
#include <sys/vfs.h>
@@ -11,7 +11,46 @@
#ifdef AUTOSUPERGRUBDISK
#define UNETBOOTINB "Auto Super Grub Disk"
#define NOEXTERN
-@@ -333,6 +337,7 @@ class unetbootin : public QWidget, private Ui::unetboo
+@@ -152,19 +156,13 @@ signals:
+ void finished();
+ };
+
+-class ubngetrequestheader : public QHttpRequestHeader
+-{
+-public:
+- ubngetrequestheader(QString urhost, QString urpath);
+-};
+-
+ class randtmpfile : public QFile
+ {
+ public:
+ randtmpfile(QString rfpath, QString rfextn);
+ static QString getrandfilename(QString rfpath, QString rfextn);
+ };
+-
++/*
+ class nDirListStor : public QObject
+ {
+ Q_OBJECT
+@@ -178,7 +176,7 @@ class nDirListStor : public QObject (public)
+ public slots:
+ void sAppendSelfUrlInfoList(QUrlInfo curDirUrl);
+ };
+-
++*/
+ class unetbootin : public QWidget, private Ui::unetbootinui
+ {
+ Q_OBJECT
+@@ -280,7 +278,7 @@ class unetbootin : public QWidget, private Ui::unetboo
+ QString searchforgrub2includesfile(QString includesfile, QString archivefile, QStringList archivefileconts, QStringList visitedincludes);
+ QPair<QPair<QStringList, QStringList>, QPair<QStringList, QStringList> > searchforgrub2includesfileL(QString includesfile, QString archivefile, QStringList archivefileconts, QStringList visitedincludes);
+ void downloadfile(QString fileurl, QString targetfile, int minsize);
+- QString downloadpagecontents(QString pageurl);
++ QString downloadpagecontents(QUrl pageurl);
+ QStringList lstFtpDirFiles(QString ldfDirStringUrl, int ldfMinSize, int ldfMaxSize);
+ QStringList lstHttpDirFiles(QString ldfDirStringUrl);
+ QStringList lstNetDirFiles(QString ldfDirStringUrl, int ldfMinSize, int ldfMaxSize);
+@@ -333,6 +331,7 @@ class unetbootin : public QWidget, private Ui::unetboo
void logText(const QString &text);
void finishLogging();
void writeTextToFile(const QString &text, const QString &filePath);
@@ -19,3 +58,24 @@
void fininstall();
void rmFile(const QString &fn);
void rmFile(QFile &fn);
+@@ -342,9 +341,9 @@ class unetbootin : public QWidget, private Ui::unetboo
+
+ private slots:
+ void on_distroselect_currentIndexChanged(int distroselectIndex);
+- void on_typeselect_currentIndexChanged(int typeselectIndex);
+- void on_dverselect_currentIndexChanged();
+- void on_diskimagetypeselect_currentIndexChanged();
++ void on_typeselect_currentIndexChanged(int);
++ void on_dverselect_currentIndexChanged(int);
++ void on_diskimagetypeselect_currentIndexChanged(int);
+ void on_FloppyFileSelector_clicked();
+ void on_KernelFileSelector_clicked();
+ void on_InitrdFileSelector_clicked();
+@@ -353,7 +352,6 @@ private slots:
+ void on_fexitbutton_clicked();
+
+ public slots:
+- void dlprogressupdate(int dlbytes, int maxbytes);
+ void dlprogressupdate64(qint64 dlbytes, qint64 maxbytes);
+ void cpprogressupdate64(qint64 dlbytes, qint64 maxbytes);
+ void on_okbutton_clicked();
Added: head/sysutils/unetbootin/files/patch-unetbootin.pro
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/sysutils/unetbootin/files/patch-unetbootin.pro Fri Mar 22 13:37:04 2019 (r496568)
@@ -0,0 +1,23 @@
+--- unetbootin.pro.orig 2018-04-28 09:30:55 UTC
++++ unetbootin.pro
+@@ -2,18 +2,18 @@ TEMPLATE = app
+ TARGET = unetbootin
+ DEPENDPATH += .
+ INCLUDEPATH += .
+-CONFIG += release \
+- static
+
+ HEADERS += unetbootin.h
+ FORMS += unetbootin.ui
+ SOURCES += main.cpp \
+ unetbootin.cpp \
++ customdistrolst.cpp \
+ distrolst.cpp \
+ distrover.cpp \
+ distrovercust.cpp
+ QT += core \
+ gui \
++ widgets \
+ network
+ ICON = unetbootin.icns
+ TRANSLATIONS += unetbootin.ts \
More information about the svn-ports-head
mailing list