From 335a3a0cdb9098bbad32bf06cf64c9eed22d11e7 Mon Sep 17 00:00:00 2001 From: Felix Kauselmann Date: Wed, 6 Jun 2018 13:12:29 +0200 Subject: [PATCH 1/4] Update mktarball.sh for git usage (needs .gitattributes). --- .gitattributes | 8 ++++++++ mktarball.sh | 15 +++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..8d4a272b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +# List files and directories to exclude from git archive +/dependencies/pdfium export-ignore +/dependencies/poppler export-ignore +/dependencies/qrencode export-ignore +/dependencies/unarr export-ignore +/dependencies/create-dmg export-ignore +.gitignore export-ignore +.gitattributes export-ignore diff --git a/mktarball.sh b/mktarball.sh index ee56c4a1..d27489f7 100755 --- a/mktarball.sh +++ b/mktarball.sh @@ -1,20 +1,19 @@ #! /bin/bash #Script to create a source tarball for YACReader distribution and packaging -#This should be run from YACReaders top source directory +#By default this will use the latest git tag for the current branch or whatever +#version supplied as argument +#This should be run from YACReader's top source directory -YACVERSION=9.0.0 +YACVERSION=${1:-`git describe --long --tags`} if [ ! -f "yacreader-${YACVERSION}-src.tar.xz" ] then - echo "Building source tarball" + echo "Building source tarball for ${YACVERSION}" else - echo "Updating source tarball" + echo "Updating source tarball for ${YACVERSION}" rm yacreader-${YACVERSION}-src.tar* #delete old tarball, since tar can't update compressed archives fi -hg archive -t tar -p yacreader-${YACVERSION} -X "dependencies/{unarr,pdfium,poppler}"\ - yacreader-${YACVERSION}-src.tar -xz -c yacreader-${YACVERSION}-src.tar > yacreader-${YACVERSION}-src.tar.xz -rm yacreader-${YACVERSION}-src.tar +git archive --format=tar --prefix=yacreader-${YACVERSION}/ HEAD | xz -c > yacreader-${YACVERSION}-src.tar.xz #Calculate checksum to enable packagers to verify whether they are using the original tarball. md5sum yacreader-${YACVERSION}-src.tar.xz > yacreader-${YACVERSION}-src.tar.xz.md5sum From a2c0c65006f00e5924ce9636749ca47c570680cc Mon Sep 17 00:00:00 2001 From: Felix Kauselmann Date: Wed, 6 Jun 2018 14:06:49 +0200 Subject: [PATCH 2/4] Add .gitattributes rules for text and binary handling Text files' line endings will be internally normalized which should save us a fair amount of headache when merging. Binary files will be left alone. --- .gitattributes | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/.gitattributes b/.gitattributes index 8d4a272b..fe38067e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,3 +6,82 @@ /dependencies/create-dmg export-ignore .gitignore export-ignore .gitattributes export-ignore + +# Auto detect text files and perform LF normalization +# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ +* text=auto + +# +# The above will handle all files NOT found below +# + +# Documents +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain +*.md text +*.adoc text +*.textile text +*.mustache text +*.csv text +*.tab text +*.tsv text +*.sql text + +# Graphics +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.tif binary +*.tiff binary +*.ico binary +# SVG treated as an asset (binary) by default. If you want to treat it as text, +# comment-out the following line and uncomment the line after. +*.svg binary +#*.svg text +*.eps binary + +# Sources +*.c text +*.cc text +*.cxx text +*.cpp text +*.c++ text +*.hpp text +*.h text +*.h++ text +*.hh text + +# Compiled Object files +*.slo binary +*.lo binary +*.o binary +*.obj binary + +# Precompiled Headers +*.gch binary +*.pch binary + +# Compiled Dynamic libraries +*.so binary +*.dylib binary +*.dll binary + +# Compiled Static libraries +*.lai binary +*.la binary +*.a binary +*.lib binary + +# Executables +*.exe binary +*.out binary +*.app binary From a658b0595e69a478f464132a382bb7fa3fd9722a Mon Sep 17 00:00:00 2001 From: Felix Kauselmann Date: Thu, 7 Jun 2018 14:44:18 +0200 Subject: [PATCH 3/4] Update version checker for github. --- common/check_new_version.cpp | 164 +++++++++++++++++------------------ 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/common/check_new_version.cpp b/common/check_new_version.cpp index dd6213d2..47f2156a 100644 --- a/common/check_new_version.cpp +++ b/common/check_new_version.cpp @@ -1,82 +1,82 @@ -#include "check_new_version.h" - -#include -#include -#include - -#include -#include -#include -#include -#include - -#define PREVIOUS_VERSION_TESTING "6.0.0" - -HttpVersionChecker::HttpVersionChecker() - :HttpWorker("https://bitbucket.org/luisangelsm/yacreader/wiki/Home") -{ - connect(this,SIGNAL(dataReady(const QByteArray &)),this,SLOT(checkNewVersion(const QByteArray &))); -} - -void HttpVersionChecker::checkNewVersion(const QByteArray & data) -{ - checkNewVersion(QString(data)); -} - -bool HttpVersionChecker::checkNewVersion(QString sourceContent) -{ -#ifdef Q_OS_WIN32 - QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}win32"); -#endif - -#if defined Q_OS_UNIX && !defined Q_OS_MAC - QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}X11"); -#endif - -#ifdef Q_OS_MAC - QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}Mac"); -#endif - - int index = 0; - bool newVersion = false; - bool sameVersion = true; - //bool currentVersionIsNewer = false; -#ifdef QT_DEBUG - QString version(PREVIOUS_VERSION_TESTING); -#else - QString version(VERSION); -#endif - QStringList sl = version.split("."); - if((index = rx.indexIn(sourceContent))!=-1) - { - int length = qMin(sl.size(),(rx.cap(4)!="")?4:3); - for(int i=0;isl.at(i).toInt()){ - newVersion=true; - break; - } - else - sameVersion = sameVersion && rx.cap(i+1).toInt()==sl.at(i).toInt(); - } - if(!newVersion && sameVersion) - { - if((sl.size()==3)&&(rx.cap(4)!="")) - newVersion = true; - } - } - - if(newVersion == true) - { - emit newVersionDetected(); - return true; - } - else - { - return false; - } -} +#include "check_new_version.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +#define PREVIOUS_VERSION_TESTING "6.0.0" + +HttpVersionChecker::HttpVersionChecker() + :HttpWorker("https://bitbucket.org/luisangelsm/yacreader/wiki/Home") +{ + connect(this,SIGNAL(dataReady(const QByteArray &)),this,SLOT(checkNewVersion(const QByteArray &))); +} + +void HttpVersionChecker::checkNewVersion(const QByteArray & data) +{ + checkNewVersion(QString(data)); +} + +bool HttpVersionChecker::checkNewVersion(QString sourceContent) +{ +#ifdef Q_OS_WIN32 + QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}win32"); +#endif + +#if defined Q_OS_UNIX && !defined Q_OS_MAC + QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}X11"); +#endif + +#ifdef Q_OS_MAC + QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}Mac"); +#endif + + int index = 0; + bool newVersion = false; + bool sameVersion = true; + //bool currentVersionIsNewer = false; +#ifdef QT_DEBUG + QString version(PREVIOUS_VERSION_TESTING); +#else + QString version(VERSION); +#endif + QStringList sl = version.split("."); + if((index = rx.indexIn(sourceContent))!=-1) + { + int length = qMin(sl.size(),(rx.cap(4)!="")?4:3); + for(int i=0;isl.at(i).toInt()){ + newVersion=true; + break; + } + else + sameVersion = sameVersion && rx.cap(i+1).toInt()==sl.at(i).toInt(); + } + if(!newVersion && sameVersion) + { + if((sl.size()==3)&&(rx.cap(4)!="")) + newVersion = true; + } + } + + if(newVersion == true) + { + emit newVersionDetected(); + return true; + } + else + { + return false; + } +} From 8d5e68e4a753811c1dc2ab578d4099d9e3f19d1d Mon Sep 17 00:00:00 2001 From: Felix Kauselmann Date: Sat, 30 Jun 2018 11:01:30 +0200 Subject: [PATCH 4/4] Remove botched .gitattributes changes This reverts commits a658b0595e69a478f464132a382bb7fa3fd9722a and a2c0c65006f00e5924ce9636749ca47c570680cc. --- .gitattributes | 79 ----------------- common/check_new_version.cpp | 164 +++++++++++++++++------------------ 2 files changed, 82 insertions(+), 161 deletions(-) diff --git a/.gitattributes b/.gitattributes index fe38067e..8d4a272b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,82 +6,3 @@ /dependencies/create-dmg export-ignore .gitignore export-ignore .gitattributes export-ignore - -# Auto detect text files and perform LF normalization -# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ -* text=auto - -# -# The above will handle all files NOT found below -# - -# Documents -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain -*.md text -*.adoc text -*.textile text -*.mustache text -*.csv text -*.tab text -*.tsv text -*.sql text - -# Graphics -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.tif binary -*.tiff binary -*.ico binary -# SVG treated as an asset (binary) by default. If you want to treat it as text, -# comment-out the following line and uncomment the line after. -*.svg binary -#*.svg text -*.eps binary - -# Sources -*.c text -*.cc text -*.cxx text -*.cpp text -*.c++ text -*.hpp text -*.h text -*.h++ text -*.hh text - -# Compiled Object files -*.slo binary -*.lo binary -*.o binary -*.obj binary - -# Precompiled Headers -*.gch binary -*.pch binary - -# Compiled Dynamic libraries -*.so binary -*.dylib binary -*.dll binary - -# Compiled Static libraries -*.lai binary -*.la binary -*.a binary -*.lib binary - -# Executables -*.exe binary -*.out binary -*.app binary diff --git a/common/check_new_version.cpp b/common/check_new_version.cpp index 47f2156a..dd6213d2 100644 --- a/common/check_new_version.cpp +++ b/common/check_new_version.cpp @@ -1,82 +1,82 @@ -#include "check_new_version.h" - -#include -#include -#include - -#include -#include -#include -#include -#include - -#define PREVIOUS_VERSION_TESTING "6.0.0" - -HttpVersionChecker::HttpVersionChecker() - :HttpWorker("https://bitbucket.org/luisangelsm/yacreader/wiki/Home") -{ - connect(this,SIGNAL(dataReady(const QByteArray &)),this,SLOT(checkNewVersion(const QByteArray &))); -} - -void HttpVersionChecker::checkNewVersion(const QByteArray & data) -{ - checkNewVersion(QString(data)); -} - -bool HttpVersionChecker::checkNewVersion(QString sourceContent) -{ -#ifdef Q_OS_WIN32 - QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}win32"); -#endif - -#if defined Q_OS_UNIX && !defined Q_OS_MAC - QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}X11"); -#endif - -#ifdef Q_OS_MAC - QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}Mac"); -#endif - - int index = 0; - bool newVersion = false; - bool sameVersion = true; - //bool currentVersionIsNewer = false; -#ifdef QT_DEBUG - QString version(PREVIOUS_VERSION_TESTING); -#else - QString version(VERSION); -#endif - QStringList sl = version.split("."); - if((index = rx.indexIn(sourceContent))!=-1) - { - int length = qMin(sl.size(),(rx.cap(4)!="")?4:3); - for(int i=0;isl.at(i).toInt()){ - newVersion=true; - break; - } - else - sameVersion = sameVersion && rx.cap(i+1).toInt()==sl.at(i).toInt(); - } - if(!newVersion && sameVersion) - { - if((sl.size()==3)&&(rx.cap(4)!="")) - newVersion = true; - } - } - - if(newVersion == true) - { - emit newVersionDetected(); - return true; - } - else - { - return false; - } -} +#include "check_new_version.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +#define PREVIOUS_VERSION_TESTING "6.0.0" + +HttpVersionChecker::HttpVersionChecker() + :HttpWorker("https://bitbucket.org/luisangelsm/yacreader/wiki/Home") +{ + connect(this,SIGNAL(dataReady(const QByteArray &)),this,SLOT(checkNewVersion(const QByteArray &))); +} + +void HttpVersionChecker::checkNewVersion(const QByteArray & data) +{ + checkNewVersion(QString(data)); +} + +bool HttpVersionChecker::checkNewVersion(QString sourceContent) +{ +#ifdef Q_OS_WIN32 + QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}win32"); +#endif + +#if defined Q_OS_UNIX && !defined Q_OS_MAC + QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}X11"); +#endif + +#ifdef Q_OS_MAC + QRegExp rx("YACReader\\-([0-9]+).([0-9]+).([0-9]+)\\.?([0-9]+)?.{0,5}Mac"); +#endif + + int index = 0; + bool newVersion = false; + bool sameVersion = true; + //bool currentVersionIsNewer = false; +#ifdef QT_DEBUG + QString version(PREVIOUS_VERSION_TESTING); +#else + QString version(VERSION); +#endif + QStringList sl = version.split("."); + if((index = rx.indexIn(sourceContent))!=-1) + { + int length = qMin(sl.size(),(rx.cap(4)!="")?4:3); + for(int i=0;isl.at(i).toInt()){ + newVersion=true; + break; + } + else + sameVersion = sameVersion && rx.cap(i+1).toInt()==sl.at(i).toInt(); + } + if(!newVersion && sameVersion) + { + if((sl.size()==3)&&(rx.cap(4)!="")) + newVersion = true; + } + } + + if(newVersion == true) + { + emit newVersionDetected(); + return true; + } + else + { + return false; + } +}