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/
CMakeCache.txt
CMakeFiles/
*.cmake
Makefile
config/inary.conf
*.py___jb_tmp___
......@@ -2,9 +2,9 @@ Metadata-Version: 1.0
Name: inary
Version: 1.0
Summary: Inary (Special Package Manager)
Home-page: http://www.aquilanipalensis.github.com/inary/
Author: Suleyman POYRAZ (AquilaNipalensis)
Home-page: https://gitlab.com/sulinos/sulinproject/inary
Author: Ali Riza KESKIN (sulincix) & Suleyman POYRAZ (zaryob)
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
Platform: UNKNOWN
......@@ -23,14 +23,14 @@ import inary.cli.command as command
import inary.context as ctx
import inary.db
import inary.errors
import inary.misc.epoch2string as e2s
class AddRepo(command.Command, metaclass=command.autocommand):
__doc__ = _("""Add a repository
Usage: add-repo <repo> <indexuri>
Usage: add-repo <indexuri>
<repo>: name of repository to add
<indexuri>: URI of index file
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)
def run(self):
if len(self.args) == 2:
if len(self.args) == 1:
#We need time based random name.
name=e2s.nextString()
indexuri = self.args[0]
self.init()
name, indexuri = self.args
ctx.ui.debug(name+" "+indexuri)
if ctx.get_option('no_fetch'):
if not ctx.ui.confirm(_('Add {} repository without updating the database?\nBy confirming '
......
# -*- 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",
'inary.analyzer',
'inary.cli',
'inary.data',
'inary.misc',
'inary.db',
'inary.libraries',
'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