This commit is contained in:
Dimitris Zlatanidis 2014-12-15 06:23:48 +02:00
parent eec45d51e9
commit 1107236ec5
11 changed files with 46 additions and 35 deletions

View file

@ -5,7 +5,7 @@ Version 2.1.4-dev
[Updated] - Fix 'UnboundLocalError: local variable 'md5' referenced before assignment' [Updated] - Fix 'UnboundLocalError: local variable 'md5' referenced before assignment'
after try update alien repository in some packages and for Slackware current after try update alien repository in some packages and for Slackware current
users. users. Thanks to 'Jack Kiersey' for reporting.
Version 2.1.3-dev Version 2.1.3-dev
06-12-2014 06-12-2014

View file

@ -50,8 +50,8 @@ Supported Repositories:
Arch: {x86, x86_64} Arch: {x86, x86_64}
Versions: {13.37, 14.0, 14.1} Versions: {13.37, 14.0, 14.1}
* Choose repositories you need to work from file '/etc/slpkg/slpkg.conf' default is all repositories. * Choose repositories you need to work from file '/etc/slpkg/slpkg.conf' default is
all repositories.
Slpkg works in accordance with the standards of the organization slackbuilds.org Slpkg works in accordance with the standards of the organization slackbuilds.org
to builds packages. Also uses the Slackware linux instructions for installation, to builds packages. Also uses the Slackware linux instructions for installation,
@ -64,18 +64,12 @@ display warning messages, etc.
The big advantages is resolving dependencies packages from repositories and monitored for The big advantages is resolving dependencies packages from repositories and monitored for
upgraded packages. upgraded packages.
Of course you wonder how the slpkg is up to date at all times;
It's simple, every time there is a change in ChangeLog.txt before proceeding to any
execution program looksat whether there is a change in file size and downloads and updates
the PACKAGES.TXT file.
Also you can install official packages of your favorite distribution directly from the Also you can install official packages of your favorite distribution directly from the
official repositories official repositories
of Slackware. Even you can check for the official updates and install them. of Slackware. Even you can check for the official updates and install them.
And as we say Slackers, Keep it Simple Stupid! And as we say Slackers, Keep it Simple Stupid!
.. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/slpkg_package.png .. image:: https://raw.githubusercontent.com/dslackw/images/master/slpkg/slpkg_package.png
:target: https://github.com/dslackw/slpkg :target: https://github.com/dslackw/slpkg
@ -139,9 +133,6 @@ Upgrade
In each slpkg upgrade should track the configuration files in the file '/etc/slpkg' for In each slpkg upgrade should track the configuration files in the file '/etc/slpkg' for
new updates. new updates.
*** IMPORTANT :
*** Recommended to replace '/etc/slpkg/slpkg.conf' file with '/etc/slpkg/slpkg.conf.new' file.
Configuration files Configuration files
------------------- -------------------
@ -168,6 +159,15 @@ For Slackware 'current' users must change the variable VERSION in '/etc/slpkg.co
$ slpkg -g --config=nano $ slpkg -g --config=nano
Testing
-------
The majority of trials have been made in an environment Slackware x86_64 and x86 stable version
14.1.
Is logical tests are always to be latest versions of the distribution.
Slpkg are supported version 'current' but it is minimal tests have been done on this release.
Slackware Mirrors Slackware Mirrors
----------------- -----------------
@ -181,7 +181,16 @@ Usage
Need to run '# slpkg update' for the first time to synchronize the list of packages, Need to run '# slpkg update' for the first time to synchronize the list of packages,
also every time you add a repository. also every time you add a repository.
To add repositories must edit the file '/etc/slpkg/slpkg.conf'. To add or remove repositories must edit the file '/etc/slpkg/slpkg.conf'.
Also it is good to inform the list of packages by running the command '# slpkg update'
before proceeding to any installation or upgrade a new package.
Issues
------
Please report any bugs in "https://github.com/dslackw/slpkg/issues"
Command Line Tool Usage Command Line Tool Usage
@ -206,7 +215,7 @@ Command Line Tool Usage
-c, [repository] --upgrade check for updated packages -c, [repository] --upgrade check for updated packages
-s, [repository] [package] download, build & install -s, [repository] [package] download, build & install
-t, [repository] [package] tracking dependencies -t, [repository] [package] tracking dependencies
-p, [repository] [package] --color=[] print package description -p, [repository] [package], --color=[] print package description
-f, [package] find installed packages -f, [package] find installed packages
-n, [package] view SBo packages through network -n, [package] view SBo packages through network
-i, [package...] install binary packages -i, [package...] install binary packages

