[arch-commits] Commit in udev/trunk (PKGBUILD load-modules.sh resolve-modalias.c)

Thomas Bächler thomas at archlinux.org
Thu Jan 14 06:04:27 EST 2010


    Date: Thursday, January 14, 2010 @ 06:04:26
  Author: thomas
Revision: 63063

Remove resolve-modalias, use the new modprobe --resolve-alias function which has been merged in module-init-tools 3.11

Modified:
  udev/trunk/PKGBUILD
  udev/trunk/load-modules.sh
Deleted:
  udev/trunk/resolve-modalias.c

--------------------+
 PKGBUILD           |    8 ++---
 load-modules.sh    |    2 -
 resolve-modalias.c |   73 ---------------------------------------------------
 3 files changed, 4 insertions(+), 79 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-01-14 10:57:23 UTC (rev 63062)
+++ PKGBUILD	2010-01-14 11:04:26 UTC (rev 63063)
@@ -15,12 +15,11 @@
 options=(!makeflags !libtool)
 makedepends=('glibc' 'coreutils' 'util-linux' 'libusb' 'glib2' 'kernel26' 'gperf' 'libxslt' 'gobject-introspection')
 source=(http://www.kernel.org/pub/linux/utils/kernel/hotplug/$pkgname-$pkgver.tar.bz2
-        81-arch.rules load-modules.sh resolve-modalias.c cdsymlinks.sh root-link.sh
+        81-arch.rules load-modules.sh cdsymlinks.sh root-link.sh
         arch-udev-rules.patch ignore-remove.sh)
 md5sums=('b218bd15939e8afc6368e1907a48bb26'
          'cc6406e8b67b2b8711942098a66cde6b'
          'f4951f61438d69894b728212dac7318b'
-         '64a0169dc9d883a63ff9f8f491fdc34a'
          '2e808ee78d237c478b57af2a68d43769'
          '2d6dc6842464f107bccc68cd505a6c31'
          '22c1f059cdeddaac5e7fe33b007da6a3'
@@ -37,7 +36,8 @@
   
 package_udev() {
   pkgdesc="The userspace dev tools (udev)"
-  depends=('glibc' 'coreutils' 'util-linux' 'libusb' 'glib2')
+  depends=('glibc' 'coreutils' 'util-linux' 'libusb' 'glib2'
+           'module-init-tools>=3.11')
   install=udev.install
   backup=(etc/udev/udev.conf
           etc/modprobe.d/framebuffer_blacklist.conf)
@@ -54,8 +54,6 @@
   install -D -m644 $srcdir/81-arch.rules $pkgdir/lib/udev/rules.d/81-arch.rules
   # install our module loading subsystem
   install -D -m755 $srcdir/load-modules.sh $pkgdir/lib/udev/load-modules.sh
-  install -d -m755 $pkgdir/bin
-  gcc -Wall $CFLAGS -o $pkgdir/bin/resolve-modalias $srcdir/resolve-modalias.c || return 1
   # install cdsymlinks.sh
   install -D -m755 $srcdir/cdsymlinks.sh $pkgdir/lib/udev/cdsymlinks.sh
   # install root-link.sh

Modified: load-modules.sh
===================================================================
--- load-modules.sh	2010-01-14 10:57:23 UTC (rev 63062)
+++ load-modules.sh	2010-01-14 11:04:26 UTC (rev 63063)
@@ -9,7 +9,7 @@
 BLACKLIST="${MOD_BLACKLIST[@]}"
 MODPROBE="/sbin/modprobe"
 LOGGER="/usr/bin/logger"
-RESOLVEALIAS="/bin/resolve-modalias"
+RESOLVEALIAS="${MODPROBE} --resolve-alias"
 USEBLACKLIST="--use-blacklist"
 
 if [ -f /proc/cmdline ]; then 

Deleted: resolve-modalias.c
===================================================================
--- resolve-modalias.c	2010-01-14 10:57:23 UTC (rev 63062)
+++ resolve-modalias.c	2010-01-14 11:04:26 UTC (rev 63063)
@@ -1,73 +0,0 @@
-#include <stdio.h>
-#include <fnmatch.h>
-#include <string.h>
-#include <malloc.h>
-
-static char *my_getline(FILE *file) {
-  static size_t size = 1024;
-  static char *buf = NULL;
-  static unsigned int i = 0, r = 0;;
-
-  if(buf == NULL)
-    buf = (char*)malloc(size);
-
-  if(i) {
-    memmove(buf, buf+i, size-i);
-    r -= i;
-    i = 0;
-  }
-
-  while(1) {
-    if(i == size) {
-      size *= 2;
-      buf = (char*)realloc(buf, size);
-    }
-
-    if(i==r)
-      r += fread(buf+i, 1, size-i, file);
-
-    if(i==r && i == 0) {
-      free(buf);
-      buf = NULL;
-      r = 0;
-      return NULL;
-    }
-
-    if(i==r || buf[i] == '\n') {
-      buf[i++] = '\0';
-      return buf;
-    }
-    i++;
-  }
-}
-
-int main(int argc, char *argv[]) {
-  char *line, *pattern, *module;
-  char *pos1, *pos2;
-
-  if(argc != 3) {
-      fprintf(stderr, "usage: resolve-modalias <alias file> <modalias>\n");
-      return 1;
-  }
-
-  FILE *f=fopen(argv[1], "r");
-  if(!f) {
-    perror("error opening alias file");
-    return 1;
-  }
-
-  while((line=my_getline(f))!=NULL) {
-    if(!strncmp(line, "alias", strlen("alias"))) {
-      pos1 = index(line, ' ');
-      pos2 = index(pos1+1, ' ');
-      pattern = pos1+1;
-      *pos2 = '\0';
-      module = pos2+1;
-
-      if(!fnmatch(pattern, argv[2], 0))
-        printf("%s\n", module);
-    }
-  }
-  return 0;
-}
-//vim: set ts=2 sw=2 et:



More information about the arch-commits mailing list