From 08d106bebae1b832516e114deb328b28bf258fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Safa=20Ar=C4=B1man?= Date: Sat, 14 Mar 2020 23:20:29 +0300 Subject: [PATCH] Update readme. Add file rename feature to archive download. --- README | 18 -------- README.md | 98 +++++++++++++++++++++++++++++++++++++++++++ pisi/sourcearchive.py | 7 ++-- pisi/specfile.py | 14 ++++--- 4 files changed, 109 insertions(+), 28 deletions(-) delete mode 100644 README create mode 100644 README.md diff --git a/README b/README deleted file mode 100644 index d1d026d1..00000000 --- a/README +++ /dev/null @@ -1,18 +0,0 @@ -PISI - Packages Installed Succesfully as Intended - -PISI is a new package manager for the PARDUS -distribution. In Turkish PISI means "kitty", and -like a kitty, it is featureful and small. - -Some of its distinctive features: - - - Implemented in python - - Efficient and small - - Package sources are written in XML and python - - Uses LZMA for a better compression ratio - - Fast database access implemented with berkeley DB - - Integrates low-level and high-level package operations (dependency resolution) - - Framework approach to build applications and tools upon - - Comprehensive CLI and a user-friendly qt GUI (distributed separately) - - Extremely simple package construction - diff --git a/README.md b/README.md new file mode 100644 index 00000000..616fb4e2 --- /dev/null +++ b/README.md @@ -0,0 +1,98 @@ +# PISI - Packages Installed Succesfully as Intended +PISI is a package manager. In Turkish PISI means "kitty", and like a kitty, it is featureful and small. + +Some of its distinctive features: + +* Implemented in Python. +* Efficient and small. +* Package sources are written in XML and Python. +* Uses LZMA for a better compression ratio. +* Fast database access implemented with Berkeley DB. +* Integrates low-level and high-level package operations (dependency resolution). +* Framework approach to build applications and tools upon. +* Comprehensive CLI and a user-friendly QT GUI (distributed separately). +* Extremely simple package construction. + + +## Build Dependencies +Python 3.6+, Gettext, Intltool, COMAR + + +## Runtime Dependencies +Python 3.6+, File, Gettext, COMAR, Piksemel, Mudur + + +## Installation +```bash +sudo -H python setup.py install +``` + + +## Usage +```shell +usage: pisi [options] [arguments] + +where is one of: + + add-repo (ar) - Add a repository + blame (bl) - Information about the package owner and release + build (bi) - Build PiSi packages + check - Verify installation + clean - Clean stale locks + configure-pending (cp) - Configure pending packages + delete-cache (dc) - Delete cache files + delta (dt) - Creates delta packages + disable-repo (dr) - Disable repository + emerge (em) - Build and install PiSi source packages from repository + emergeup (emup) - Build and install PiSi source packages from repository + enable-repo (er) - Enable repository + fetch (fc) - Fetch a package + graph - Graph package relations + help (?) - Prints help for given commands + history (hs) - History of pisi operations + index (ix) - Index PiSi files in a given directory + info - Display package information + install (it) - Install PiSi packages + list-available (la) - List available packages in the repositories + list-components (lc) - List available components + list-installed (li) - Print the list of all installed packages + list-newest (ln) - List newest packages in the repositories + list-orphaned (lo) - List orphaned packages + list-pending (lp) - List pending packages + list-repo (lr) - List repositories + list-sources (ls) - List available sources + list-upgrades (lu) - List packages to be upgraded + rebuild-db (rdb) - Rebuild Databases + remove (rm) - Remove PiSi packages + remove-orphaned (ro) - Remove orphaned packages + remove-repo (rr) - Remove repositories + search (sr) - Search packages + search-file (sf) - Search for a file + update-repo (ur) - Update repository databases + upgrade (up) - Upgrade PiSi packages + +Use "pisi help " for help on a specific command. + + +Options: + --version : show program's version number and exit + -h [--help] : show this help message and exit + + general options: + -D [--destdir] arg : Change the system root for PiSi commands + -y [--yes-all] : Assume yes in all yes/no queries + -u [--username] arg + -p [--password] arg + -L [--bandwidth-limit] arg : Keep bandwidth usage under specified KB's + -v [--verbose] : Detailed output + -d [--debug] : Show debugging information + -N [--no-color] : Suppresses all coloring of PiSi's output +``` + + +## Contributing +Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. + + +## License +[GPLv2](https://choosealicense.com/licenses/gpl-2.0/) diff --git a/pisi/sourcearchive.py b/pisi/sourcearchive.py index e6fb0173..a03eea19 100644 --- a/pisi/sourcearchive.py +++ b/pisi/sourcearchive.py @@ -47,8 +47,8 @@ class SourceArchive: and unpacking a source archive""" def __init__(self, archive): self.url = pisi.uri.URI(archive.uri) - self.archiveFile = os.path.join(ctx.config.archives_dir(), self.url.filename()) self.archive = archive + self.archiveFile = os.path.join(ctx.config.archives_dir(), self.archive.name) def fetch(self, interactive=True): if not self.is_cached(interactive): @@ -62,15 +62,14 @@ class SourceArchive: if self.url.get_uri().startswith("mirrors://"): self.fetch_from_mirror() else: - pisi.fetcher.fetch_url(self.url, ctx.config.archives_dir(), self.progress) + pisi.fetcher.fetch_url(self.url, ctx.config.archives_dir(), self.progress, self.archive.name) except pisi.fetcher.FetchError: if ctx.config.values.build.fallback: self.fetch_from_fallback() else: raise - ctx.ui.info(_("Source archive is stored: %s/%s") - % (ctx.config.archives_dir(), self.url.filename())) + ctx.ui.info(_("Source archive is stored: %s/%s") % (ctx.config.archives_dir(), self.archive.name)) def fetch_from_fallback(self): archive = os.path.basename(self.url.get_uri()) diff --git a/pisi/specfile.py b/pisi/specfile.py index 2a78d6d4..44eb5792 100644 --- a/pisi/specfile.py +++ b/pisi/specfile.py @@ -149,15 +149,17 @@ class ComarProvide(metaclass=autoxml.autoxml): s += ' (' + self.om + '%s' % (' for %s' % self.name if self.name else '') + ')' return s -class Archive(metaclass=autoxml.autoxml): - s_uri = [ autoxml.String, autoxml.mandatory ] - a_type = [ autoxml.String, autoxml.optional ] - a_sha1sum =[ autoxml.String, autoxml.mandatory ] - a_target =[ autoxml.String, autoxml.optional ] +class Archive(metaclass=autoxml.autoxml): + s_uri = [autoxml.String, autoxml.mandatory] + a_type = [autoxml.String, autoxml.optional] + a_sha1sum = [autoxml.String, autoxml.mandatory] + a_target = [autoxml.String, autoxml.optional] + a_name = [autoxml.String, autoxml.optional] def decode_hook(self, node, errs, where): - self.name = os.path.basename(self.uri) + if not self.name: + self.name = os.path.basename(self.uri) def __str__(self): s = _('URI: %s, type: %s, sha1sum: %s') % (self.uri, self.type, self.sha1sum)