Skip to contentSkip to conversation

Add option --version to udevd

PATCH Applied Matthias Schwarzott 2 participants 2 messages Feb 22, 2007 – Feb 24, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add option --version to udevd

Hi!

This small patch adds the option --version to udevd to just print out UDEV_VERSION.
Sometimes the udev-startskript needs to know the udev-version (or needed in the past) and udevd at least is garanteed to exit even if /usr is not yet mounted.

Some versions ago the executable udev had that option, but as that was removed possibilities are either to add --version to some other executable, or to hardcode udev-version into udev-startskript at every upgrade.

Greetings
Matthias

Signature · 1 line
Matthias Schwarzott (zzam)
udevd.c +6 -2
index 8c550d3..23f5fd6 100644
@@ -943,6 +943,7 @@ int main(int argc, char *argv[], char *envp[])
 		{ "debug-trace", 0, NULL, 't' },
 		{ "verbose", 0, NULL, 'v' },
 		{ "help", 0, NULL, 'h' },
+		{ "version", 0, NULL, 'V' },
 		{}
 	};
 	int rc = 1;
@@ -955,7 +956,7 @@ int main(int argc, char *argv[], char *envp[])
 
 	/* parse commandline options */
 	while (1) {
-		option = getopt_long(argc, argv, "dtvh", options, NULL);
+		option = getopt_long(argc, argv, "dtvhV", options, NULL);
 		if (option == -1)
 			break;
 
@@ -972,7 +973,10 @@ int main(int argc, char *argv[], char *envp[])
 				udev_log_priority = LOG_INFO;
 			break;
 		case 'h':
-			printf("Usage: udevd [--help] [--daemon] [--debug-trace] [--verbose]\n");
+			printf("Usage: udevd [--help] [--daemon] [--debug-trace] [--verbose] [--version]\n");
+			goto exit;
+		case 'V':
+			printf("%s\n", UDEV_VERSION);
 			goto exit;
 		default:
 			goto exit;

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

Applied
#1 lore raw
Quoted 9 lines · Matthias Schwarzott

This small patch adds the option --version to udevd to just print out UDEV_VERSION.
Sometimes the udev-startskript needs to know the udev-version (or needed in the past) and udevd at least is garanteed to exit even if /usr is not yet mounted.

Some versions ago the executable udev had that option, but as that was removed possibilities are either to add --version to some other executable, or to hardcode udev-version into udev-startskript at every upgrade.

Applied.

Thanks,
Kay

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel