[meego-commits] 8140: Changes to MeeGo:1.1:Core/sample-media

Auke Kok no_reply at build.meego.com
Wed Oct 6 21:28:08 UTC 2010


Hi,
I have made the following changes to sample-media in project MeeGo:1.1:Core. Please review and accept ASAP.

Thank You,
Auke Kok

[This message was auto-generated]

---

Request #8140:

  submit:   home:auke:branches:MeeGo:1.1:Core/sample-media(r5)(cleanup) -> MeeGo:1.1:Core/sample-media


Message:
    * Fri Oct 01 2010 Auke Kok <auke-jan.h.kok at intel.com> - 0.2
- Rev. to 0.2: fixes BMC#7061 and BMC#6589
- Split Big Bug Bunny video into low and high resolution version
- Move cc-content into csv format file, into main share folder
- Remove sporadic ._.DS_Store files

State:   new          2010-10-06T14:28:08 auke
Comment: None



changes files:
--------------
--- sample-media.changes
+++ sample-media.changes
@@ -0,0 +1,6 @@
+* Fri Oct 01 2010 Auke Kok <auke-jan.h.kok at intel.com> - 0.2
+- Rev. to 0.2: fixes BMC#7061 and BMC#6589
+- Split Big Bug Bunny video into low and high resolution version
+- Move cc-content into csv format file, into main share folder
+- Remove sporadic ._.DS_Store files
+

old:
----
  sample-media-0.1.tar

new:
----
  sample-media-0.2.tar

spec files:
-----------
--- sample-media.spec
+++ sample-media.spec
@@ -1,23 +1,24 @@
 # 
 # Do NOT Edit the Auto-generated Part!
-# Generated by: spectacle version 0.19
+# Generated by: spectacle version 0.20
 # 
 # >> macros
 # << macros
 
 Name:       sample-media
 Summary:    Pictures, Videos, Music samples
-Version:    0.1
+Version:    0.2
 Release:    1
 Group:      System/Desktop
 License:    Creative Commons
 BuildArch:  noarch
 URL:        http://meego.com/
-Source0:    sample-media-0.1.tar
+Source0:    sample-media-0.2.tar
 Source1:    sample-media-install.sh
 Source2:    sample-media-install.desktop
 Source100:  sample-media.yaml
 Requires:   xdg-user-dirs
+Requires:   xorg-x11-utils-xrandr
 
 
 %description
@@ -51,7 +52,7 @@
 
 cp -a . %{buildroot}%{_datadir}/sample-media
 install -m 755 %{SOURCE1} %{buildroot}%{_bindir}
-install %{SOURCE2} %{buildroot}%{_sysconfdir}/xdg/autostart/
+install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/xdg/autostart/
 
 # << install post
 
@@ -66,7 +67,7 @@
 %dir %{_datadir}/sample-media
 %{_datadir}/sample-media/*
 %{_bindir}/sample-media-install.sh
-%{_sysconfdir}/xdg/autostart/sample-media*
+%config %{_sysconfdir}/xdg/autostart/sample-media*
 # << files
 
 

other changes:
--------------

++++++ sample-media-0.1.tar -> sample-media-0.2.tar
!!! sample-media-0.1.tar and sample-media-0.2.tar differ

++++++ sample-media-install.sh
--- sample-media-install.sh
+++ sample-media-install.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copy sample media to the user's homedir
 #
@@ -7,6 +7,13 @@
 #
 # Written for MeeGo by Auke Kok <auke-jan.h.kok at intel.com>
 
+DATA_DIR=/usr/share/sample-media
+
+get_screen_vsize() {
+	# call/parse xrandr output
+	xrandr |awk ' ($2 == "connected" && $3 ~ /[0-9]/) {print $3}' | sed 's/.*x\([0-9]*\)+.*/\1/'
+}
+
 copy_file() {
 	# copy one file $1 to dest $2. folders are created when needed
 	if [ ! -d "$2/`dirname $1`" ] ; then
@@ -24,7 +31,7 @@
 
 	USERDIR=`xdg-user-dir $2`
 
-	cd /usr/share/sample-media/$1
+	cd "$1"
 
 	mkdir -p $USERDIR
 	# use find . -type f here rather than cp - we can't use cp
@@ -39,9 +46,28 @@
 	done
 }
 
-copy_dir Music MUSIC
-copy_dir Videos VIDEOS
-copy_dir Pictures PICTURES
+# get screen size from xrandr
+VSIZE=$(get_screen_vsize)
+
+
+# walk down all possible xdg-user-dirs and see if there's content
+for DIR in DESKTOP DOWNLOAD TEMPLATES PUBLICSHARE \
+	   DOCUMENTS MUSIC PICTURES VIDEOS; do
+
+	# copy size-specific data
+	if [ $VSIZE -ge 720 -a -d "$DATA_DIR/$DIR-720p" ]; then
+		copy_dir "$DATA_DIR/$DIR-720p" "$DIR"
+	elif [ $VSIZE -ge 480 -a -d "$DATA_DIR/$DIR-480p" ]; then
+		copy_dir "$DATA_DIR/$DIR-480p" "$DIR"
+	elif [ -d "$DATA_DIR/$DIR-240p" ]; then
+		copy_dir "$DATA_DIR/$DIR-240p" "$DIR"
+	fi
+
+	# copy all size-inspecific data
+	if [ -d "$DATA_DIR/$DIR" ]; then
+		copy_dir "$DATA_DIR/$DIR" "$DIR"
+	fi
+done
 
 # create 'blocker' autostart file - this will prevent this script from
 # being run again for this user only.

++++++ sample-media.yaml
--- sample-media.yaml
+++ sample-media.yaml
@@ -1,18 +1,19 @@
 Name: sample-media
 Summary: Pictures, Videos, Music samples
-Version: 0.1
+Version: 0.2
 Release: 1
 Group: System/Desktop
 License: Creative Commons
 URL: http://meego.com/
 Sources:
-    - sample-media-0.1.tar
+    - sample-media-0.2.tar
     - sample-media-install.sh
     - sample-media-install.desktop
 Description: Pictures, Videos, Music samples for meego
 
 Requires: 
     - xdg-user-dirs
+    - xorg-x11-utils-xrandr
 
 Configure: none
 Builder: none




More information about the MeeGo-commits mailing list