- Timestamp:
- Jan 4, 2018, 11:34:41 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r386 r387 931 931 932 932 #--------------------------------------------------------------- 933 # Save computer database 934 sub computerdb_save { 935 my ($computerdb) = @_; 936 937 my $dirdb = $KLASK_DB_FILE; 938 $dirdb =~ s{ / [^/]* $}{}xms; 939 mkdir "$dirdb", 0755 unless -d "$dirdb"; 940 YAML::Syck::DumpFile("$KLASK_DB_FILE", $computerdb); 941 942 return $computerdb; 943 } 944 945 #--------------------------------------------------------------- 933 946 sub get_switchdb_checksum { 934 947 my %switch_db = @_; # same as global %SWITCH_DB … … 1523 1536 printf "\n"; 1524 1537 1525 my $dirdb = $KLASK_DB_FILE; 1526 $dirdb =~ s{ / [^/]* $}{}xms; 1527 mkdir "$dirdb", 0755 unless -d "$dirdb"; 1528 YAML::Syck::DumpFile("$KLASK_DB_FILE", $computerdb); 1538 computerdb_save($computerdb); 1529 1539 1530 1540 for my $one_computer (keys %computer_not_detected) { … … 1558 1568 } 1559 1569 1560 my $dirdb = $KLASK_DB_FILE; 1561 $dirdb =~ s{ / [^/]* $}{}xms; 1562 mkdir "$dirdb", 0755 unless -d "$dirdb"; 1563 YAML::Syck::DumpFile("$KLASK_DB_FILE", $computerdb); 1570 computerdb_save($computerdb); 1564 1571 return; 1565 1572 } … … 1640 1647 }; 1641 1648 1642 my $dirdb = $KLASK_DB_FILE; 1643 $dirdb =~ s{ / [^/]* $}{}xms; 1644 mkdir "$dirdb", 0755 unless -d "$dirdb"; 1645 YAML::Syck::DumpFile("$KLASK_DB_FILE", $computerdb); 1649 computerdb_save($computerdb); 1646 1650 return; 1647 1651 } … … 1753 1757 } 1754 1758 1755 if ($database_has_changed) { 1756 my $dirdb = $KLASK_DB_FILE; 1757 $dirdb =~ s{ / [^/]* $}{}xms; 1758 mkdir "$dirdb", 0755 unless -d "$dirdb"; 1759 YAML::Syck::DumpFile("$KLASK_DB_FILE", $computerdb); 1760 } 1759 computerdb_save($computerdb) if $database_has_changed; 1761 1760 return; 1762 1761 }
Note: See TracChangeset
for help on using the changeset viewer.