Kaydet (Commit) 57368e04 authored tarafından Ali Rıza Keskin's avatar Ali Rıza Keskin

changed repository add method

üst c55c1f83
...@@ -106,6 +106,5 @@ ENV/ ...@@ -106,6 +106,5 @@ ENV/
CMakeCache.txt CMakeCache.txt
CMakeFiles/ CMakeFiles/
*.cmake *.cmake
Makefile
config/inary.conf config/inary.conf
*.py___jb_tmp___ *.py___jb_tmp___
...@@ -2,9 +2,9 @@ Metadata-Version: 1.0 ...@@ -2,9 +2,9 @@ Metadata-Version: 1.0
Name: inary Name: inary
Version: 1.0 Version: 1.0
Summary: Inary (Special Package Manager) Summary: Inary (Special Package Manager)
Home-page: http://www.aquilanipalensis.github.com/inary/ Home-page: https://gitlab.com/sulinos/sulinproject/inary
Author: Suleyman POYRAZ (AquilaNipalensis) Author: Ali Riza KESKIN (sulincix) & Suleyman POYRAZ (zaryob)
Author-email: zaryob.dev@gmail.com Author-email: zaryob.dev@gmail.com
License: GNU GPL2 License: GNU GPL3
Description: Inary is the package management system of Sulin Linux and use with Mac OS, Solaris and FreeBSD Description: Inary is the package management system of Sulin Linux and use with Mac OS, Solaris and FreeBSD
Platform: UNKNOWN Platform: UNKNOWN
...@@ -23,14 +23,14 @@ import inary.cli.command as command ...@@ -23,14 +23,14 @@ import inary.cli.command as command
import inary.context as ctx import inary.context as ctx
import inary.db import inary.db
import inary.errors import inary.errors
import inary.misc.epoch2string as e2s
class AddRepo(command.Command, metaclass=command.autocommand): class AddRepo(command.Command, metaclass=command.autocommand):
__doc__ = _("""Add a repository __doc__ = _("""Add a repository
Usage: add-repo <repo> <indexuri> Usage: add-repo <indexuri>
<repo>: name of repository to add
<indexuri>: URI of index file <indexuri>: URI of index file
NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment
...@@ -60,10 +60,12 @@ NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment ...@@ -60,10 +60,12 @@ NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment
repository.remove_repo(repo) repository.remove_repo(repo)
def run(self): def run(self):
if len(self.args) == 1:
if len(self.args) == 2: #We need time based random name.
name=e2s.nextString()
indexuri = self.args[0]
self.init() self.init()
name, indexuri = self.args ctx.ui.debug(name+" "+indexuri)
if ctx.get_option('no_fetch'): if ctx.get_option('no_fetch'):
if not ctx.ui.confirm(_('Add {} repository without updating the database?\nBy confirming ' if not ctx.ui.confirm(_('Add {} repository without updating the database?\nBy confirming '
...@@ -73,7 +75,7 @@ NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment ...@@ -73,7 +75,7 @@ NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment
return return
repository.add_repo(name, indexuri, ctx.get_option('at')) repository.add_repo(name, indexuri, ctx.get_option('at'))
else: else:
self.help() self.help()
return return
# -*- coding:utf-8 -*-
#
import time
letter='abcdefghijklmnopqrstuvwyzABCDEFGHIJKLMNOPQRSTUWYZ'
len_letter=len(letter)
def nextString(length=0):
source=str(int(time.time()*10000000))
if length > len(source) or length <= 0:
length = len(source)
sr=""
while length > 1:
sr=sr+letter[int(source[len(source)-length]+source[len(source)-length+1])%len(letter)]
length=length-1
return sr
...@@ -198,6 +198,7 @@ setup(name="inary", ...@@ -198,6 +198,7 @@ setup(name="inary",
'inary.analyzer', 'inary.analyzer',
'inary.cli', 'inary.cli',
'inary.data', 'inary.data',
'inary.misc',
'inary.db', 'inary.db',
'inary.libraries', 'inary.libraries',
'inary.operations', 'inary.operations',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment