[debian-edu-commits] debian-edu/ 65/183: - list-desktop-profiles now validates precedence filter equations - simplified kommander texts of filters in gui-script (as a bonus all but the precedence filter now work on the new parser also)

Alexander Alemayhu ccscanf-guest at moszumanska.debian.org
Wed Jun 11 16:48:34 UTC 2014


This is an automated email from the git hooks/post-receive script.

ccscanf-guest pushed a commit to branch master
in repository desktop-profiles.

commit 7f17d6bd38c88ee14d12fb397a34d2ef8da14176
Author: Bart Cornelis <cobaco at linux.be>
Date:   Tue May 17 21:32:21 2005 +0000

    - list-desktop-profiles now validates precedence filter equations
    - simplified kommander texts of filters in gui-script (as a bonus
      all but the precedence filter now work on the new parser also)
---
 debian/changelog      |  6 ++++
 list-desktop-profiles | 12 ++++++--
 profile-manager       |  2 +-
 profile-manager.kmdr  | 84 +++++++++++----------------------------------------
 4 files changed, 34 insertions(+), 70 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ee9ca10..4c30681 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+desktop-profiles (1.4.5) UNRELEASED; urgency=low
+
+  * list-desktop-profiles now validates precedence filters equasions
+
+ -- Bart Cornelis (cobaco) <cobaco at linux.be>  Tue, 17 May 2005 22:51:43 +0200
+
 desktop-profiles (1.4.4) unstable; urgency=low
 
   * Added lintian overrides file to eliminate spurious lintian warnings
diff --git a/list-desktop-profiles b/list-desktop-profiles
index 2d42ac4..6ce0e11 100644
--- a/list-desktop-profiles
+++ b/list-desktop-profiles
@@ -36,7 +36,7 @@ Options for filtering the shown profiles:
      next argument gives the comparison to be done with the profiles precedence
      value. Use 'gt' for 'greater then', 'lt' for 'less then', 'ge' for
      'greater then or equal to', 'le' for 'less then or equal to', 'eq' for 
-     'equal to', and 'ne' for 'not equal to'
+     'equal to', and 'ne' for 'not equal to' (e.g. -p 'ge 0')
   -r, --requirement:
      profile requirements field matches the regexp that is the next argument
   -u, --user:
@@ -88,7 +88,15 @@ while test $# -ge 1; do
 	
 	-n | --name) NAME_FILTER="$2" ;;
 	
-	-p | --precedence) PRECEDENCE_FILTER="-$2" ;;
+	-p | --precedence) 
+	  #validate expression
+	  if (echo "$2" | grep -E '^(gt|lt|ge|le|ne|eq) -?[0-9]+$' > /dev/null); then
+	    PRECEDENCE_FILTER="-$2";
+	  else  
+            print_help;
+            exit;
+	  fi;
+	;;
 	
 	-r | --requirement) REQUIREMENT_FILTER="$2" ;;
         
diff --git a/profile-manager b/profile-manager
index 9643ddc..078a4a8 100755
--- a/profile-manager
+++ b/profile-manager
@@ -42,5 +42,5 @@ if (test $kmdrVersion = 1.0) || (echo $kmdrVersion | grep "^0."); then
   $kmdrBinary /usr/share/desktop-profiles/kommander-scripts/profile-manager.kmdr;
 # kommander with new parser ->  known not to work with current script
 else
-  display_message "This script does not yet work with the version of kommander you have installed.\nYou want to try the kommander packager 1:3.3.2";
+  display_message "This script does not yet work with the version of kommander you have installed.\nYou want to try kmdr-executor version 1.0 (kommander packager 1:3.3.2)";
 fi;
diff --git a/profile-manager.kmdr b/profile-manager.kmdr
index 41b49e5..4925029 100644
--- a/profile-manager.kmdr
+++ b/profile-manager.kmdr
@@ -65,9 +65,7 @@
             </property>
             <property name="associations" stdset="0">
                 <stringlist>
-                    <string>true
-
- at setGlobal(tmp, at exec(tempfile))
+                    <string>@setGlobal(tmp, at exec(tempfile))
 @exec(list-desktop-profiles --entry-format '$FILE\;$NAME\;$KIND\;$LOCATION\;$PRECEDENCE\;$REQUIREMENTS\;$DESCRIPTION' @filters > @global(tmp))
 
 @profilesAll.setText(@exec(cat @global(tmp)))
@@ -231,15 +229,7 @@
                                                             <stringlist>
                                                                 <string>@null</string>
                                                                 <string></string>
