summaryrefslogtreecommitdiffstats
path: root/perl-install/ugtk2.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-07-14 19:21:53 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-07-14 19:21:53 +0000
commitee3c1dbd19b9b385435eac756d7ca6e38987b964 (patch)
tree70e4f51305bbd6abff513471b71a393935825b85 /perl-install/ugtk2.pm
parent1dfeece63ce449df5f3b16c0e7223b6c1d157a0a (diff)
downloaddrakx-ee3c1dbd19b9b385435eac756d7ca6e38987b964.tar
drakx-ee3c1dbd19b9b385435eac756d7ca6e38987b964.tar.gz
drakx-ee3c1dbd19b9b385435eac756d7ca6e38987b964.tar.bz2
drakx-ee3c1dbd19b9b385435eac756d7ca6e38987b964.tar.xz
drakx-ee3c1dbd19b9b385435eac756d7ca6e38987b964.zip
(destroy_window) kill it since it is no more used for quite some time
Diffstat (limited to 'perl-install/ugtk2.pm')
-rw-r--r--perl-install/ugtk2.pm8
1 files changed, 0 insertions, 8 deletions
diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm
index acf32e422..66d6f0820 100644
--- a/perl-install/ugtk2.pm
+++ b/perl-install/ugtk2.pm
@@ -395,14 +395,6 @@ sub create_dialog {
$ret;
}
-# drakfloppy / logdrake
-sub destroy_window {
- my ($_widget, $windowref, $w2) = @_;
- $$windowref = undef;
- $w2 = undef if defined $w2;
- 0;
-}
-
sub create_hbox { gtkset_layout(gtkset_border_width(Gtk2::HButtonBox->new, 3), $_[0] || 'spread') }
sub create_vbox { gtkset_layout(Gtk2::VButtonBox->new, $_[0] || 'spread') }
/div>
+{
+ struct utsname utsbuf;
+ char path[512];
+
+ uname(&utsbuf);
+ snprintf(mod_name,100,"%s.ko",modulename);
+ snprintf(cmod_name,100,"%s.ko.gz",modulename);
+ snprintf(path,512,"/lib/modules/%s/kernel",utsbuf.release);
+ /* Do not set the third argument of this function to < 6. Blarg. */
+ if (ftw(path,isModule,15) == 1) {
+ return 1;
+ }
+ return 0;
+}
+
+
+int main(int argc, char **argv)
+{
+ char *bus = NULL, *class = NULL;
+ int x, rc;
+ enum deviceBus probeBus = BUS_UNSPEC;
+ enum deviceClass probeClass = CLASS_UNSPEC;
+ poptContext context;
+ struct device **devs;
+ struct poptOption options[] = {
+ POPT_AUTOHELP
+ { "bus", 'b', POPT_ARG_STRING, &bus, 0,
+ "probe only the specified 'bus'",
+ NULL
+ },
+ { "class", 'c', POPT_ARG_STRING, &class, 0,
+ "probe only for the specified 'class'",
+ NULL
+ },
+ { 0, 0, 0, 0, 0, 0 }
+ };
+
+ context = poptGetContext("kmodule", argc, (const char **)argv, options, 0);
+ while ((rc = poptGetNextOpt(context)) > 0) {
+ }
+ if (( rc < -1)) {
+ fprintf(stderr, "%s: %s\n",
+ poptBadOption(context, POPT_BADOPTION_NOALIAS),
+ poptStrerror(rc));
+ exit(-1);
+ }
+
+ if (bus) {
+ for (x=0; bus[x]; x++)
+ bus[x] = toupper(bus[x]);
+ for (x=0; buses[x].string && strcmp(buses[x].string,bus); x++);
+ if (buses[x].string)
+ probeBus = buses[x].busType;
+ }
+ if (class) {
+ for (x=0; class[x]; x++)
+ class[x] = toupper(class[x]);
+ for (x=0; classes[x].string && strcmp(classes[x].string,class); x++);
+ if (classes[x].string)
+ probeClass = classes[x].classType;
+ }
+ initializeBusDeviceList(probeBus);
+
+ devs = probeDevices(probeClass, probeBus, PROBE_NOLOAD);
+ if (!devs)
+ return 0;
+ for (x = 0; devs[x]; x++) {
+ if (devs[x]->driver && isAvailable(devs[x]->driver)) {
+ int i;
+
+ for (i = 0; classes[i].classType; i++)
+ if (devs[x]->type == classes[i].classType) {
+ break;
+ }
+ printf("%s %s\n",classes[i].string,devs[x]->driver);
+ }
+ }
+ return 0;
+}