[Gelistirici] 2009/devel/programming/language/java/sun-java/comar - Fix permissions after the package is installed. I ...

Onur Küçük onur at pardus.org.tr
3 Şub 2010 Çar 19:59:24 EET


On Wed,  3 Feb 2010 19:08:11 +0200 (EET)
Eren Türkay <paketler-commits at pardus.org.tr> wrote:

> 
> Modified:
> 2009/devel/programming/language/java/sun-java/comar/package.py
> =================================================================
> ---
> 2009/devel/programming/language/java/sun-java/comar/package.py
> (original) +++
> 2009/devel/programming/language/java/sun-java/comar/package.py
> Wed Feb  3 19:08:10 2010 @@ -3,18 +3,22 @@ import os import shutil
>  
> +def fixperms(d, executable=False):
> +    for root, dirs, files in os.walk(d):
> +        for name in dirs:
> +            os.chmod(os.path.join(root, name), 0755)
> +        for name in files:
> +            if executable:
> +                os.chmod(os.path.join(root, name), 0755)
> +            else:
> +                os.chmod(os.path.join(root, name), 0644)
> +
> +
>  def postInstall(fromVersion, fromRelease, toVersion, toRelease):
>  
>          # Create files used as storage for system preferences.
>          PREFS_LOCATION = "/opt/sun-jdk/jre"
>  
> -        # previous releases of sun-java changed /opt/sun-jdk/jre
> permissions to 0777
> -        # Removing sun-java package doesn't handle .systemPrefs
> file, which in turn
> -        # leaves /opt/sun-jdk/jre on system whose permission is
> 0777. See: #12209
> -        # We should completely remove jre directory and re-create it
> with appropriate permissions
> -        if os.path.exists(PREFS_LOCATION):
> -            shutil.rmtree(PREFS_LOCATION)
> -
>          try:
>              os.makedirs("%s/.systemPrefs" % PREFS_LOCATION, 0755)
>          except OSError:
> @@ -27,3 +31,8 @@
>          if not os.path.exists("%s/.systemPrefs/.systemRootModFile" %
> PREFS_LOCATION): os.system("/bin/touch %
> s/.systemPrefs/.systemRootModFile" % PREFS_LOCATION) os.system
> ("/bin/chmod 644 %s/.systemPrefs/.systemRootModFile" %
> PREFS_LOCATION) +
> +        # ensure that directory permissions are OK. See #12209
> +        fixperms("/opt/sun-jdk")
> +        # make files in bin/ directory executable
> +        fixperms("/opt/sun-jdk/jre/bin", executable=True)


 Ben bu değişiklikleri anlamadım. Sorun systemPrefs de ise niye
sadece "onu ve jre dizinini değiştirmek" yerine bütün dizinlerde gezip
chmod yapıyoruz ?

 Bu chmod diğer dizinler için gerekliyse niye actions.py de yapmıyoruz ?

 Ya da mesela niye preremove de systemprefs i silmiyoruz / chmod
yapmıyoruz ?


 Bir de bonus soru, java paketinde kırık linkler var, bunlar ne işe
yarıyor ?


 $ ll /opt/sun-jdk/bin/k*
lrwxrwxrwx 1 root root 18 Oca 17 19:27 /opt/sun-jdk/bin/keytool -> ../jre/bin/keytool
lrwxrwxrwx 1 root root 16 Oca 17 19:27 /opt/sun-jdk/bin/kinit -> ../jre/bin/kinit
lrwxrwxrwx 1 root root 16 Oca 17 19:27 /opt/sun-jdk/bin/klist -> ../jre/bin/klist
lrwxrwxrwx 1 root root 15 Oca 17 19:27 /opt/sun-jdk/bin/ktab -> ../jre/bin/ktab




-- 
 Onur Küçük                                      Knowledge speaks,
 <onur.--.-.pardus.org.tr>                       but wisdom listens




Gelistirici mesaj listesiyle ilgili daha fazla bilgi