From 6731c541299da3a0951b12d51442f2f36f89bdb2 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 3 Feb 2019 21:31:09 +0100 Subject: [PATCH 1/6] Updated gen_repos_files.sh alienbob tool to 1.94 Signed-off-by: Dimitris Zlatanidis --- tools/gen_repos_files.sh | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/tools/gen_repos_files.sh b/tools/gen_repos_files.sh index 099d9941..a4962988 100644 --- a/tools/gen_repos_files.sh +++ b/tools/gen_repos_files.sh @@ -28,7 +28,7 @@ # --------------------------------------------------------------------------- cat <<"EOT" # -------------------------------------------------------------------# -# $Id: gen_repos_files.sh,v 1.92 2014/07/31 20:27:53 root Exp root $ # +# $Id: gen_repos_files.sh,v 1.94 2018/05/03 15:02:39 root Exp root $ # # -------------------------------------------------------------------# EOT @@ -36,7 +36,7 @@ EOT BASENAME=$( basename $0 ) # The script'""s revision number will be displayed in the RSS feed: -REV=$( echo "$Revision: 1.92 $" | cut -d' ' -f2 ) +REV=$( echo "$Revision: 1.94 $" | cut -d' ' -f2 ) # The repository owner's defaults file; # you can override any of the default values in this file: @@ -276,6 +276,7 @@ function addpkg { if [ "$FORCEPKG" == "yes" -o ! -f $LOCATION/$TXTFILE ]; then # This is a courtesy service: echo "--> Generating .txt file for $NAME" + rm -f $LOCATION/$TXTFILE $COMPEXE -cd $PKG | tar xOf - install/slack-desc | sed -n '/^#/d;/:/p' > $LOCATION/$TXTFILE [ "$TOUCHUP" == "yes" ] && touch -r $PKG $LOCATION/$TXTFILE || touch -d "$UPDATEDATE" $LOCATION/$TXTFILE fi @@ -303,6 +304,7 @@ function addpkg { SUGGESTS=$($COMPEXE -cd $PKG | tar xOf - install/slack-suggests 2>/dev/null|xargs -r ) fi + rm -f $LOCATION/$METAFILE echo "PACKAGE NAME: $NAME" > $LOCATION/$METAFILE if [ -n "$DL_URL" ]; then echo "PACKAGE MIRROR: $DL_URL" >> $LOCATION/$METAFILE @@ -360,6 +362,7 @@ function addman { # Determine the compression tool used for this package: COMPEXE=$( pkgcomp $PKG ) + rm -f $LOCATION/$LSTFILE cat << EOF > $LOCATION/$LSTFILE ++======================================== || @@ -402,6 +405,7 @@ function genmd5 { if [ "$FORCEMD5" == "yes" -o ! -f $LOCATION/$MD5FILE ]; then echo "--> Generating .md5 file for $NAME" (cd $LOCATION + rm -f $MD5FILE md5sum $NAME > $MD5FILE ) [ "$TOUCHUP" == "yes" ] && touch -r $PKG $LOCATION/$MD5FILE || touch -d "$UPDATEDATE" $LOCATION/$MD5FILE @@ -455,6 +459,7 @@ function gen_filelist { LISTFILE=${2:-FILELIST.TXT} ( cd ${DIR} + rm -f ${LISTFILE} cat < ${LISTFILE} $UPDATEDATE @@ -605,6 +610,7 @@ function rss_changelog { # "+--------------------------+" then we just skip that. [ "$cline" == "+--------------------------+" ] && read cline PUBDATE=$(LC_ALL=C TZ=GMT date +"%a, %e %b %Y %H:%M:%S GMT" -d "$cline") + rm -f ${RSSFILE} cat <<-_EOT_ > ${RSSFILE} @@ -734,6 +740,7 @@ run_repo() { done # Make the changes visible: + rm -f PACKAGES.TXT echo "PACKAGES.TXT; $UPDATEDATE" > PACKAGES.TXT echo "" >> PACKAGES.TXT if [ -n "$DL_URL" ]; then @@ -742,12 +749,15 @@ run_repo() { cat .PACKAGES.TXT | grep -v "PACKAGE MIRROR: " >> PACKAGES.TXT fi rm -f .PACKAGES.TXT + rm -f MANIFEST cat .MANIFEST > MANIFEST rm -f .MANIFEST + rm -f PACKAGES.TXT.gz MANIFEST.bz2 bzip2 -9f MANIFEST gzip -9cf PACKAGES.TXT > PACKAGES.TXT.gz if [ "${CHANGELOG}" == "yes" -a -f ChangeLog.txt ]; then + rm -f ChangeLog.txt.gz gzip -9cf ChangeLog.txt > ChangeLog.txt.gz fi @@ -789,6 +799,7 @@ EOF else find . -type f -print $PRUNES | grep -v CHECKSUMS | sort | xargs md5sum $1 2>/dev/null >> .CHECKSUMS.md5 fi + rm -f CHECKSUMS.md5 CHECKSUMS.md5.gz cat .CHECKSUMS.md5 > CHECKSUMS.md5 gzip -9cf CHECKSUMS.md5 > CHECKSUMS.md5.gz @@ -871,19 +882,37 @@ else rm -f $TESTTMP exit 1 else + # Use the key fingerprint to determine whether GPG-KEY is outdated: + GPG_FPR=$($GPGBIN --with-colon --with-fingerprint --list-keys "$REPOSOWNERGPG" |grep ^fpr |cut -d: -f10) + if [ -r ${REPOSROOT}/GPG-KEY ]; then + # If the GPG-KEY file is outdated (user may have a new key), + # then we delete this file and re-generate it in the next step: + if ! grep -q $GPG_FPR ${REPOSROOT}/GPG-KEY ; then + rm -f ${REPOSROOT}/GPG-KEY + fi + fi if [ ! -r ${REPOSROOT}/GPG-KEY ]; then echo "Generating a "GPG-KEY" file in '$REPOSROOT'," echo " containing the public key information for '$REPOSOWNERGPG'..." $GPGBIN --list-keys "$REPOSOWNERGPG" > ${REPOSROOT}/GPG-KEY + echo "Key fingerprint: $GPG_FPR" >> ${REPOSROOT}/GPG-KEY $GPGBIN -a --export "$REPOSOWNERGPG" >> ${REPOSROOT}/GPG-KEY chmod 444 ${REPOSROOT}/GPG-KEY fi if [ -n "$REPO_SUBDIRS" ]; then for SUBDIR in $REPO_SUBDIRS ; do + if [ -r ${REPOSROOT}}/${SUBDIR}/GPG-KEY ]; then + # If the GPG-KEY file is outdated (user may have a new key), + # then we delete this file and re-generate it in the next step: + if ! grep -q $GPG_FPR ${REPOSROOT}}/${SUBDIR}/GPG-KEY ; then + rm -f ${REPOSROOT}}/${SUBDIR}/GPG-KEY + fi + fi if [ ! -r ${REPOSROOT}/${SUBDIR}/GPG-KEY ]; then echo "Generating a "GPG-KEY" file in '$REPOSROOT/$SUBDIR'," echo " containing the public key information for '$REPOSOWNERGPG'." $GPGBIN --list-keys "$REPOSOWNERGPG" > $REPOSROOT/$SUBDIR/GPG-KEY + echo "Key fingerprint: $GPG_FPR" >> $REPOSROOT/$SUBDIR/GPG-KEY $GPGBIN -a --export "$REPOSOWNERGPG" >> $REPOSROOT/$SUBDIR/GPG-KEY chmod 444 ${REPOSROOT}/${SUBDIR}/GPG-KEY fi From 262d0a7d9a05d81a38694a67b9f270b2c15c9f81 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 3 Feb 2019 21:33:01 +0100 Subject: [PATCH 2/6] Updated changelog file Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index a8177617..917bf396 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +3.4.3 - 03/02/2019 +Updated: +- Update gen_repos_files.sh to version 1.94 + 3.4.2 - 23/01/2019 Fixed: - Bugfixed delete build folder in network option From ddb6ea1b7b58cc5af7dd1fea86d6e0989e35574a Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 19 May 2019 15:56:08 +0200 Subject: [PATCH 3/6] FIxed downloader recognise the char + Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 2 ++ slpkg/downloader.py | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 917bf396..0795735f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,8 @@ 3.4.3 - 03/02/2019 Updated: - Update gen_repos_files.sh to version 1.94 +Fixed: +- Downloader to recognise the char + 3.4.2 - 23/01/2019 Fixed: diff --git a/slpkg/downloader.py b/slpkg/downloader.py index e2fc60b2..c7795a88 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -53,8 +53,7 @@ class Download(object): dwn_count = 1 self._directory_prefix() for dwn in self.url: - # get file name from url and fix passing char '+' - self.file_name = dwn.split("/")[-1].replace("%2B", "+") + self._fix_file_name(dwn.split("/")[-1]) if dwn.startswith("file:///"): source_dir = dwn[7:-7].replace(slack_ver(), "") @@ -82,6 +81,16 @@ class Download(object): self._check_if_downloaded() dwn_count += 1 + def _fix_file_name(self, file_name): + """Get file name from url and fix passing char '+' + """ + if "%2b" in file_name: + self.file_name = file_name.replace("%2b", "+", 5) + elif "%2B" in file_name: + self.file_name = file_name.replace("%2B", "+", 5) + else: + self.file_name = file_name + def _make_tarfile(self, output_filename, source_dir): """Create .tar.gz file """ From b7af72edd23718971d922afedf69fa813a23c747 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 19 May 2019 16:19:18 +0200 Subject: [PATCH 4/6] Moved function to utils.py Signed-off-by: Dimitris Zlatanidis --- slpkg/downloader.py | 13 ++----------- slpkg/utils.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/slpkg/downloader.py b/slpkg/downloader.py index c7795a88..593eac60 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -27,6 +27,7 @@ import tarfile import subprocess from slpkg.messages import Msg +from slpkg.utils import Utils from slpkg.slack.slack_version import slack_ver from slpkg.__metadata__ import MetaData as _meta_ @@ -53,7 +54,7 @@ class Download(object): dwn_count = 1 self._directory_prefix() for dwn in self.url: - self._fix_file_name(dwn.split("/")[-1]) + self.file_name = Utils().fix_file_name(dwn.split("/")[-1]) if dwn.startswith("file:///"): source_dir = dwn[7:-7].replace(slack_ver(), "") @@ -81,16 +82,6 @@ class Download(object): self._check_if_downloaded() dwn_count += 1 - def _fix_file_name(self, file_name): - """Get file name from url and fix passing char '+' - """ - if "%2b" in file_name: - self.file_name = file_name.replace("%2b", "+", 5) - elif "%2B" in file_name: - self.file_name = file_name.replace("%2B", "+", 5) - else: - self.file_name = file_name - def _make_tarfile(self, output_filename, source_dir): """Create .tar.gz file """ diff --git a/slpkg/utils.py b/slpkg/utils.py index 03cdeb10..e762bff2 100644 --- a/slpkg/utils.py +++ b/slpkg/utils.py @@ -92,6 +92,16 @@ class Utils(object): if line and not line.startswith("#"): return line + def fix_file_name(self, file_name): + """Get file name from url and fix passing char '+' + """ + if "%2b" in file_name: + return file_name.replace("%2b", "+", 5) + elif "%2B" in file_name: + return file_name.replace("%2B", "+", 5) + else: + return file_name + def debug(self, test): """Function used for print some stuff for debugging """ From 98487d55143d55857e038ec399bcf82392c7ab02 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 19 May 2019 16:35:55 +0200 Subject: [PATCH 5/6] Fixed build sources with char + in names Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 1 + slpkg/downloader.py | 2 +- slpkg/pkg/build.py | 12 +++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 0795735f..89bd220b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -3,6 +3,7 @@ Updated: - Update gen_repos_files.sh to version 1.94 Fixed: - Downloader to recognise the char + +- Build from sources with char + in name 3.4.2 - 23/01/2019 Fixed: diff --git a/slpkg/downloader.py b/slpkg/downloader.py index 593eac60..4c41dea8 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -26,8 +26,8 @@ import os import tarfile import subprocess -from slpkg.messages import Msg from slpkg.utils import Utils +from slpkg.messages import Msg from slpkg.slack.slack_version import slack_ver from slpkg.__metadata__ import MetaData as _meta_ diff --git a/slpkg/pkg/build.py b/slpkg/pkg/build.py index 3c7b8c57..78847acf 100644 --- a/slpkg/pkg/build.py +++ b/slpkg/pkg/build.py @@ -31,6 +31,7 @@ import tarfile import subprocess import multiprocessing +from slpkg.utils import Utils from slpkg.messages import Msg from slpkg.checksum import check_md5 from slpkg.__metadata__ import MetaData as _meta_ @@ -44,6 +45,7 @@ class BuildPackage(object): def __init__(self, script, sources, path, auto): self.script = script self.sources = sources + self._check_sources() self.path = path self.auto = auto self.meta = _meta_ @@ -89,7 +91,7 @@ class BuildPackage(object): src = src.replace("%20", " ") check_md5(self.sbo_md5[src], src) # copy source and fix passing char '+' from file name - shutil.copy2(src.replace("%2B", "+"), self.path + self.prgnam) + shutil.copy2(src, self.path + self.prgnam) os.chdir(self.path + self.prgnam) # change permissions subprocess.call("chmod +x {0}.SlackBuild".format(self.prgnam), @@ -117,6 +119,14 @@ class BuildPackage(object): except KeyboardInterrupt: # (OSError, IOError): self.msg.pkg_not_found("\n", self.prgnam, "Wrong file", "\n") + def _check_sources(self): + """Fix filenames with char + + """ + new_sources = [] + for src in self.sources: + new_sources.append(Utils().fix_file_name(src)) + self.sources = new_sources + def _create_md5_dict(self): """Create md5 dictionary per source """ From a8460cd8a7377476feeb7d412a389d7dbfb31ddb Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 19 May 2019 17:04:26 +0200 Subject: [PATCH 6/6] Updated to version 3.4.3 Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 2 +- README.md | 2 +- slpkg/__metadata__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 89bd220b..e78b56c3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,4 @@ -3.4.3 - 03/02/2019 +3.4.3 - 19/05/2019 Updated: - Update gen_repos_files.sh to version 1.94 Fixed: diff --git a/README.md b/README.md index 665c52eb..03205773 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# slpkg 3.4.2 +# slpkg 3.4.3 Slpkg is a powerful software package manager that installs, updates, and removes packages on [Slackware](http://www.slackware.com/) based systems. It automatically computes dependencies and diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index 2d2631a0..4acc08d0 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -78,7 +78,7 @@ class MetaData(object): __all__ = "slpkg" __author__ = "dslackw" - __version_info__ = (3, 4, 2) + __version_info__ = (3, 4, 3) __version__ = "{0}.{1}.{2}".format(*__version_info__) __license__ = "GNU General Public License v3 (GPLv3)" __email__ = "d.zlatanidis@gmail.com"