View file

@ -24,7 +24,7 @@ Usage: slpkg [-h] [-v] [-a script.tar.gz [sources...]]
[-c [repository] --upgrade] [-c [repository] --upgrade]
[-s [repository] [package][ [-s [repository] [package][
[-t [repository] [package]] [-t [repository] [package]]
[-p [repository] [package] --color=] [-p [repository] [package], --color=[]]
[-f] [-n] [-i [...]] [-u [...]] [-f] [-n] [-i [...]] [-u [...]]
[-o [...]] [-r [...]] [-d [...]] [-o [...]] [-r [...]] [-d [...]]
@ -50,7 +50,7 @@ Optional arguments:
-c, [repository] --upgrade check for updated packages -c, [repository] --upgrade check for updated packages
-s, [repository] [package] download, build & install -s, [repository] [package] download, build & install
-t, [repository] [package] tracking dependencies -t, [repository] [package] tracking dependencies
-p, [repository] [package] --color=[] print package description -p, [repository] [package], --color=[] print package description
-f, [package] find installed packages -f, [package] find installed packages
-n, [package] view SBo packages through network -n, [package] view SBo packages through network
-i, [package...] install binary packages -i, [package...] install binary packages
@ -76,6 +76,7 @@ The following commands are available.
\fBslpkg\fP \fBupdate\fP \fBslpkg\fP \fBupdate\fP
.PP .PP
Used to re-synchronize the package lists and create some important files. Used to re-synchronize the package lists and create some important files.
This command must run every new repository is added or new updates is available.
.SS -a, auto build packages .SS -a, auto build packages
\fBslpkg\fP \fB-a\fP <\fIscript\fP> <\fIsources\fP> \fBslpkg\fP \fB-a\fP <\fIscript\fP> <\fIsources\fP>

View file

@ -53,7 +53,7 @@ def options():
"packages", "packages",
" -s, [repository] [package] download, build & install", " -s, [repository] [package] download, build & install",
" -t, [repository] [package] tracking dependencies", " -t, [repository] [package] tracking dependencies",
" -p, [repository] [package] --color=[] print package description", " -p, [repository] [package], --color=[] print package description",
" -f, [package] find installed packages", " -f, [package] find installed packages",
" -n, [package] view SBo packages " " -n, [package] view SBo packages "
"through network", "through network",
@ -79,7 +79,7 @@ def usage():
" [-c [repository] --upgrade]", " [-c [repository] --upgrade]",
" [-s [repository] [package]", " [-s [repository] [package]",
" [-t [repository] [package]", " [-t [repository] [package]",
" [-p [repository] [package] --color=[]]", " [-p [repository] [package], --color=[]]",
" [-f] [-n] [-i [...]] [-u [...]]", " [-f] [-n] [-i [...]] [-u [...]]",
" [-o [...]] [-r [...]] [-d [...]]\n", " [-o [...]] [-r [...]] [-d [...]]\n",
"For more information try 'slpkg --help' or view manpage\n" "For more information try 'slpkg --help' or view manpage\n"

View file

@ -243,8 +243,9 @@ class Initialization(object):
args[0]=log, args[1]=log_file, arg[2]=changelog_txt args[0]=log, args[1]=log_file, arg[2]=changelog_txt
args[3]=lib, args[4]=lib_file, arg[5]=packages_txt args[3]=lib, args[4]=lib_file, arg[5]=packages_txt
args[6]=md5_file, args[7]=checksums_md5 args[6]=md5_file, args[7]=checksums_md5
If the two files differ in size delete and replaced with new.
We take the size of ChangeLog.txt from the server and locally We take the size of ChangeLog.txt from the server and locally.
If the two files differ in size delete and replace all files with new.
''' '''
PACKAGES_TXT = "" PACKAGES_TXT = ""
toolbar_width, index = 2, 0 toolbar_width, index = 2, 0
@ -261,20 +262,23 @@ class Initialization(object):
for fu in args[5].split(): for fu in args[5].split():
PACKAGES_TXT += URL(fu).reading() PACKAGES_TXT += URL(fu).reading()
CHANGELOG_TXT = URL(args[2]).reading() CHANGELOG_TXT = URL(args[2]).reading()
# create CHECKSUMS.md5 file
if args[6]: if args[6]:
CHECKSUMS_md5 = URL(args[7]).reading() CHECKSUMS_md5 = URL(args[7]).reading()
with open("{0}{1}".format(args[3], args[6]), "w") as f: with open("{0}{1}".format(args[3], args[6]), "w") as f:
for line in CHECKSUMS_md5.splitlines(): for line in CHECKSUMS_md5.splitlines():
index += 1 index += 1
toolbar_width = status(index, toolbar_width, 700) toolbar_width = status(index, toolbar_width, 700)
f.write(line + "\n") f.write(line + "\n")
f.close() f.close()
# create PACKAGES.txt file
with open("{0}{1}".format(args[3], args[4]), "w") as f: with open("{0}{1}".format(args[3], args[4]), "w") as f:
for line in PACKAGES_TXT.splitlines(): for line in PACKAGES_TXT.splitlines():
index += 1 index += 1
toolbar_width = status(index, toolbar_width, 700) toolbar_width = status(index, toolbar_width, 700)
f.write(line + "\n") f.write(line + "\n")
f.close() f.close()
# create ChangeLog.txt file
with open("{0}{1}".format(args[0], args[1]), "w") as f: with open("{0}{1}".format(args[0], args[1]), "w") as f:
for line in CHANGELOG_TXT.splitlines(): for line in CHANGELOG_TXT.splitlines():
index += 1 index += 1
@ -320,5 +324,8 @@ def check_exists_repositories():
"/ChangeLog.txt")): "/ChangeLog.txt")):
update = True update = True
if update: if update:
print("\nPlease update packages lists. Run 'slpkg update'\n") print("\nPlease update packages lists. Run 'slpkg update'.\n" +
"This command must run it every time a repository is \n" +
"activated or when you want to see if there are new \n" +
"update packages to them.\n")
sys.exit(0) sys.exit(0)

