<pre style='margin:0'>
Umesh Singla (umeshksingla) pushed a commit to branch gsoc17-migrate
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/bbe3b5bc7d4cdacf8d268a3a33e7a7439c712015">https://github.com/macports/macports-base/commit/bbe3b5bc7d4cdacf8d268a3a33e7a7439c712015</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit bbe3b5bc7d4cdacf8d268a3a33e7a7439c712015
</span>Author: Umesh Singla <umeshksingla@macports.org>
AuthorDate: Fri Aug 18 15:53:51 2017 +0530
<span style='display:block; white-space:pre;color:#404040;'> Register snapshot as a command
</span>---
src/cregistry/snapshot.c | 4 +---
src/macports1.0/migrate.tcl | 5 ++++-
src/macports1.0/snapshot.tcl | 22 ++++------------------
src/registry2.0/registry.c | 1 +
src/registry2.0/snapshotobj.c | 2 +-
5 files changed, 11 insertions(+), 23 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/cregistry/snapshot.c b/src/cregistry/snapshot.c
</span><span style='display:block; white-space:pre;color:#808080;'>index c6a0348..9b3f717 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/cregistry/snapshot.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/cregistry/snapshot.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -92,7 +92,6 @@ reg_snapshot* reg_snapshot_create(reg_registry* reg, char* note, reg_error* errP
</span>
printf("snapshot id: %lld\n", snapshot->id);
<span style='display:block; white-space:pre;background:#ffe0e0;'>- // TODO: move this functions to a different file
</span> int ports_saved = snapshot_store_ports(reg, snapshot, errPtr);
switch (ports_saved) {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -170,7 +169,6 @@ int snapshot_store_ports(reg_registry* reg, reg_snapshot* snapshot, reg_error* e
</span>
printf("port id: %lld, ", entry->id);
<span style='display:block; white-space:pre;background:#ffe0e0;'>- // TODO: move this function to a different file
</span> int port_variants_saved = snapshot_store_port_variants(
reg, entries[i], entry->id, errPtr);
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -555,4 +553,4 @@ int reg_snapshot_ports_get(reg_snapshot* snapshot, port** ports,
</span> const char *text;
// TODO: get ports and their variants using snapshot->id as Fk
return result;
<span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span>\ No newline at end of file
<span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/migrate.tcl b/src/macports1.0/migrate.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 5f68bac..73a7311 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/migrate.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/migrate.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -38,9 +38,12 @@ namespace eval migrate {
</span> # set snapshot [fetch_latest_snapshot]
# }
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts "here 1"
</span>
# create a snapshot
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set snapshot snapshot::main
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set snapshot [snapshot::main $opts]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $snapshot
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts "here 2"
</span> return 0
# fetch ports and variants for this snapshot
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/snapshot.tcl b/src/macports1.0/snapshot.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 83ca6ea..1bda3e5 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/snapshot.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/snapshot.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -18,30 +18,16 @@ namespace eval snapshot {
</span> # Args:
# opts - The options passed in. Currently, there is no option available.
# Returns:
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # registry entry
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # registry::snapshot
</span> #
# TODO:
# use registry::write wrapper here itself
# make it return some value
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts "here 1-1"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> puts "Still being developed"
<span style='display:block; white-space:pre;background:#ffe0e0;'>- #registry::entry addsnapshot
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach port [registry::entry imaged] {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- puts [$port name]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- puts
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set ilist [registry::installed]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # set vimlist [registry::installed vim]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # foreach port $vimlist {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # puts $port
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach port $ilist {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- puts $port
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- puts
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> set snapshot [registry::snapshot create "test snapshot"]
return $snapshot
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/registry2.0/registry.c b/src/registry2.0/registry.c
</span><span style='display:block; white-space:pre;color:#808080;'>index a350396..137c505 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/registry2.0/registry.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/registry2.0/registry.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -391,6 +391,7 @@ int Registry_Init(Tcl_Interp* interp) {
</span> /* Tcl_CreateObjCommand(interp, "registry::graph", GraphCmd, NULL, NULL); */
/* Tcl_CreateObjCommand(interp, "registry::item", item_cmd, NULL, NULL); */
Tcl_CreateObjCommand(interp, "registry::entry", entry_cmd, NULL, NULL);
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ Tcl_CreateObjCommand(interp, "registry::snapshot", snapshot_cmd, NULL, NULL);
</span> Tcl_CreateObjCommand(interp, "registry::file", file_cmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "registry::portgroup", portgroup_cmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "registry::metadata", metadata_cmd, NULL, NULL);
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/registry2.0/snapshotobj.c b/src/registry2.0/snapshotobj.c
</span><span style='display:block; white-space:pre;color:#808080;'>index b2ecc23..7c931a4 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/registry2.0/snapshotobj.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/registry2.0/snapshotobj.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -153,4 +153,4 @@ int snapshot_obj_cmd(ClientData clientData, Tcl_Interp* interp, int objc,
</span> return cmd->function(interp, (reg_snapshot*)clientData, objc, objv);
}
return TCL_ERROR;
<span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span>\ No newline at end of file
<span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span></pre><pre style='margin:0'>
</pre>