Ispravke postinst i pinning
authorZeljko Boros <Zeljko.Boros@carnet.hr>
Mon, 10 May 2021 12:41:44 +0000 (14:41 +0200)
committerZeljko Boros <Zeljko.Boros@carnet.hr>
Mon, 10 May 2021 12:41:44 +0000 (14:41 +0200)
debian/postinst

index dd536da..e1f51d8 100644 (file)
@@ -16,7 +16,7 @@ fi
 # perl se buni ako nema postavljen defaultni locale
 # stavit cemo en_US.UTF-8
 
-if [ ! grep -q "^en_US.UTF-8 UTF-8" /etc/locale.gen ]; then
+if [ ! $(grep -q "^en_US.UTF-8 UTF-8" /etc/locale.gen) ]; then
        # generirat cemo najpotrebnije locale (HR, EN, te HR.UTF i EN.UTF8)
        cp_check_and_sed '# en_US.UTF-8 UTF-8' \
        's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' \
@@ -38,11 +38,13 @@ if [ ! grep -q "^en_US.UTF-8 UTF-8" /etc/locale.gen ]; then
 fi
 
 # Ako ima već neki default ne diramo ga
-if [ ! -f /etc/default/locale ]; then
-       cat > /etc/default/locale <<EOF
+if [ -f /etc/default/locale ]; then
+       if [ ! $(grep -q "^LANG" /etc/default/locale) ]; then
+               cat > /etc/default/locale <<EOF
 LANG=en_US.UTF-8
 LANGUAGE="en_US:en"
 EOF
+       fi
        update-locale
 fi