-                                                                <string>@execBegin
-
-if(@String.isEmpty(@kindRegexp)); then
-  echo "@null";
-else
-  echo "--kind '@kindRegexp'";
-fi
-
- at execEnd</string>
+                                                                <string>--kind '@kindRegexp'</string>
                                                             </stringlist>
                                                         </property>
                                                         <property name="toolTip" stdset="0">
@@ -287,15 +277,7 @@ fi
                                                     <stringlist>
                                                         <string>@null</string>
                                                         <string></string>
-                                                        <string>@execBegin
-
-if(@String.isEmpty(@requirementRegexp)); then
-  echo "@null";
-else
-  echo "--requirement '@requirementRegexp'";
-fi
-
- at execEnd</string>
+                                                        <string>--requirement '@requirementRegexp'</string>
                                                     </stringlist>
                                                 </property>
                                                 <property name="toolTip" stdset="0">
@@ -509,15 +491,7 @@ fi
                                             <stringlist>
                                                 <string>@null</string>
                                                 <string></string>
-                                                <string>@execBegin
-
-if(@String.isEmpty(@userList)); then
-  echo "@null";
-else
-  echo "--user '@userList'";
-fi
-
- at execEnd</string>
+                                                <string>--user '@userList'</string>
                                             </stringlist>
                                         </property>
                                         <property name="toolTip" stdset="0">
@@ -726,7 +700,7 @@ fi
                                         </property>
                                         <property name="associations" stdset="0">
                                             <stringlist>
-                                                <string>@exec(declare -i aid=@sortField.currentItem+1 && echo $aid)</string>
+                                                <string>@expr(@sortField.currentItem+1)</string>
                                             </stringlist>
                                         </property>
                                         <property name="toolTip" stdset="0">
@@ -785,15 +759,7 @@ fi
                                                     <stringlist>
                                                         <string>@null</string>
                                                         <string></string>
-                                                        <string>@execBegin
-
-if(@String.isEmpty(@nameRegexp)); then
-  echo "@null";
-else
-  echo "--name '@nameRegexp'";
-fi
-
- at execEnd</string>
+                                                        <string>--name '@nameRegexp'</string>
                                                     </stringlist>
                                                 </property>
                                                 <property name="toolTip" stdset="0">
@@ -838,15 +804,7 @@ fi
                                             <stringlist>
                                                 <string>@null</string>
                                                 <string></string>
-                                                <string>@execBegin
-
-if(@String.isEmpty(@descriptionRegexp)); then
-  echo @null;
-else
-  echo "--description '@descriptionRegexp'";
-fi
-
- at execEnd</string>
+                                                <string>--description '@descriptionRegexp'</string>
                                             </stringlist>
                                         </property>
                                         <property name="toolTip" stdset="0">
@@ -889,15 +847,7 @@ fi
                                                     <stringlist>
                                                         <string>@null</string>
                                                         <string></string>
-                                                        <string>@execBegin
-
-if(@String.isEmpty(@locationRegexp)); then
-  echo "@null";
-else
-  echo "--location '@locationRegexp'";
-fi
-
- at execEnd</string>
+                                                        <string>--location '@locationRegexp'</string>
                                                     </stringlist>
                                                 </property>
                                                 <property name="toolTip" stdset="0">
@@ -2256,32 +2206,32 @@ fi;
         <slot>execute()</slot>
     </connection>
     <connection>
-        <sender>userList</sender>
-        <signal>widgetTextChanged(const QString)</signal>
+        <sender>deleteProfile</sender>
+        <signal>clicked()</signal>
         <receiver>refreshList</receiver>
         <slot>execute()</slot>
     </connection>
     <connection>
-        <sender>deleteProfile</sender>
+        <sender>commitChanges</sender>
         <signal>clicked()</signal>
         <receiver>refreshList</receiver>
         <slot>execute()</slot>
     </connection>
     <connection>
-        <sender>listDesktopProfilesGUI</sender>
-        <signal>widgetOpened()</signal>
+        <sender>sortField</sender>
+        <signal>widgetTextChanged(const QString&)</signal>
         <receiver>refreshList</receiver>
         <slot>execute()</slot>
     </connection>
     <connection>
-        <sender>commitChanges</sender>
-        <signal>clicked()</signal>
+        <sender>listDesktopProfilesGUI</sender>
+        <signal>widgetTextChanged(const QString&)</signal>
         <receiver>refreshList</receiver>
         <slot>execute()</slot>
     </connection>
     <connection>
-        <sender>sortField</sender>
-        <signal>widgetTextChanged(const QString&)</signal>
+        <sender>listDesktopProfilesGUI</sender>
+        <signal>widgetOpened()</signal>
         <receiver>refreshList</receiver>
         <slot>execute()</slot>
     </connection>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/desktop-profiles.git



More information about the debian-edu-commits mailing list