View file

@ -100,7 +100,6 @@ class Case(object):
def main(): def main():
# repositories = ["sbo", "slack", "rlw", "alien", "slacky"]
s_user(getpass.getuser()) s_user(getpass.getuser())
args = sys.argv args = sys.argv
args.pop(0) args.pop(0)

View file

@ -82,6 +82,6 @@ def slacky_error():
''' '''
Slacky repository error Slacky repository error
''' '''
print("\nRepository slack working together with the slack.") print("\nRepository slack working together with the slacky.")
print("Please add the repository slack from file " + print("Please add the repository slack from file " +
"'/etc/slpkg/slpkg.conf'\n") "'/etc/slpkg/slpkg.conf'\n")

View file

@ -22,7 +22,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import os import os
import sys
from slpkg.toolbar import status from slpkg.toolbar import status
from slpkg.__metadata__ import lib_path from slpkg.__metadata__ import lib_path

View file

@ -321,8 +321,6 @@ def write_deps(dependencies):
name = dependencies[-1] name = dependencies[-1]
if find_package(name + "-", pkg_path): if find_package(name + "-", pkg_path):
dep_path = log_path + "dep/" dep_path = log_path + "dep/"
if not os.path.exists(log_path):
os.mkdir(log_path)
if not os.path.exists(dep_path): if not os.path.exists(dep_path):
os.mkdir(dep_path) os.mkdir(dep_path)
if os.path.isfile(dep_path + name): if os.path.isfile(dep_path + name):

View file

@ -396,8 +396,6 @@ def write_deps(dependencies):
name = dependencies[-1] name = dependencies[-1]
if find_package(name + sp, pkg_path): if find_package(name + sp, pkg_path):
dep_path = log_path + "dep/" dep_path = log_path + "dep/"
if not os.path.exists(log_path):
os.mkdir(log_path)
if not os.path.exists(dep_path): if not os.path.exists(dep_path):
os.mkdir(dep_path) os.mkdir(dep_path)
if os.path.isfile(dep_path + name): if os.path.isfile(dep_path + name):

View file

@ -53,8 +53,8 @@ def track_dep(name, repo):
''' '''
if (not os.path.isfile(lib_path + "slack_repo/PACKAGES.TXT") and if (not os.path.isfile(lib_path + "slack_repo/PACKAGES.TXT") and
repo == "slacky"): repo == "slacky"):
slacky_error() slacky_error()
sys.exit(0) sys.exit(0)
sys.stdout.write("{0}Reading package lists ...{1}".format(color['GREY'], sys.stdout.write("{0}Reading package lists ...{1}".format(color['GREY'],
color['ENDC'])) color['ENDC']))
sys.stdout.flush() sys.stdout.flush()