+ if (classification == RPMLIST)
+ {
+ std::list<String>::iterator lp;
+ String remove_notification("");
+
+ /*
+ * If there are any packages left in the list, they seem to have
+ * disappeared from the system.
+ */
+
+ for (lp = packages.begin(); lp != packages.end(); lp++)
+ {
+ String paramid;
+ String remark;
+ String insert;
+
+ // Construct a qry to check the package's existance
+
+ qry = "select paramid from parameter where objectid='";
+ qry += objectid + "' and class='package' and name='";
+ qry += *lp + "'";
+
+ if (database.Query(qry) == 1)
+ {
+ paramid = database.Field(0, "paramid");
+ qry ="select change_nature from history where paramid='";
+ qry += paramid + "' order by modified desc";
+ if (database.Query(qry) <= 0)
+ {
+ std::cerr << "Database ERROR: no history record for parameter " << *lp << ".\n";
+ }
+ else if (database.Field(0, "change_nature") != "REMOVED")
+ {
+ if (verbose)
+ {
+ std::cout << "Removing parameter " << *lp << ".\n";
+ }
+
+ insert = "insert into history (paramid, modified, change_nature)";
+ insert += " values ('";
+ insert += paramid + "', '" + arrival.format("%Y-%m-%d %T") + "', 'REMOVED')";
+
+ database.Query(insert);
+
+ if (remove_notification == "")
+ {
+ remark = "Gnucomo detected that package(s) have disappeared ";
+ remove_notification = database.new_notification(objectid, "parameter removed", remark);
+ }
+
+ if (remove_notification != "")
+ {
+ insert = "insert into parameter_notification (notificationid, paramid) values ('";
+ insert += remove_notification + "', '";
+ insert += paramid + "')";
+
+ database.Query(insert);
+ }
+ else
+ {
+ std::cerr << "gcm_input ERROR: Cannot create 'parameter removed' notification.\n";
+ }
+ }
+ }
+ }
+ }
+