加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test.py 2.35 KB
一键复制 编辑 原始数据 按行查看 历史
moshengren 提交于 2024-04-11 02:43 . 同步git修改
import sys
from database.goleveldb.db import packageList
sys.path.append('.')
import deb.local
import deb.formatp
import deb.listp
import deb.package_collection
import deb.package_deps
import deb.package_files
import deb.package
import deb.reflist
import deb.remote
import deb.uploaders
import deb.version
import deb.importp
import files.mocks
import files.package_pool
import files.public
import utils.checksum
import utils.compress
import utils.config
import utils.human
import utils.utils
from typing import List,Dict,Tuple
import api.repos
import database
import api.publish
import deb.snapshot
from context.context import *
def fold(path):
if not os.path.isfile(path) :
t=os.listdir(path)
tt=[]
while t!=[]:
for i in t:
n=os.path.join(path,i)
t.remove(i)
if not os.path.isdir(n):
tt.append(n)
else:
# tt.append(n)
for k in os.listdir(n):
t.append(os.path.join(i,k))
tt.sort()
return tt
# api.repos.apiReposCreate(dict(Name='deepin',Comment='deepin册数',DefaultDistribution='aaa',DefaultComponent='main'))
# reposList=api.repos.apiReposList()
# for i in reposList:
# print(i)
# print(i.__dict__)
# repo=api.repos.apiReposShow('deepin')
# print(repo.__dict__)
# api.repos.apiReposPackagesAdd(dict(name='deepin',PackageRefs=['asdf']))
# from shutil import copyfile
# debDir='/var/spool/apt-mirror/mirror/archive.ubuntukylin.com/ubuntukylin/pool'
# for i in fold(debDir):
# print(i)
# copyfile(i,os.path.join('/root/.aptly/upload/aaa',os.path.basename(i)))
for i in os.listdir('/root/.aptly/upload/aaa'):
api.repos.apiReposPackageFromDir(dict(name='deepin',dir='aaa',file=i,noRemove="1"))
# api.repos.apiReposPackageFromDir(dict(name='deepin',dir='aaa',file='todesk-v4.3.1.0-amd64.deb',noRemove="1",forceReplace=1))
# api.repos.apiReposPackagesShow(dict(name='deepin'))
# api.publish.apiPublishList({})
# api.publish.apiPublishRepoOrSnapshot({'prefix':'filesystem:sparkstore:',"SourceKind": "local","Signing":{"Passphrase":""}, "Sources": [{"Name": "deepin","Component":"main"}], "Architectures": ["i386", "amd64"], "Distribution": "wheezy",'ForceOverwrite':1})
# print(dir(database))
# aptlyContext=AptlyContext()
# gpgSigner=aptlyContext.GetSigner()
# print(gpgSigner.__dict__)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化