~vcs-imports/wacs/trunk

« back to all changes in this revision

Viewing changes to modules/wacsid.pm

  • Committer: beaky
  • Date: 2012-11-02 14:32:16 UTC
  • Revision ID: beaky-20121102143216-fiaqxqn4fwebarpu
Updates to transfer archive name to set record.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#
2
2
#    WACSID.PM - identification routine modules
3
3
#
4
 
#    (C) Copyright 2006,2007,2008,2009 B King
 
4
#    (C) Copyright 2006,2007,2008,2009,2012 B King
5
5
#    This file is part of WACS.
6
6
#
7
7
#    WACS is free software; you can redistribute it and/or modify
32
32
                     id_get_modelname id_get_vendor id_get_dbhandle
33
33
                     id_get_key id_get_setkey id_get_setname id_get_status
34
34
                     id_get_notes id_get_setno id_get_srank id_get_sprev
35
 
                     id_get_sduplicates id_get_saltmedia reset_attr
36
 
                     dnld_img dnld_markdone dnld_checkadd dnld_update
37
 
                     vend_dnld id_mpage id_i_fetch id_gen_proto2struct
 
35
                     id_get_sduplicates id_get_saltmedia id_get_sdownload
 
36
                     reset_attr dnld_img dnld_markdone dnld_checkadd 
 
37
                     dnld_update vend_dnld id_mpage 
 
38
                     id_i_fetch id_gen_proto2struct
38
39
                     id_gen_tokenmatchstring id_gen_trymatch id_vid_trymatch
39
40
                     id_gen_getvarval chk_vid_type vid_getsize
40
41
                     find_cookies find_namestem extractphotog
60
61
$id_sprev='';
61
62
$id_sduplicates='';
62
63
$id_saltmedia='';
 
64
$id_sdownload='';
63
65
 
64
66
# global variables
65
67
$vfileloc='';           # vendor download file location
470
472
        $id_sprev='';
471
473
        $id_sduplicates='';
472
474
        $id_saltmedia='';
 
475
        $id_sdownload='';
473
476
}
474
477
 
475
478
# id_get_flag
649
652
        return( $id_saltmedia );
650
653
}
651
654
 
 
655
# id_get_sdownload
 
656
#
 
657
# get the archive name of the download file
 
658
sub id_get_sdownload
 
659
{
 
660
        # return latest value
 
661
        return( $id_sdownload );
 
662
}
 
663
 
652
664
# id_set_attr
653
665
#
654
666
# set the specifed attribute
700
712
        {
701
713
                $id_saltmedia =  $isavalue;
702
714
        }
 
715
        elsif( $isaattr eq "sdownload" )
 
716
        {
 
717
                $id_sdownload = $isavalue;
 
718
        }
703
719
        else
704
720
        {
705
721
                print "id_set_attr: unknown value: ".$isaattr."\n";
714
730
        my( %params )=@_;
715
731
        my( $dnldno, $didtype, $dvendor, $dfname, $dsetflag, $ddbhandle );
716
732
        my( $dsql, $dcsr, @drec );
717
 
        my( $disrank, $disprev, $disduplicates, $disaltmedia );
 
733
        my( $disrank, $disprev, $disduplicates, $disaltmedia, $disdownload );
718
734
        my( $length, $trimed, $modded, $modkey, $imsql, $imcsr );
719
735
        my( $addalt, $ziploc, $zipdir, $zipfile, @ziplist, $zipfound );
720
736
        my( $holdfile );
734
750
        $disprev = $params{'sprev'};
735
751
        $disduplicates = $params{'sduplicates'};
736
752
        $disaltmedia = $params{'saltmedia'};
 
753
        $disdownload = $params{'sdownload'};
737
754
 
738
755
        $length = length $dfname;
739
756
 
749
766
                # not the right model
750
767
                #                0           1         2        3      4
751
768
                $dsql = "select downloadno, dmodelno, dstatus, dtype, dsite, ";
752
 
                #          5         6         7       8     9
753
 
                $dsql .= "dsetname, dsetflag, dsetno, dkey, dsetkey ";
 
769
                #          5         6         7       8     9        10
 
770
                $dsql .= "dsetname, dsetflag, dsetno, dkey, dsetkey, darchive ";
754
771
                $dsql .= "from ".Wacs::conf_get_attr("tables","download")." ";
755
772
                $dsql .= "where downloadno = '".$dnldno."' ";
756
773
                $dsql .= "and dstatus != 'E' ";
940
957
 
941
958
                #                0           1         2        3      4
942
959
                $dsql = "select downloadno, dmodelno, dstatus, dtype, dsite, ";
943
 
                #          5         6         7       8     9
944
 
                $dsql .= "dsetname, dsetflag, dsetno, dkey, dsetkey ";
 
960
                #          5         6         7       8     9        10
 
961
                $dsql .= "dsetname, dsetflag, dsetno, dkey, dsetkey, darchive ";
945
962
                $dsql .= "from ".Wacs::conf_get_attr("tables","download")." ";
946
963
                $dsql .= "where darchive like '".$modded."' ";
947
964
                $dsql .= "and dstatus != 'E' ";
1026
1043
                }
