Changeset 11776
- Timestamp:
- Feb 13, 2007, 12:20:13 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/warptool.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/warptool.c
r11774 r11776 115 115 static bool definerunMode(pxConfig *config) 116 116 { 117 PS_ASSERT_PTR_NON_NULL(config, NULL);117 PS_ASSERT_PTR_NON_NULL(config, false); 118 118 119 119 // required options … … 236 236 static bool addinputexpMode(pxConfig *config) 237 237 { 238 PS_ASSERT_PTR_NON_NULL(config, NULL);238 PS_ASSERT_PTR_NON_NULL(config, false); 239 239 240 240 bool status = false; … … 569 569 static bool addoverlapMode(pxConfig *config) 570 570 { 571 PS_ASSERT_PTR_NON_NULL(config, NULL);571 PS_ASSERT_PTR_NON_NULL(config, false); 572 572 573 573 bool status = false; … … 668 668 static bool scmapMode(pxConfig *config) 669 669 { 670 PS_ASSERT_PTR_NON_NULL(config, NULL);670 PS_ASSERT_PTR_NON_NULL(config, false); 671 671 672 672 bool status = false; … … 755 755 static bool towarpedMode(pxConfig *config) 756 756 { 757 PS_ASSERT_PTR_NON_NULL(config, NULL); 757 PS_ASSERT_PTR_NON_NULL(config, false); 758 759 bool status = false; 760 psU64 limit = psMetadataLookupU64(&status, config->args, "-limit"); 761 if (!status) { 762 psError(PXTOOLS_ERR_PROG, false, "failed to lookup value for -limit"); 763 return false; 764 } 765 766 // find all rawImfiles matching the default query 767 psString query = psStringCopy( 768 "SELECT\n" 769 " p4SkyCellMap.*\n" 770 " FROM p4Run\n" 771 " JOIN p4SkyCellMap\n" 772 " USING(p4_id)\n" 773 " LEFT JOIN p4Scfile\n" 774 " USING(p4_id, skycell_id, tess_id, exp_tag, p3_version)\n" 775 " WHERE\n" 776 " p4Run.state = 'run'\n" 777 " AND p4Scfile.p4_id IS NULL\n" 778 " AND p4Scfile.skycell_id IS NULL\n" 779 " AND p4Scfile.tess_id IS NULL\n" 780 " AND p4Scfile.exp_tag IS NULL\n" 781 " AND p4Scfile.p3_version IS NULL\n" 782 ); 783 784 if (config->where) { 785 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p4SkyCellMap"); 786 psStringAppend(&query, " AND %s", whereClause); 787 psFree(whereClause); 788 } 789 790 // treat limit == 0 as "no limit" 791 if (limit) { 792 psString limitString = psDBGenerateLimitSQL(limit); 793 psStringAppend(&query, " %s", limitString); 794 psFree(limitString); 795 } 796 797 if (!p_psDBRunQuery(config->dbh, query)) { 798 psError(PS_ERR_UNKNOWN, false, "database error"); 799 psFree(query); 800 return false; 801 } 802 psFree(query); 803 804 psArray *output = p_psDBFetchResult(config->dbh); 805 if (!output) { 806 psErrorCode err = psErrorCodeLast(); 807 switch (err) { 808 case PS_ERR_DB_CLIENT: 809 psError(PXTOOLS_ERR_SYS, false, "database error"); 810 case PS_ERR_DB_SERVER: 811 psError(PXTOOLS_ERR_PROG, false, "database error"); 812 default: 813 psError(PXTOOLS_ERR_PROG, false, "unknown error"); 814 } 815 816 return false; 817 } 818 if (!psArrayLength(output)) { 819 psError(PS_ERR_UNKNOWN, false, "no p4PendingSkyCell rows found"); 820 psFree(output); 821 return true; 822 } 823 824 bool simple = false; 825 { 826 bool status = false; 827 simple = psMetadataLookupBool(&status, config->args, "-simple"); 828 if (!status) { 829 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple"); 830 return false; 831 } 832 } 833 834 if (psArrayLength(output)) { 835 // negative simple so the default is true 836 if (!ippdbPrintMetadatas(stdout, output, "p4PendingSkyCell", !simple)) { 837 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 838 psFree(output); 839 return false; 840 } 841 } 842 843 psFree(output); 844 758 845 return true; 759 846 } … … 762 849 static bool addwarpedMode(pxConfig *config) 763 850 { 764 PS_ASSERT_PTR_NON_NULL(config, NULL);851 PS_ASSERT_PTR_NON_NULL(config, false); 765 852 766 853 bool status = false; … … 856 943 static bool warpedMode(pxConfig *config) 857 944 { 858 PS_ASSERT_PTR_NON_NULL(config, NULL);945 PS_ASSERT_PTR_NON_NULL(config, false); 859 946 860 947 psString query = psStringCopy(
Note:
See TracChangeset
for help on using the changeset viewer.
