10 class pkgCdromStatus
/*{{{*/
17 virtual ~pkgCdromStatus() {};
20 virtual void SetTotal(int total
) { totalSteps
= total
; };
21 // update steps, will be called regularly as a "pulse"
22 virtual void Update(std::string text
="", int current
=0) = 0;
24 // ask for cdrom insert
25 virtual bool ChangeCdrom() = 0;
27 virtual bool AskCdromName(std::string
&Name
) = 0;
28 // Progress indicator for the Index rewriter
29 virtual OpProgress
* GetOpProgress() {return NULL
; };
32 class pkgCdrom
/*{{{*/
49 bool FindPackages(std::string CD
,
50 std::vector
<std::string
> &List
,
51 std::vector
<std::string
> &SList
,
52 std::vector
<std::string
> &SigList
,
53 std::vector
<std::string
> &TransList
,
54 std::string
&InfoDir
, pkgCdromStatus
*log
,
55 unsigned int Depth
= 0);
56 bool DropBinaryArch(std::vector
<std::string
> &List
);
57 bool DropRepeats(std::vector
<std::string
> &List
,const char *Name
);
58 void ReduceSourcelist(std::string CD
,std::vector
<std::string
> &List
);
59 bool WriteDatabase(Configuration
&Cnf
);
60 bool WriteSourceList(std::string Name
,std::vector
<std::string
> &List
,bool Source
);
61 int Score(std::string Path
);
64 bool Ident(std::string
&ident
, pkgCdromStatus
*log
);
65 bool Add(pkgCdromStatus
*log
);
70 // class that uses libudev to find cdrom/removable devices dynamically
71 struct CdromDevice
/*{{{*/
73 std::string DeviceName
;
75 std::string MountPath
;
78 class pkgUdevCdromDevices
/*{{{*/
81 // libudev dlopen stucture
83 struct udev
* (*udev_new
)(void);
84 int (*udev_enumerate_add_match_property
)(struct udev_enumerate
*udev_enumerate
, const char *property
, const char *value
);
85 int (*udev_enumerate_scan_devices
)(struct udev_enumerate
*udev_enumerate
);
86 struct udev_list_entry
* (*udev_enumerate_get_list_entry
)(struct udev_enumerate
*udev_enumerate
);
87 struct udev_device
* (*udev_device_new_from_syspath
)(struct udev
*udev
, const char *syspath
);
88 struct udev
* (*udev_enumerate_get_udev
)(struct udev_enumerate
*udev_enumerate
);
89 const char* (*udev_list_entry_get_name
)(struct udev_list_entry
*list_entry
);
90 const char* (*udev_device_get_devnode
)(struct udev_device
*udev_device
);
91 struct udev_enumerate
*(*udev_enumerate_new
) (struct udev
*udev
);
92 struct udev_list_entry
*(*udev_list_entry_get_next
)(struct udev_list_entry
*list_entry
);
93 const char* (*udev_device_get_property_value
)(struct udev_device
*udev_device
, const char *key
);
94 int (*udev_enumerate_add_match_sysattr
)(struct udev_enumerate
*udev_enumerate
, const char *property
, const char *value
);
98 pkgUdevCdromDevices();
99 virtual ~pkgUdevCdromDevices();
104 // convenience interface, this will just call ScanForRemovable
105 // with "APT::cdrom::CdromOnly"
106 std::vector
<CdromDevice
> Scan();
108 std::vector
<CdromDevice
> ScanForRemovable(bool CdromOnly
);