1027
1044
                #                0           1         2        3      4
1028
1045
                $dsql = "select downloadno, dmodelno, dstatus, dtype, dsite, ";
1029
 
                #          5         6         7       8     9
1030
 
                $dsql .= "dsetname, dsetflag, dsetno, dkey, dsetkey ";
 
1046
                #          5         6         7       8     9        10
 
1047
                $dsql .= "dsetname, dsetflag, dsetno, dkey, dsetkey, darchive ";
1031
1048
                $dsql .= "from ".Wacs::conf_get_attr("tables","download")." ";
1032
1049
                $dsql .= "where darchive = '".$holdfile."' ";
1033
1050
                $dsql .= "and dstatus != 'E' ";
1046
1063
        {
1047
1064
                #                0           1         2        3      4
1048
1065
                $dsql = "select downloadno, dmodelno, dstatus, dtype, dsite, ";
1049
 
                #          5         6         7       8     9
1050
 
                $dsql .= "dsetname, dsetflag, dsetno, dkey, dsetkey ";
 
1066
                #          5         6         7       8     9        10
 
1067
                $dsql .= "dsetname, dsetflag, dsetno, dkey, dsetkey, darchive ";
1051
1068
                $dsql .= "from ".Wacs::conf_get_attr("tables","download")." ";
1052
1069
                $dsql .= "where darchive = '".$dfname.".zip' ";
1053
1070
                $dsql .= "and dstatus != 'E' ";
1056
1073
        {
1057
1074
                #                0           1         2        3      4
1058
1075
                $dsql = "select downloadno, dmodelno, dstatus, dtype, dsite, ";
1059
 
                #          5         6         7       8     9
1060
 
                $dsql .= "dsetname, dsetflag, dsetno, dkey, dsetkey ";
 
1076
                #          5         6         7       8     9        10
 
1077
                $dsql .= "dsetname, dsetflag, dsetno, dkey, dsetkey, darchive ";
1061
1078
                $dsql .= "from ".Wacs::conf_get_attr("tables","download")." ";
1062
1079
                $dsql .= "where darchive = '".$dfname.".zip' ";
1063
1080
                $dsql .= "and dstatus != 'E' ";
1094
1111
                $id_sprev = $disprev;   # ....
1095
1112
                $id_sduplicates = $disduplicates;  # more from the unpack
1096
1113
                $id_saltmedia = $disaltmedia;      # file...
 
1114
                $id_sdownload = $drec[10];  # original zip file name
1097
1115
        }
1098
1116
        else
1099
1117
        {
1324
1342
        $id_key = $dkey;
1325
1343
        $id_setkey = $dsetkey;
1326
1344
        $id_status = 'U';  # we've just created it so it must be 'U'
 
1345
        $id_sdownload = $darchive;
1327
1346
 
1328
1347
        # Since we stored a new download record for this model, the 
1329
1348
        # model's idmap for this site should be updated to show that