add spec
authorAnas Nashif <anas.nashif@intel.com>
Fri, 15 Feb 2013 19:52:16 +0000 (11:52 -0800)
committerAnas Nashif <anas.nashif@intel.com>
Fri, 15 Feb 2013 19:52:16 +0000 (11:52 -0800)
README [new file with mode: 0644]
packaging/swup.spec [new file with mode: 0644]
swup.py

diff --git a/README b/README
new file mode 100644 (file)
index 0000000..1f01a40
--- /dev/null
+++ b/README
@@ -0,0 +1,48 @@
+Introduction
+============
+
+This is a proof of concept software update tool. A few things implemented
+here will go somewhere else, everything is implemented in the script to 
+allow testing, it does not mean this tool is the right place for those
+features.
+
+
+Requirements:
+=============
+- deltarpm
+- Python modules: You probably will need to install a few python module to get this going, including
+python-rpm.
+
+
+Getting Started
+==============
+
+change variables:
+
+update_repo="file:///home/nashif/system-updates/repo"
+update_cache="/tmp/updates"
+
+
+update_repo should point to the path where you have checked out the tree.
+update_cache is a test directory where all data is downloaded and extracted
+
+> ./swup.py -h
+Usage: swup.py [options]
+
+Options:
+  -h, --help            show this help message and exit
+  -V, --os-version      Current OS Version
+  -l, --list-updates    List updates
+  -d, --download-only   Download only
+  -i LABEL, --install=LABEL
+                        Install update
+  -a, --install-all     Install all updates
+  -r, --recommended     Install recommended updates only
+  -q, --quiet           don't print status messages to stdout
+
+
+You can now list updates, download them and prepare them, but still not install them.
+
+
+
+
diff --git a/packaging/swup.spec b/packaging/swup.spec
new file mode 100644 (file)
index 0000000..a558cdf
--- /dev/null
@@ -0,0 +1,28 @@
+Name:           swup
+Version:        0.1
+Release:        0
+License:        GPL-2.0+
+Summary:        Software Update Tool
+Url:            http://www.tizen.org
+Group:          System/Management
+Source:         %{name}-%{version}.tar.bz2
+Requires:       deltarpm
+Requires:       python-lxml
+
+%description
+Software Update Tool.
+
+%prep
+%setup -q
+
+%build
+make %{?_smp_mflags}
+
+%install
+%make_install
+
+%files
+%defattr(-,root,root)
+
+%changelog
+
diff --git a/swup.py b/swup.py
index 1acc587..214614a 100755 (executable)
--- a/swup.py
+++ b/swup.py
@@ -174,7 +174,7 @@ def prepare_update(update_data):
         target_rpm =  "%s-%s-%s.%s.rpm" % (hdr['name'], hdr['version'], hdr['release'], hdr['arch'])
         target_location = "%s/downloads/%s/packages/%s" % (update_cache, u['id'], target_rpm)
         version = "_%s.%s.drpm" % (hdr['release'], hdr['arch'])
-        print version
+        #print version
         original_rpm = "%s.%s.rpm" %( delta.replace(version, ""), hdr['arch'] )
         original_rpm = original_rpm.replace("_%s" % hdr['version'], "")
         print "   %s" %original_rpm
@@ -239,6 +239,10 @@ parser.add_option("-q", "--quiet",
 
 (options, args) = parser.parse_args()
 
+if not os.path.exists(update_cache):
+    os.mkdir("%s" % update_cache)
+    os.mkdir("%s/downloads" % update_cache)
+
 if options.osver:
     os_release = get_current_version()
     print os_release['version_id'].strip('"')