Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Apply ChangeSet function and verison management into smart. #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@
3.3 Global Settings

1) In Cross-Platform case, make sure the required commands can be invoked preferentially.
For example, you can do it by the following command for Yocto-User
Install toolchain includes the appropriate target architecture into the host development
system. Use the following command for Yocto user to install toolchain. [ARCH] means the
appropriate target architecture.
-----------------------------------------------------------------------
$ source TOOLCHAIN/environment-setup-i586-poky-linux
$ source TOOLCHAIN/environment-setup-[ARCH]-poky-linux
-----------------------------------------------------------------------

2) Make sure the following environment variable point to correct path.
Expand Down
83 changes: 83 additions & 0 deletions smart/commands/init.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#
# Copyright (C) 2016 FUJITSU LIMITED
#
# Written by Fan Xin <[email protected]>
# 2016-08-28
#
# This file is part of Smart2 Package Manager
#
# This file provides the init command
# Usage: smart init
#

from smart.transaction import Transaction, PolicyInstall, sortUpgrades
from smart.transaction import INSTALL, REINSTALL
from smart.option import OptionParser
from smart.cache import Package
from smart import *
import string
import re
import os
import pdb
import sys

#use debug module
#pdb.set_trace()

USAGE=_("smart init [pacakge repository path] [rootfs path] ")

DESCRIPTION=_("""
This command will initial the environment before using smart2.
""")

EXAMPLES=_("""
smart install pkgname
smart install '*kgna*'
smart install pkgname-1.0
smart install pkgname-1.0-1
smart install pkgname1 pkgname2
smart install ./somepackage.file
smart install http://some.url/some/path/somepackage.file
""")

def add (num1=0, num2=0):
return int(num1) + int(num2)

def sub(num1=0, num2=0):
return int(num1) - int(num2)
#def main(ctrl, opts):

def option_parser():
parser = OptionParser(usage=USAGE,
description=DESCRIPTION,
examples=EXAMPLES)
parser.add_option("--info", action="store_true",
help=_("Fan Xin"))
parser.add_option("--paths", action="store_true",
help=_("show path list"))
parser.add_option("--changelog", action="store_true",
help=_("show change log"))
return parser


def parse_options(argv):
parser = option_parser()
opts, args = parser.parse_args(argv)
opts.args = args
return opts

def main(ctrl, opts):

print sys.argv
#pdb.set_trace() #break point added here
addition = add(sys.argv[1], sys.argv[2])
print addition
subtraction = sub(sys.argv[1], sys.argv[2])
print subtraction

print "Hello, this is smart init command."

#if __name__ == '__main__':
# main()

# vim:ts=4:sw=4:et
Loading