done
# As we copy, we note everything we're not borrowing as
- # belonging to the parent db.
+ # belonging to the parent db. We borrow shares of a shared
+ # resource. If we borrow only some rather than all of the
+ # shares, neither DB will be able to unshare it.
+
+ # In principle it might be possible to actually use different
+ # shares of the same resource with different dbs. However the
+ # `sharetype' contains the osstest revision, which prevents
+ # sharing between test and real versions of osstest code.
+
cat >>$t.import <<END
$(make_xdbref_task $maindbname 'not borrowed' '' PARENT)
UPDATE resources
SET owntaskid = $(taskid xdbref $maindbname)
- WHERE owntaskid != $(borrowtaskid $task);
+ WHERE owntaskid != $(borrowtaskid $task)
+ AND owntaskid != $(taskid magic shared)
+ AND owntaskid != $(taskid magic preparing);
COMMIT;
END