Simplify --root argument checking
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 20 Aug 2010 07:19:26 +0000 (10:19 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 20 Aug 2010 07:57:35 +0000 (10:57 +0300)
- We haven't accepted url's in as root since ages, wipe out the goo

rpmbuild.c
rpmqv.c

index 63f1e33..ece6bb1 100644 (file)
@@ -187,16 +187,8 @@ int main(int argc, char *argv[])
                 "installation, erasure, querying, and "
                 "database rebuilds"));
 
-    if (rpmcliRootDir) {
-       switch (urlIsURL(rpmcliRootDir)) {
-       default:
-           if (bigMode & MODES_FOR_ROOT)
-               break;
-       case URL_IS_UNKNOWN:
-           if (rpmcliRootDir[0] != '/')
-               argerror(_("arguments to --root (-r) must begin with a /"));
-           break;
-       }
+    if (rpmcliRootDir && rpmcliRootDir[0] != '/') {
+       argerror(_("arguments to --root (-r) must begin with a /"));
     }
 
     if (quiet)
diff --git a/rpmqv.c b/rpmqv.c
index 4032b92..07f9d5b 100644 (file)
--- a/rpmqv.c
+++ b/rpmqv.c
@@ -424,16 +424,8 @@ int main(int argc, char *argv[])
                 "installation, erasure, querying, and "
                 "database rebuilds"));
 
-    if (rpmcliRootDir) {
-       switch (urlIsURL(rpmcliRootDir)) {
-       default:
-           if (bigMode & MODES_FOR_ROOT)
-               break;
-       case URL_IS_UNKNOWN:
-           if (rpmcliRootDir[0] != '/')
-               argerror(_("arguments to --root (-r) must begin with a /"));
-           break;
-       }
+    if (rpmcliRootDir && rpmcliRootDir[0] != '/') {
+       argerror(_("arguments to --root (-r) must begin with a /"));
     }
 
     if (quiet)